
:root {
  --primary-color: #ee4d2d;
  --text-color: #333;
  --bg-color: #f5f5f5;
  --white: #ffffff;
  --gray: #999;
  --border-color: #e8e8e8;
  --price-color: #ee4d2d;
  --header-height: auto;
  --bottom-nav-height: 60px;
  --card-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  --pill-bg: #f0f0f0;
  --pill-active-bg: #fff0eb;
  --pill-active-color: #ee4d2d;
  --pill-exclude-active-bg: #ffebee;
  --pill-exclude-active-color: #d32f2f;
  --meta-color: #888;
  --meta-time-color: #888;
}

[data-theme="dark"] {
  --text-color: #e0e0e0;
  --bg-color: #121212;
  --white: #1e1e1e;
  --gray: #aaaaaa;
  --border-color: #333;
  --card-bg: #1e1e1e;
  --shadow: 0 1px 2px rgba(255, 255, 255, 0.05);
  --hover-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
  --pill-bg: #333;
  --pill-active-bg: #3a1c1c;
  --pill-exclude-active-bg: #3a1c1c;
  --meta-color: #bdbdbd;
  --meta-time-color: #f0f0f0;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-400.ttf") format("truetype");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/roboto-700.ttf") format("truetype");
}

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

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-bottom: var(--bottom-nav-height);
  transition: background-color 0.3s, color 0.3s;
}

.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  background-color: var(--bg-color);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.page-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.product-grid {
  align-content: start;
}

/* Chỉ giãn vùng grid khi đang loading / chưa có SP */
.product-grid:not(:has(.product-card)) {
  flex: 1 1 auto;
}

.product-grid:has(.product-card) {
  flex: 0 0 auto;
}

/* Header trong luồng trang — không fixed (tránh padding giả / khoảng trắng) */
.main-header {
  background-color: var(--white);
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  max-width: 1200px;
  z-index: 20;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transform: none !important;
}

.main-header.hidden-header {
  transform: none !important;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(-180deg, #f53d2d, #f63);
  color: #fff;
  gap: 10px;
}

.logo h1,
.logo .site-brand {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  color: #fff;
  text-decoration: none;
}

.logo .site-brand:hover {
  text-decoration: underline;
}

/* Search Bar */
.search-bar-container {
  flex: 1;
  max-width: 600px;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-wrapper input {
  width: 100%;
  padding: 8px 10px 8px 35px;
  border-radius: 4px;
  border: none;
  outline: none;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

.icon-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
}

/* Filter Section */
.filter-section {
  padding: 10px 15px;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  /* transition removed to prevent lag */
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  display: block;
}

.filter-section.collapsed {
  display: none;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-bottom: none;
}

.filter-group {
  margin-bottom: 10px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--gray);
  margin-bottom: 5px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background-color: var(--pill-bg);
  color: var(--text-color);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

a.filter-pill:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-pill i {
  font-size: 11px;
}

/* Active States */
.filter-pill.active {
  background-color: var(--pill-active-bg);
  color: var(--pill-active-color);
  border-color: var(--pill-active-color);
}

.filter-pill.exclude.active {
  background-color: var(--pill-exclude-active-bg);
  color: var(--pill-exclude-active-color);
  border-color: var(--pill-exclude-active-color);
}

/* Time & Shop Filter */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.time-pill {
  padding: 6px 12px;
  border-radius: 4px;
  background-color: #333;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
}

.shop-filter-container {
  flex: 1;
  min-width: 150px;
}

/* Time Filter Pills */
.pill {
  padding: 6px 12px;
  border-radius: 4px;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.pill:hover {
  background-color: var(--border-color);
}

.pill.active {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(238, 77, 45, 0.3);
}

.shop-input {
  width: 100%;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 12px;
  outline: none;
}

.sort-select {
  padding: 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 12px;
  outline: none;
  min-width: 120px;
}

/* Stats Bar — ẩn (dùng bottom nav); giữ DOM cho app.js */
.stats-bar--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stats-bar {
  display: flex;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 10px 5px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.stat-item.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.stat-count {
  font-weight: bold;
  margin-left: 4px;
}

/* Product Grid — full-bleed ngang bằng bottom-nav / header */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px 0 !important;
  margin-top: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.product-card {
  background-color: var(--card-bg);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--hover-shadow);
}

.product-img-wrapper {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
}

.product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discount-tag {
  position: absolute;
  top: 0;
  right: 0;
  background-color: rgba(255, 212, 36, 0.9);
  color: #ee4d2d;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  z-index: 1;
}

.discount-tag::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 4px solid rgba(255, 212, 36, 0.9);
  position: absolute;
  bottom: -4px;
  left: 0;
}

.product-info {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-title {
  font-size: 12px;
  line-height: 14px;
  height: 28px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 4px;
  color: var(--text-color);
}

.price-section {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.current-price {
  color: var(--primary-color);
  font-size: 16px;
  font-weight: bold;
  margin-right: 4px;
}

.current-price::before {
  content: "₫";
  font-size: 12px;
}

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

.original-price::before {
  content: "₫";
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--meta-color);
  margin-bottom: 4px;
}

.product-meta span:last-child {
  color: var(--meta-time-color);
  font-weight: 500;
  white-space: nowrap;
}

[data-theme="dark"] .product-meta {
  font-size: 11px;
}

.progress-bar-container {
  position: relative;
  background-color: #ffbda6;
  border-radius: 8px;
  height: 16px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  background: linear-gradient(to right, #ac0b0b 0%, #ee4d2d 100%);
  height: 100%;
  border-radius: 8px 0 0 8px;
}

.progress-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Card Actions (Always Visible) */
.card-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

.action-btn-full {
  flex: 1 1 calc(50% - 2px);
  border: 1px solid var(--primary-color);
  background-color: #fff;
  color: var(--primary-color);
  padding: 4px;
  border-radius: 2px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.action-btn-full.btn-variations {
  flex: 1 1 100%;
}

.action-btn-full.primary {
  background-color: var(--primary-color);
  color: #fff;
}

.action-btn-full:hover {
  opacity: 0.9;
}

/* Floating Actions (Heart/Eye) */
.card-floating-actions {
  position: absolute;
  top: 5px;
  left: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  color: #333;
}

[data-theme="dark"] .action-btn {
  background-color: rgba(30, 30, 30, 0.9);
  color: #e0e0e0;
}

.action-btn:hover {
  background-color: var(--white);
  color: var(--primary-color);
}

.action-btn.active {
  color: var(--primary-color);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  background-color: var(--white);
  display: flex;
  border-top: 1px solid var(--border-color);
  height: var(--bottom-nav-height);
  z-index: 100;
  transition: background-color 0.3s;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray);
  font-size: 10px;
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}

a.nav-item:hover,
button.nav-item:hover {
  color: var(--primary-color);
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.loading,
.loading-more {
  text-align: center;
  padding: 20px;
  color: var(--gray);
  grid-column: 1 / -1;
  width: 100%;
}

.hidden {
  display: none;
}

/* Share Popup Modal */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.share-modal-content {
  background: var(--card-bg);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease;
}

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

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.share-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-color);
}

.share-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray);
  cursor: pointer;
  transition: color 0.3s ease;
}

.share-modal-close:hover {
  color: var(--text-color);
}

.share-modal-body {
  padding: 16px 20px 20px;
}

.variations-modal-content {
  max-width: 520px;
}

#variations-modal-body {
  max-height: min(60vh, 420px);
  overflow-y: auto;
}

