:root {
  --primary: #10a37a;
  --primary-dark: #0b7d5e;
  --primary-deep: #087052;
  --mint-50: #eefcf6;
  --mint-100: #dcf7ec;
  --mint-200: #bdeedb;
  --mint-300: #97e3c6;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5ece9;
  --red: #e11d2e;
  --bg: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
.container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* top banner */
.topbar {
  background: linear-gradient(90deg, #d9f6e9, #c4f0dc, #d9f6e9);
  color: var(--primary-dark);
  font-size: 12px;
  text-align: center;
  padding: 6px 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

/* header */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}
.logo svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.logo b {
  display: block;
  font-size: 15px;
  letter-spacing: 0.2px;
  color: var(--primary-dark);
  line-height: 1.1;
}
.logo small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.menu {
  display: flex;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
}
.menu a {
  color: #374151;
  padding: 4px 0;
  transition: 0.2s;
}
.menu a.active,
.menu a:hover {
  color: var(--primary);
}
.menu-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--primary-dark);
  padding: 6px;
  cursor: pointer;
}

/* mobile drawer */
.mobile-menu-drawer {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 35;
}
.mobile-menu-drawer.hidden {
  display: none;
}
.mobile-menu-drawer a {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  font-weight: 500;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-menu-drawer a svg {
  color: var(--primary);
  flex-shrink: 0;
}
.mobile-menu-drawer a:hover {
  background: var(--mint-50);
  color: var(--primary);
}

/* hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 84px 0 70px;
  text-align: center;
  background:
    radial-gradient(
      1200px 400px at 85% 100%,
      var(--mint-200) 0,
      transparent 60%
    ),
    radial-gradient(900px 380px at 0% 0%, var(--mint-100) 0, transparent 65%),
    linear-gradient(180deg, #e9fbf3 0%, #f3fdf9 70%, #ffffff 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(16, 163, 122, 0.14) 1.2px,
    transparent 1.2px
  );
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, transparent 22%);
  mask-image: linear-gradient(90deg, #000 0, transparent 22%);
  opacity: 0.8;
  pointer-events: none;
}
.hero .wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero .container {
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-size: 46px;
  font-weight: 800;
  color: #0f3d31;
  letter-spacing: -0.5px;
}
.hero h1 span {
  color: var(--primary);
}
.hero p {
  margin-top: 14px;
  font-size: 16px;
  color: #374151;
}
.search {
  margin: 34px auto 0;
  max-width: 640px;
  background: #fff;
  border: 1px solid #e3efe9;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  gap: 8px;
  box-shadow: 0 8px 28px rgba(16, 163, 122, 0.14);
}
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 15px;
  padding: 10px 14px;
  background: transparent;
  color: var(--text);
}
.search input::placeholder {
  color: #8a949e;
}
.btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn:hover {
  background: var(--primary-dark);
}

/* suggestion strip */
.suggest {
  margin-top: -8px;
  background: var(--mint-50);
  border: 1px solid var(--mint-200);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.suggest-head,
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.suggest-head {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #1f3b33;
  flex-wrap: wrap;
}
.suggest-head .lead {
  display: flex;
  align-items: center;
  gap: 6px;
}
.more {
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  transition: 0.2s;
  white-space: nowrap;
}
.more:hover {
  text-decoration: underline;
}
.sg-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.sg {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  transition: 0.2s;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.sg:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(16, 163, 122, 0.12);
  transform: translateY(-1px);
}
.sg .img {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
}
.sg .img svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary-dark);
  stroke-width: 1.8;
  fill: none;
}
.sg .tag {
  position: absolute;
  left: -2px;
  top: -2px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}
.sg > div:last-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.sg p {
  font-size: 11px;
  line-height: 1.3;
  color: #374151;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.sg a {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

/* sections */
section.block {
  margin-top: 34px;
}
.sec-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  color: #1b3a31;
}
.sec-head h2 svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  width: 100%;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.card:hover {
  box-shadow: 0 10px 24px rgba(16, 163, 122, 0.15);
  transform: translateY(-2px);
  border-color: var(--mint-300);
}
.thumb {
  position: relative;
  height: 128px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb svg {
  width: 48px;
  height: 48px;
  stroke: var(--primary-dark);
  stroke-width: 1.8;
  fill: none;
  transition: transform 0.25s ease;
}
.card:hover .thumb svg {
  transform: scale(1.08);
}
.badge {
  position: absolute;
  left: 8px;
  top: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}
.info {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
}
.name {
  font-size: 12px;
  line-height: 1.4;
  height: 34px;
  overflow: hidden;
  color: #374151;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mall {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: 1px;
}
.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 6px;
}
.price {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}
.price.red {
  color: var(--red);
}
.meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.meta .star {
  color: #f5a623;
}
.mall-chip {
  display: inline-block;
  margin-top: 2px;
  background: #ffe9eb;
  color: var(--red);
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 3px;
}
.spark {
  width: 62px;
  height: 26px;
}

