* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #FF6B35;
  --primary-dark: #E65100;
  --secondary: #4CAF50;
  --background: #F5F5F5;
  --card-bg: #FFFFFF;
  --text-dark: #212121;
  --text-medium: #757575;
  --text-light: #BDBDBD;
  --price-color: #2E7D32;
  --discount-badge: #E53935;
  --tag-bg: #FFF3E0;
  --tag-text: #E65100;
  --star-color: #FFC107;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --radius: 16px;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--background);
  color: var(--text-dark);
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 20px 24px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  font-size: 32px;
  line-height: 1;
}

.header-text h1 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header-text p {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 400;
}

/* Search */
.search-container {
  max-width: 1200px;
  margin: 12px auto 0;
  position: relative;
}

.search-container input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  background: rgba(255,255,255,0.95);
  color: var(--text-dark);
  outline: none;
  transition: box-shadow 0.2s;
}

.search-container input:focus {
  box-shadow: 0 0 0 3px rgba(255,107,53,0.3);
}

.search-container input::placeholder {
  color: var(--text-light);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-medium);
  font-size: 20px;
  cursor: pointer;
}

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-medium);
  font-size: 18px;
  cursor: pointer;
  display: none;
  background: var(--background);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* Section titles */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

.section-title .count {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}

/* Reviews Section */
.reviews-section {
  margin-bottom: 24px;
}

.reviews-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.reviews-scroll::-webkit-scrollbar { display: none; }

.review-card {
  min-width: 280px;
  max-width: 320px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.review-author h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.review-author .verified {
  font-size: 11px;
  color: var(--secondary);
  font-weight: 500;
}

.review-stars {
  color: var(--star-color);
  font-size: 14px;
  margin-bottom: 6px;
}

.review-text {
  font-size: 13px;
  color: var(--text-medium);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.review-product-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.review-product-info img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.review-product-info .rp-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.2;
}

.review-product-info .rp-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--price-color);
}

/* Articles Section */
.articles-section {
  margin-bottom: 24px;
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.article-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.article-card-image {
  height: 180px;
  overflow: hidden;
  position: relative;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.article-card:hover .article-card-image img {
  transform: scale(1.05);
}

.article-card-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.article-card-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 6px;
}

.article-card-body p {
  font-size: 13px;
  color: var(--text-medium);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  flex: 1;
}

.article-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.article-card-footer span {
  transition: transform 0.2s;
}

.article-card:hover .article-card-footer span {
  transform: translateX(4px);
}

.articles-view-all {
  text-align: center;
  margin-top: 16px;
}

.articles-view-all a {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.articles-view-all a:hover {
  color: var(--primary-dark);
}

/* Featured Banner / Carousel */
.featured-section {
  margin-bottom: 24px;
}

.featured-carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 200px;
}

.featured-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
}

.featured-slide.active {
  opacity: 1;
}

.featured-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.8));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.featured-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.featured-overlay h3 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}

.featured-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.featured-discount {
  background: var(--discount-badge);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.featured-price {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

/* Dots */
.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 10px;
  background: var(--text-light);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}

.dot.active {
  width: 18px;
  background: var(--primary);
}

/* Categories */
.categories-section {
  margin-bottom: 24px;
}

.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 30px;
  border: 1.5px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  user-select: none;
}

.category-chip:hover {
  border-color: var(--primary);
  background: #FFF5F0;
}

.category-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}

.category-chip .emoji {
  font-size: 16px;
}

/* Products Grid */
.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.product-card-image {
  position: relative;
  height: 140px;
  background: #f0f0f0;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-image .discount-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--discount-badge);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.product-card-tags {
  display: flex;
  gap: 4px;
  padding: 8px 10px 0;
  flex-wrap: wrap;
}

.product-card-tags .tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.product-card-body {
  padding: 8px 10px 12px;
}

.product-card-body h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.product-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-medium);
  margin-bottom: 6px;
}

.product-card-rating .stars {
  color: var(--star-color);
}