.variations-loading,
.variations-empty {
  text-align: center;
  padding: 18px 8px;
  color: var(--text-muted, #666);
  font-size: 14px;
}

.variations-heading {
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 2px solid #ee4d2d;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ee4d2d;
  text-align: center;
}

.variations-plain {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-color, #333);
}

.variations-plain-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color, #eee);
  word-break: break-word;
}

.variations-plain-row:last-child {
  border-bottom: none;
}

.variations-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #eee);
  display: flex;
  justify-content: center;
}

.variations-actions .variations-buy-btn {
  flex: none;
  width: auto;
  min-width: 180px;
  max-width: 100%;
  padding: 12px 28px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  gap: 8px;
  line-height: 1.2;
}

.variations-actions .variations-buy-btn i {
  font-size: 16px;
}

.variations-tiers {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.variations-tier {
  margin-bottom: 6px;
}

.variations-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.variations-list li {
  margin-bottom: 4px;
}

.btn-variations {
  background: #fff7ed !important;
  color: #c2410c !important;
  border: 1px solid #fdba74 !important;
}

.model-count-badge {
  color: #c2410c;
  font-weight: 600;
  white-space: nowrap;
}

[data-theme="dark"] .btn-variations {
  background: #3b2314 !important;
  color: #fdba74 !important;
  border-color: #9a3412 !important;
}

.share-link-container {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.share-link-input {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-color);
  color: var(--text-color);
}

.copy-btn {
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
}

.copy-btn.copied {
  background: #4caf50;
}

.share-info {
  font-size: 12px;
  color: var(--gray);
  text-align: center;
}

/* Loading State for Buttons */
.action-btn-full.loading {
  opacity: 0.7;
  pointer-events: none;
}

.action-btn-full.loading i {
  animation: spin 1s linear infinite;
}

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

/* Dark Theme variables for better modal appearance */
[data-theme="dark"] .share-modal-content {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Responsive */
@media (max-width: 600px) {
  .share-modal-content {
    width: 95%;
  }

  .share-link-container {
    flex-direction: column;
  }

  .copy-btn {
    width: 100%;
  }
}

/* SEO: accordion (phương án C) — nội dung vẫn trong HTML cho crawler */
.seo-accordion {
  margin: 0.65rem 0.75rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
  overflow: hidden;
}

/* Full-bleed — khớp chiều ngang bottom nav */
.main-header .seo-intro-accordion,
.filter-section,
.page-body .seo-footer-wrap {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

.main-header .seo-intro-accordion {
  margin-top: 0;
  margin-bottom: 0;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
}

.main-header .seo-intro-accordion .seo-accordion-summary {
  position: relative;
  justify-content: center;
  padding: 0.75rem 2.5rem 0.75rem 15px;
  text-align: center;
}

.main-header .seo-intro-accordion .seo-accordion-preview {
  flex: 0 1 auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}

.main-header .seo-intro-accordion .seo-accordion-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

.main-header .seo-intro-accordion[open] .seo-accordion-icon {
  transform: translateY(-50%) rotate(180deg);
}

.main-header .seo-intro-accordion .seo-accordion-panel {
  padding: 0.75rem 15px 1.15rem;
  border-top: 1px solid var(--border-color);
}

.main-header .seo-intro-accordion .seo-hero {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.seo-breadcrumb {
  padding: 0.5rem 15px 0;
  font-size: 0.75rem;
  color: var(--gray);
}

.seo-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.seo-breadcrumb-item + .seo-breadcrumb-item::before {
  content: "/";
  margin-right: 0.35rem;
  color: var(--border-color);
}

.seo-breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.seo-breadcrumb a:hover {
  text-decoration: underline;
}

/* H1 luôn hiển thị — SEO on-page + accessibility */
.seo-page-title {
  margin: 0;
  padding: 0.65rem 15px 0.35rem;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
}

.grid-empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--gray);
  line-height: 1.55;
}

.action-btn-full--link {
  text-decoration: none;
  text-align: center;
}

.product-card--ssr .product-title {
  font-size: 12px;
  font-weight: 400;
}

.main-header .seo-intro-accordion .seo-hero-text {
  margin: 0 0 0.55rem;
  line-height: 1.55;
  text-align: center;
}

.main-header .seo-intro-accordion .seo-hero-tip {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--gray);
  text-align: center;
}

.main-header .seo-intro-accordion .seo-landing-links {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0 0.35rem;
  border-top: 1px solid var(--border-color);
  justify-content: center;
}

.main-header .seo-intro-accordion .seo-article--inline {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px dashed var(--border-color);
  background: transparent;
  border-radius: 0;
}

.main-header .seo-intro-accordion .seo-article--inline .seo-article-block {
  margin: 0 0 0.65rem;
}

.main-header .seo-intro-accordion .seo-article--inline .seo-article-block:last-child {
  margin-bottom: 0;
}

.main-header .seo-intro-accordion .seo-article--inline .seo-article-block h2 {
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text-color);
}