/* FAQ */
.faq {
  margin-top: 56px;
  padding: 46px 0 52px;
  background: linear-gradient(180deg, #fff 0, #f4fbf8 100%);
}
.faq h2 {
  text-align: center;
  font-size: 25px;
  font-weight: 700;
  color: var(--primary-dark);
}
.faq .sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.faq-list {
  max-width: 660px;
  margin: 22px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: 0.2s;
}
.faq-q {
  width: 100%;
  background: none;
  border: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
  text-align: left;
}
.faq-q svg {
  width: 14px;
  height: 14px;
  transition: 0.2s;
  color: #6b7280;
  flex-shrink: 0;
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  padding: 0 14px;
  transition: 0.25s ease-out;
  line-height: 1.6;
}
.faq-item.open .faq-a {
  max-height: 160px;
  padding: 0 14px 14px;
}
.faq-item.open .faq-q svg {
  transform: rotate(180deg);
}
.faq-item.open {
  border-color: var(--mint-300);
}

/* footer */
footer {
  position: relative;
  overflow: hidden;
  color: #e8fff6;
  padding: 42px 0 18px;
  background: linear-gradient(180deg, #10b681 0%, #0b8e68 55%, #087052 100%);
}
.f-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.6fr;
  gap: 40px;
  position: relative;
  z-index: 2;
}
footer .logo {
  color: #fff;
}
footer .logo b {
  color: #fff;
}
footer .logo small {
  color: #bff3df;
}
footer p.desc {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #d2f7e8;
  max-width: 300px;
}
footer h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}
footer ul {
  list-style: none;
  display: grid;
  gap: 9px;
  font-size: 12px;
  color: #d2f7e8;
}
footer ul.two {
  grid-template-columns: 1fr 1fr;
}
footer li a {
  transition: 0.2s;
}
footer li a:hover {
  color: #fff;
  text-decoration: underline;
}
.copy {
  position: relative;
  z-index: 2;
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #c6f3e1;
}

/* Modal Price History */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 61, 49, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}
.modal-backdrop.hidden {
  display: none;
}
.modal-card {
  background: #fff;
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  padding: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--mint-200);
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 0;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}
.modal-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.modal-thumb {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: var(--mint-50);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--mint-200);
  overflow: hidden;
}
.modal-thumb svg {
  width: 38px;
  height: 38px;
  stroke: var(--primary-dark);
  stroke-width: 1.8;
  fill: none;
}
.modal-meta {
  flex: 1;
  min-width: 0;
}
.modal-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.4;
  margin-bottom: 6px;
}
.modal-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.modal-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.modal-old-price {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: line-through;
}
.modal-alert {
  margin-top: 14px;
  background: #eefcf6;
  border: 1px solid var(--mint-200);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #0b7d5e;
}
.modal-chart-box {
  margin-top: 16px;
  background: #fafdfb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.modal-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1b3a31;
}
.modal-chart-canvas {
  height: 220px;
  width: 100%;
  position: relative;
}
.modal-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Filter & Sorting Toolbar */
.filter-toolbar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(16, 163, 122, 0.05);
}
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.chip {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.chip:hover {
  background: var(--mint-50);
  color: var(--primary);
  border-color: var(--mint-200);
}
.chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(16, 163, 122, 0.25);
}
.filter-bar-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.deal-counter {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}
.sort-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  cursor: pointer;
  outline: none;
}
.sort-select:focus {
  border-color: var(--primary);
}

@media (max-width: 900px) {
  .grid,
  .sg-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .f-grid {
    grid-template-columns: 1fr 1fr;
  }
  .menu {
    gap: 14px;
    font-size: 13px;
  }
}
@media (max-width: 600px) {
  .container {
    padding: 0 12px;
  }
  .filter-toolbar {
    padding: 12px;
  }
  .filter-chips {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .chip {
    padding: 5px 12px;
    font-size: 12px;
    flex: none;
  }
  .filter-bar-sub {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .sort-box {
    width: 100%;
    justify-content: space-between;
  }
  .sort-select {
    flex: 1;
    max-width: 190px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .sg-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .suggest {
    padding: 10px;
  }
  .sg {
    padding: 6px;
    gap: 6px;
  }
  .sg .img {
    width: 38px;
    height: 38px;
  }
  .hero {
    padding: 40px 0 35px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero p {
    font-size: 13px;
    line-height: 1.4;
  }
  .search {
    margin-top: 18px;
    flex-direction: column;
    padding: 6px;
  }
  .btn {
    padding: 10px 16px;
    width: 100%;
  }
  .menu {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
  .f-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .copy {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
@media (max-width: 440px) {
  .sg-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sg {
    padding: 8px 10px;
    gap: 10px;
  }
  .sg .img {
    width: 48px;
    height: 48px;
  }
  .sg p {
    font-size: 12px;
  }
  .sg a {
    font-size: 12px;
  }
}

/* ==========================================================================
   Pagination Styling (Phân trang sản phẩm & bài viết)
   ========================================================================== */
nav.navigation.pagination {
  margin: 48px auto 28px;
  text-align: center;
  width: 100%;
  clear: both;
}
nav.navigation.pagination .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.nav-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}
a.page-numbers:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--mint-50);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 163, 122, 0.12);
}
.page-numbers.current {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(16, 163, 122, 0.25);
  cursor: default;
}
.page-numbers.dots {
  border: none;
  background: transparent;
  box-shadow: none;
  min-width: 28px;
  padding: 0 4px;
  color: #9ca3af;
  cursor: default;
}
.page-numbers.prev,
.page-numbers.next {
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
}
@media (max-width: 480px) {
  nav.navigation.pagination {
    margin: 36px auto 20px;
  }
  .nav-links {
    gap: 6px;
  }
  .page-numbers {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
  .page-numbers.prev,
  .page-numbers.next {
    padding: 0 12px;
  }
}