.product-card-price {
  display: flex;
  flex-direction: column;
}

.product-card-price .original {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: line-through;
}

.product-card-price .current {
  font-size: 15px;
  font-weight: 700;
  color: var(--price-color);
}

/* States */
.loading-state, .empty-state, .error-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.loading-state .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p, .empty-state p, .error-state p {
  color: var(--text-medium);
  font-size: 14px;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.error-state .error-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.btn-retry {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-retry:hover {
  background: var(--primary-dark);
}

/* Loading More */
.loading-more {
  display: none;
  justify-content: center;
  padding: 24px;
}

.loading-more .spinner-small {
  width: 24px;
  height: 24px;
  border: 3px solid #eee;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  overflow-y: auto;
  padding: 24px 16px;
  animation: fadeIn 0.2s;
}

.modal-overlay.open {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  max-width: 500px;
  margin: 20px auto;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.modal-body {
  padding: 20px;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.modal-tags .tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.modal-body h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.modal-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-medium);
}

.modal-rating .stars {
  color: var(--star-color);
}

.modal-price-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.modal-price-section .original-price {
  font-size: 16px;
  color: var(--text-light);
  text-decoration: line-through;
}

.modal-price-section .current-price {
  font-size: 26px;
  font-weight: 700;
  color: var(--price-color);
}

.modal-price-section .savings {
  font-size: 13px;
  color: var(--price-color);
  font-weight: 500;
}

.modal-price-section .discount-badge {
  background: var(--discount-badge);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.modal-divider {
  height: 1px;
  background: #eee;
  margin: 16px 0;
}

.modal-body h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.modal-body .description {
  font-size: 14px;
  color: var(--text-medium);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-affiliate-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--secondary), #388E3C);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.modal-affiliate-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(76,175,80,0.4);
}

.modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 210;
}

.modal-close:hover {
  background: rgba(0,0,0,0.7);
}

/* ML Banner */
.ml-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: #FFF3E0;
  border: 1.5px solid #FFB74D;
  border-radius: 14px;
  padding: 14px 18px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-dark);
  flex-wrap: wrap;
}

.ml-banner a {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  transition: background 0.2s;
}

.ml-banner a:hover {
  background: var(--primary-dark);
}

/* Skeleton loading */
.skeleton {
  background: #f0f0f0;
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-img {
  height: 140px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-body {
  padding: 12px 10px;
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-line.medium {
  width: 80%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Article Full Page */
.article-full {
  animation: fadeIn 0.3s;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1.5px solid #eee;
  border-radius: 10px;
  padding: 8px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-medium);
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.article-back:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.article-full-image {
  width: 100%;
  height: 240px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.article-full-body {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.article-full-body .article-card-category {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.article-full-body h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 8px;
}

.article-full-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.article-full-content {
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.7;
}

.article-full-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--text-dark);
}

.article-full-content p {
  margin-bottom: 12px;
  color: var(--text-medium);
}

.article-full-content strong {
  color: var(--text-dark);
}

.article-cta {
  margin-top: 28px;
  padding: 20px;
  background: #FFF8F0;
  border: 1.5px solid #FFE0B2;
  border-radius: var(--radius);
}

.article-cta h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.article-cta-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.article-cta-card img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
}

.article-cta-card strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  display: block;
  margin-bottom: 4px;
}

.article-cta-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--price-color);
}

/* Footer bottom */
.footer-bottom {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-light);
  font-size: 12px;
}

.footer-bottom .footer-links {
  margin-top: 8px;
}

.footer-bottom .footer-links a {
  color: var(--text-medium);
  text-decoration: none;
  margin: 0 8px;
  font-size: 12px;
}

.footer-bottom .footer-links a:hover {
  color: var(--primary);
}

/* Responsive */
@media (min-width: 600px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .featured-carousel {
    height: 280px;
  }

  .header {
    padding: 24px 32px 16px;
  }

  .container {
    padding: 24px 32px;
  }

  .modal-content {
    margin: 40px auto;
  }

  .modal-image {
    height: 340px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