.main-header .seo-intro-accordion .seo-article--inline .seo-article-block p {
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0;
  color: var(--gray);
}

/* Trang hướng dẫn — mở sẵn, căn giữa + lề 15px (khớp bộ lọc) */
.main-header .seo-intro-accordion--guide .seo-accordion-panel.seo-hero {
  padding: 1rem 15px 1.15rem;
}

.main-header .seo-intro-accordion--guide .seo-accordion-preview {
  text-transform: uppercase;
}

.main-header .seo-intro-accordion--guide .seo-hero-text--guide-lead {
  font-weight: 500;
  margin-bottom: 0.85rem;
  text-align: center;
}

.main-header .seo-intro-accordion--guide .seo-article--guide {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.main-header .seo-intro-accordion--guide .seo-article--guide .seo-article-block {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border-color);
}

.main-header .seo-intro-accordion--guide .seo-article--guide .seo-article-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.main-header .seo-intro-accordion--guide .seo-article--guide .seo-article-block h2 {
  font-size: 0.9rem;
  color: var(--primary-color);
  text-align: center;
}

.main-header .seo-intro-accordion--guide .seo-article--guide .seo-article-block p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-color);
  text-align: center;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.seo-footer-wrap {
  margin-bottom: 0;
  padding: 0.85rem 15px;
  border: none;
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  background: var(--card-bg);
  flex-shrink: 0;
}

/* Không có SP → đẩy footer xuống đáy viewport */
.page-body:not(:has(.product-grid .product-card)) .seo-footer-wrap {
  margin-top: auto;
}

/* Có SP → footer dính ngay dưới grid, sát bottom nav (body đã padding) */
.page-body:has(.product-grid .product-card) .seo-footer-wrap {
  margin-top: 0.75rem;
  margin-left: 0;
  margin-right: 0;
}

.seo-accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--card-bg);
  transition: background 0.2s;
}

.seo-accordion-summary::-webkit-details-marker {
  display: none;
}

.seo-accordion-summary:hover {
  background: var(--pill-bg);
}

.seo-accordion-preview {
  flex: 1 1 auto;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seo-accordion-icon {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--gray);
  transition: transform 0.2s ease;
}

.seo-accordion[open] .seo-accordion-icon {
  transform: rotate(180deg);
}

.seo-accordion-panel {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px dashed var(--border-color);
}

.seo-intro-accordion .seo-accordion-panel.seo-hero {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* SEO: hero panel (luôn nằm trong accordion — style thật ở .main-header .seo-intro-accordion) */
.seo-hero {
  margin: 0;
  padding: 0;
}

.seo-intro-accordion .seo-hero-text {
  color: var(--gray);
}

.seo-intro-accordion .seo-landing-links a {
  color: var(--primary-color);
  background: var(--pill-active-bg);
  border: 1px solid rgba(238, 77, 45, 0.2);
}

.seo-intro-accordion .seo-landing-links a:hover {
  background: var(--pill-active-bg);
  filter: brightness(0.97);
}

.seo-hero-text {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.55;
  margin: 0 0 0.55rem;
}

.seo-landing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.seo-landing-links a {
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.cashback-note {
  font-size: 0.8rem;
  color: var(--gray);
  margin: 0.5rem 0;
  line-height: 1.45;
}

.cashback-note a {
  color: var(--primary-color);
  font-weight: 600;
}

.seo-deals-heading {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.55rem 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.35;
  text-align: center;
  background: var(--pill-active-bg);
  border-top: 1px solid rgba(238, 77, 45, 0.12);
  border-bottom: 1px solid rgba(238, 77, 45, 0.12);
}

.seo-footer {
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray);
}

.seo-footer-note {
  margin: 0.45rem 0 0.65rem;
  line-height: 1.55;
  font-size: 0.74rem;
}

.seo-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.seo-footer-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.seo-footer-links a:hover {
  text-decoration: underline;
}

.seo-article {
  margin: 0 0 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.seo-article-block {
  margin-bottom: 0.85rem;
}

.seo-article-block:last-child {
  margin-bottom: 0;
}

.seo-article-block h2 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.35rem;
}

.seo-article-block p {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--gray);
}

/* Khung giờ Flash Sale — phương án 3 */
.filter-group--time-legacy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.time-slot-bar {
  margin: 0;
  padding: 0.55rem 8px 0.65rem;
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
}

.main-header .time-slot-bar {
  position: sticky;
  top: 0;
  z-index: 15;
}

.time-slot-bar-track {
  display: flex;
  gap: 8px;
  width: 100%;
  padding-bottom: 0.15rem;
}

.time-slot-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.45rem 0.35rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-bg);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.time-slot-chip:hover {
  border-color: rgba(238, 77, 45, 0.45);
}

.time-slot-chip.is-active {
  background: linear-gradient(-180deg, #f53d2d, #f63);
  border-color: #f53d2d;
  box-shadow: 0 2px 8px rgba(245, 61, 45, 0.25);
}

.time-slot-chip-time {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.2;
}

.time-slot-chip.is-active .time-slot-chip-time,
.time-slot-chip.is-active .time-slot-chip-label {
  color: #fff;
}

.time-slot-chip-label {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-slot-bar-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gray);
  text-align: center;
}

/* Skeleton loading — thay spinner text */
.skeleton-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.skeleton-thumb,
.skeleton-line {
  background: linear-gradient(
    90deg,
    var(--pill-bg) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    var(--pill-bg) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

[data-theme="dark"] .skeleton-thumb,
[data-theme="dark"] .skeleton-line {
  background: linear-gradient(
    90deg,
    #2a2a2a 0%,
    #3a3a3a 50%,
    #2a2a2a 100%
  );
  background-size: 200% 100%;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 1;
}

.skeleton-line {
  height: 0.55rem;
  margin: 0.45rem 0.5rem 0;
  border-radius: 4px;
}

.skeleton-line--title {
  width: calc(100% - 1rem);
}

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

.skeleton-line--price {
  width: 40%;
  height: 0.7rem;
  margin-top: 0.35rem;
}

.skeleton-line--bar {
  width: calc(100% - 1rem);
  height: 1rem;
  margin-top: 0.5rem;
  border-radius: 6px;
}

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

.grid-loading-hint {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.78rem;
  color: var(--gray);
  padding: 0.25rem 0 0.5rem;
}

.product-grid:has(.product-card) .skeleton-card,
.product-grid:has(.product-card) .grid-loading-hint {
  display: none;
}
