:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-strong: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #31ad30;
  --accent-dark: #289428;
  --accent-soft: rgba(49, 173, 48, 0.1);
  --green: #168344;
  --blue: #0071e3;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
  --glass-border: rgba(255, 255, 255, 0.72);
  --page-max: 1200px;
  --page-gutter: clamp(16px, 3vw, 36px);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: blur(20px) saturate(1.8);
}

.header-inner {
  display: flex;
  width: min(100%, var(--page-max));
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-left {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 32px;
  max-width: min(210px, 44vw);
  object-fit: contain;
}

.header-category {
  position: relative;
}

.category-menu-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #86868b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
}

.category-menu-button:hover,
.category-menu-button[aria-expanded="true"] {
  border-color: rgba(49, 173, 48, 0.32);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 4px rgba(49, 173, 48, 0.1);
}

.grid-icon {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  gap: 3px;
}

.grid-icon span {
  width: 7px;
  height: 7px;
  border: 1.6px solid currentColor;
  border-radius: 2px;
}

.chevron {
  width: 9px;
  height: 9px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.category-menu-button[aria-expanded="true"] .chevron {
  transform: translateY(2px) rotate(225deg);
}

.category-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: 248px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(18px) saturate(1.35);
  max-height: min(420px, calc(100vh - 92px));
  overflow-y: auto;
}

.category-menu[hidden] {
  display: none;
}

.category-menu-item {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background 180ms ease;
}

.category-menu-item:last-child {
  border-bottom: 0;
}

.category-menu-item:hover,
.category-menu-item[aria-current="true"] {
  background: rgba(49, 173, 48, 0.08);
  color: var(--accent-dark);
}

.category-menu-icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.category-menu-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.category-menu-label {
  flex: 1 1 auto;
  line-height: 1.2;
}

.header-search {
  display: grid;
  width: min(420px, 38vw);
  position: relative;
  gap: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.header-search::before {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 14px;
  height: 14px;
  border: 1.8px solid #86868b;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: translateY(-58%);
}

.header-search::after {
  position: absolute;
  top: 50%;
  left: 26px;
  width: 7px;
  height: 1.8px;
  border-radius: 999px;
  background: #86868b;
  content: "";
  pointer-events: none;
  transform: translateY(4px) rotate(45deg);
  transform-origin: left center;
}

.header-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px 0 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  outline: none;
}

.header-search input::placeholder {
  color: #86868b;
  opacity: 1;
}

.header-search input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(49, 173, 48, 0.12);
}

main {
  overflow: clip;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.shopee-link,
.detail-cta {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 500;
}

.shopee-link,
.detail-cta {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  transition: background 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.shopee-link:hover,
.shopee-link:focus-visible {
  transform: translateY(-1px);
  background: #58b357;
  color: #fff;
  box-shadow: 0 12px 24px rgba(49, 173, 48, 0.18);
}

.detail-cta {
  background: var(--accent);
  color: #fff;
}

.detail-cta:hover,
.detail-cta:focus-visible {
  transform: translateY(-1px);
  background: #58b357;
  color: #fff;
  box-shadow: 0 12px 24px rgba(49, 173, 48, 0.22);
}

.toolbar-band {
  display: block;
  width: min(100%, var(--page-max));
  margin: 0 auto;
  background: transparent;
  padding: clamp(20px, 3vw, 34px) var(--page-gutter) 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.search-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(49, 173, 48, 0.12);
}

.category-tabs {
  min-width: 0;
  order: 1;
  grid-column: 1 / -1;
}

.category-title {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.value-filters {
  order: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1;
}

.value-filter-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.value-filter-card:hover {
  border-color: rgba(0, 0, 0, 0.14);
  background: #fff;
  color: var(--ink);
}

.value-filter-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 13px;
  font-weight: 800;
}

.value-filter-icon svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.value-filter-copy {
  display: inline-flex;
  min-width: 0;
  align-items: center;
}

.value-filter-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.value-filter-copy span {
  display: none;
}

.value-filter-count {
  display: none;
}

.value-filter-waste[aria-pressed="true"] {
  border-color: rgba(239, 68, 68, 0.34);
  color: #dc2626;
}

.value-filter-ok[aria-pressed="true"] {
  border-color: rgba(34, 197, 94, 0.34);
  color: #15803d;
}

.value-filter-great[aria-pressed="true"] {
  border-color: rgba(101, 84, 232, 0.34);
  color: #5140cf;
}

.value-filter-card[aria-pressed="true"] {
  background: #fff;
  box-shadow: inset 0 0 0 1px currentColor;
}

.sort-filters {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
  grid-column: 2;
  justify-self: end;
}

.sort-label {
  margin-right: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.sort-button {
  position: relative;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: none;
  transition: background 160ms ease, color 160ms ease;
}

.sort-button-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  place-items: center;
}

.sort-button-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sort-button:hover,
.sort-button[aria-pressed="true"] {
  background: rgba(49, 173, 48, 0.08);
  color: var(--accent-dark);
}

.sort-button::before {
  display: none;
  position: absolute;
  left: 15px;
  top: 50%;
  width: 13px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: translateY(-50%);
}

.sort-button::after {
  display: none;
  position: absolute;
  left: 17px;
  top: 50%;
  width: 10px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: translateY(-50%);
}

.sort-button-spark::before {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 2px 12px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 12px 2px no-repeat;
}

.sort-button-spark::after {
  display: none;
}

.sort-button-asc::after {
  width: 8px;
}

.sort-button-desc::before {
  width: 13px;
}

.sort-button-desc::after {
  width: 5px;
}

.product-grid {
  display: grid;
  width: min(100%, var(--page-max));
  margin: 0 auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px var(--page-gutter) 40px;
}

.product-grid:empty {
  padding-top: 0;
  padding-bottom: 0;
}

.product-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.05);
  transition:
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.product-card:hover {
  border-color: rgba(49, 173, 48, 0.28);
  transform: translateY(-7px);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.13);
}

.product-open {
  display: grid;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.product-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.08)),
    var(--media-image, none);
  background-position: center;
  background-size: cover;
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover .product-media {
  transform: scale(1.05);
}

.product-body {
  display: grid;
  min-height: 172px;
  min-width: 0;
  align-content: start;
  gap: 7px;
  padding: 11px 12px 10px;
}

.product-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.product-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.22;
  height: calc(2 * 1.22em);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.price-stack {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.price-stack > span {
  display: grid;
  gap: 2px;
}

.price-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.bought-price {
  overflow-wrap: anywhere;
  color: #e11d48;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
}

.value-meter {
  position: relative;
  display: block;
  padding-bottom: 32px;
}

.value-meter-track {
  position: relative;
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
}

.value-meter-fill {
  position: relative;
  z-index: 1;
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ade80, #16a34a);
}

.value-meter-dot {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 6px;
  height: 6px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #c4cdd5;
  transform: translate(-50%, -50%);
}

.value-meter-dot-low {
  left: 18%;
}

.value-meter-dot-mid {
  left: 56%;
}

.value-meter-dot-high {
  left: calc(100% - 3px);
}

.value-meter-label {
  position: absolute;
  bottom: 0;
  z-index: 3;
  display: inline-flex;
  min-height: 22px;
  min-width: 64px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  cursor: help;
  transform: translateX(-50%);
}

.value-meter-tooltip {
  position: absolute;
  right: 0;
  bottom: 24px;
  z-index: 6;
  width: min(240px, 100%);
  padding: 9px 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(29, 29, 31, 0.94);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.value-meter-tooltip::after {
  position: absolute;
  left: var(--tooltip-arrow-left, calc(100% - 24px));
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: rgba(29, 29, 31, 0.94);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.value-meter.is-tooltip-open .value-meter-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.value-meter[data-level="waste"] .value-meter-label {
  left: 18%;
}

.value-meter[data-level="ok"] .value-meter-label {
  left: 56%;
}

.value-meter[data-level="great"] .value-meter-label {
  right: 0;
  transform: none;
}

.value-meter[data-level="waste"] .value-meter-tooltip {
  --tooltip-arrow-left: 18%;
}

.value-meter[data-level="ok"] .value-meter-tooltip {
  --tooltip-arrow-left: 56%;
}

.value-meter[data-level="great"] .value-meter-tooltip {
  --tooltip-arrow-left: calc(100% - 34px);
}

.value-meter[data-level="waste"] .value-meter-fill {
  background: linear-gradient(90deg, #ff8a8a, #ef4444);
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.2);
}

.value-meter[data-level="ok"] .value-meter-fill {
  background: linear-gradient(90deg, #4ade80, #16a34a);
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.2);
}

.value-meter[data-level="great"] .value-meter-fill {
  background: linear-gradient(90deg, #a78bfa, #6554e8);
  box-shadow: 0 0 4px rgba(101, 84, 232, 0.2);
}

.value-meter[data-level="waste"] .value-meter-dot-low,
.value-meter[data-level="ok"] .value-meter-dot-low,
.value-meter[data-level="ok"] .value-meter-dot-mid,
.value-meter[data-level="great"] .value-meter-dot {
  background: #fff;
}

.value-meter[data-level="waste"] .value-meter-label {
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: #fff7f7;
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

.value-meter[data-level="ok"] .value-meter-label {
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: #f6fef9;
  color: #15803d;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.08);
}

.value-meter[data-level="great"] .value-meter-label {
  border: 1px solid rgba(101, 84, 232, 0.28);
  background: #f8f7ff;
  color: #5140cf;
  box-shadow: 0 2px 8px rgba(101, 84, 232, 0.09);
}

.shopee-link {
  min-height: 40px;
  margin: 0 12px 12px;
  padding: 0 12px;
  font-size: 14px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  user-select: none;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 150ms ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.detail-hero { cursor: zoom-in; }

.review-body img {
  max-width: 100%;
  border-radius: 8px;
  cursor: zoom-in;
  display: block;
  margin: 8px 0;
}

.waste-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(6px);
}

@keyframes waste-popup-in {
  from { transform: scale(0.78) translateY(12px); opacity: 0; }
  to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.waste-popup {
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 40px));
  padding: 30px 24px 22px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22);
  text-align: center;
  animation: waste-popup-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.waste-popup-emoji {
  font-size: 52px;
  line-height: 1;
}

.waste-popup-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.waste-popup-body {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.waste-popup-close {
  min-height: 46px;
  padding: 0 20px;
  border: none;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 140ms ease;
}

.waste-popup-close:hover {
  background: #333;
  transform: scale(1.03);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: min(100%, var(--page-max));
  margin: 0 auto;
  padding: 8px var(--page-gutter) 40px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pagination::-webkit-scrollbar {
  display: none;
}

.pagination[hidden] {
  display: none;
}

.page-btn {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-strong);
  color: var(--ink);
}

.page-btn[aria-current="true"] {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.page-ellipsis {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  font-size: 14px;
}

.eyebrow-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.empty-state {
  position: relative;
  display: grid;
  width: min(100%, var(--page-max));
  min-height: clamp(430px, 62dvh, 680px);
  margin: 0 auto;
  place-items: center;
  padding: clamp(28px, 5vw, 70px) var(--page-gutter) clamp(52px, 7vw, 96px);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state::before {
  position: absolute;
  width: min(580px, 78vw);
  height: min(580px, 78vw);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 45%, rgba(49, 173, 48, 0.12), rgba(49, 173, 48, 0) 62%),
    radial-gradient(circle at 28% 62%, rgba(0, 113, 227, 0.08), rgba(0, 113, 227, 0) 48%);
  content: "";
  pointer-events: none;
}

.empty-state > * {
  position: relative;
  z-index: 1;
}

.empty-visual-wrap {
  position: relative;
  width: min(520px, 86vw);
  margin: 0 auto 12px;
}

.empty-visual-wrap::after {
  position: absolute;
  right: 14%;
  bottom: 4%;
  left: 14%;
  height: 20px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.08);
  filter: blur(10px);
  content: "";
}

.empty-visual {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  mix-blend-mode: multiply;
}

.empty-kicker {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  margin: 0 0 10px;
  padding: 0 13px;
  border: 1px solid rgba(49, 173, 48, 0.24);
  border-radius: 999px;
  background: rgba(49, 173, 48, 0.08);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 650;
}

.empty-state h2 {
  max-width: 760px;
  margin: 0 auto 12px;
  font-size: clamp(30px, 5vw, 60px);
  line-height: 1.02;
}

.empty-state p:not(.empty-kicker) {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.55;
}

.product-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.product-panel.is-open {
  display: block;
}

.panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 36, 34, 0.48);
}

.panel-card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: min(480px, calc(100vw - 36px));
  height: min(860px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.panel-content {
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 92px;
  overscroll-behavior: contain;
}

.detail-hero {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.06)),
    #f2f2f4;
  touch-action: pan-y;
}

.detail-hero-slide {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.06)),
    var(--slide-image, none);
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: translateX(0);
  will-change: transform, opacity;
}

.detail-hero-slide.is-current {
  opacity: 1;
}

.hero-nav-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  transition: background 150ms ease, transform 150ms ease;
}

.hero-nav-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}

.hero-prev-btn { left: 12px; }
.hero-next-btn { right: 12px; }

.hero-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.detail-body {
  display: grid;
  gap: 16px;
  padding: 20px 20px 0;
}

.detail-body .value-meter-tooltip {
  width: min(320px, calc(100vw - 52px));
}

.detail-body > .eyebrow {
  margin-bottom: -10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-align: left;
}

.detail-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.detail-prices {
  display: flex;
  gap: 20px;
}

.detail-price-item {
  display: grid;
  gap: 2px;
}

.detail-bought-price {
  font-size: 24px;
}

.detail-receipt {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}

.detail-header {
  display: grid;
  gap: 10px;
}

.detail-header h2 {
  margin: 0;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section h3 {
  margin: 0;
  font-size: 17px;
}

.detail-section p,
.detail-section li {
  color: var(--muted);
  line-height: 1.65;
}

.review-body {
  color: #3a3a3c;
  font-size: 16px;
  line-height: 1.6;
}

.review-body p {
  margin: 0 0 8px;
  color: inherit;
  line-height: 1.6;
}

.review-body p:last-child { margin-bottom: 0; }

.review-body ul,
.review-body ol {
  margin: 6px 0 8px;
  padding-left: 20px;
}

.review-body li {
  margin-bottom: 4px;
  line-height: 1.55;
  color: inherit;
}

.review-body strong { color: var(--ink); }
.review-body em { color: inherit; }

.detail-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.detail-section video {
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  background: #111;
}

.detail-video-embed {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 560px;
  border: 0;
  border-radius: 8px;
  background: #111;
}

.detail-cta-wrap {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  overflow: visible;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.detail-cta {
  flex: 1;
}

.detail-share-btn {
  position: relative;
  flex: 0 0 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.detail-share-btn:hover {
  background: var(--accent);
  color: #fff;
}

.detail-share-btn::after {
  content: "Đã copy link!";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.detail-share-btn.is-copied::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1180px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --page-gutter: 18px;
  }

  .site-header {
    padding-block: 8px;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-left {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .header-search {
    width: 100%;
  }

  .header-search input {
    min-height: 40px;
  }

  .category-menu {
    right: 0;
    left: auto;
    width: min(360px, calc(100vw - (var(--page-gutter) * 2)));
    max-height: calc(100dvh - 132px);
  }

  .toolbar-band {
    grid-template-columns: 1fr;
    padding-top: 18px;
  }

  .toolbar {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 18px;
  }

  .value-filters {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-bottom: 2px;
    margin-inline: calc(var(--page-gutter) * -1);
    padding-inline: var(--page-gutter);
    overflow-x: auto;
    scroll-padding-inline: var(--page-gutter);
    scrollbar-width: none;
  }

  .value-filters::-webkit-scrollbar {
    display: none;
  }

  .value-filter-card {
    flex: 0 0 auto;
  }

  .category-title {
    font-size: 20px;
  }

  .sort-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-inline: calc(var(--page-gutter) * -1);
    padding-inline: var(--page-gutter);
    overflow-x: auto;
    scroll-padding-inline: var(--page-gutter);
    scrollbar-width: none;
  }

  .sort-filters::-webkit-scrollbar {
    display: none;
  }

  .sort-button {
    flex: 0 0 auto;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 14px;
  }

  .product-card:hover {
    transform: none;
  }

  .product-card:hover .product-media {
    transform: none;
  }

  .panel-card {
    width: min(560px, calc(100vw - 28px));
    height: min(860px, calc(100dvh - 28px));
    max-height: calc(100dvh - 28px);
  }

  .detail-body {
    padding-inline: 18px;
  }
}

@media (max-width: 560px) {
  :root {
    --page-gutter: 12px;
  }

  .site-header {
    padding-block: 8px;
    background: rgba(251, 251, 253, 0.94);
  }

  .header-inner {
    gap: 8px;
  }

  .brand-logo {
    height: 28px;
    max-width: min(178px, 48vw);
  }

  .category-menu-button {
    min-height: 36px;
    gap: 6px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .grid-icon {
    grid-template-columns: repeat(2, 6px);
    gap: 2px;
  }

  .grid-icon span {
    width: 6px;
    height: 6px;
  }

  .header-search input {
    min-height: 38px;
    padding-left: 36px;
    font-size: 13px;
  }

  .header-search::before {
    left: 12px;
  }

  .header-search::after {
    left: 24px;
  }

  h1 {
    font-size: 42px;
  }

  .toolbar-band {
    padding-top: 14px;
  }

  .toolbar {
    padding-bottom: 14px;
  }

  .category-title {
    font-size: 18px;
  }

  .sort-filters {
    gap: 8px;
  }

  .sort-filters.sort-filters-mobile {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-inline: calc(var(--page-gutter) * -1);
    padding-inline: 0;
    overflow: visible;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  }

  .mobile-sort-button {
    position: relative;
    display: inline-flex;
    min-width: 0;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #6f6f78;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
  }

  .mobile-sort-button[aria-pressed="true"] {
    color: var(--accent-dark);
  }

  .mobile-sort-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    place-items: center;
  }

  .mobile-sort-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }

  .mobile-sort-tab[aria-pressed="true"]::after {
    position: absolute;
    right: 14px;
    bottom: 0;
    left: 14px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    content: "";
  }

  .sort-filters-mobile .mobile-sort-button:nth-child(2)::before,
  .sort-filters-mobile .mobile-sort-button:nth-child(3)::before,
  .mobile-sort-price::before,
  .mobile-sort-filter::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.14);
    content: "";
  }

  .mobile-price-chevrons {
    display: grid;
    gap: 3px;
    color: #86868b;
  }

  .mobile-price-chevron-up,
  .mobile-price-chevron-down {
    display: block;
    width: 7px;
    height: 7px;
    border-right: 1.7px solid currentColor;
    border-bottom: 1.7px solid currentColor;
  }

  .mobile-price-chevron-up {
    transform: rotate(225deg);
  }

  .mobile-price-chevron-down {
    transform: rotate(45deg);
  }

  .mobile-sort-price[aria-pressed="true"] .mobile-price-chevrons {
    color: var(--accent-dark);
  }

  .mobile-sort-filter svg {
    width: 24px;
    height: 24px;
    color: #777780;
    fill: currentColor;
  }

  .mobile-sort-filter[aria-pressed="true"] svg {
    color: var(--accent-dark);
  }

  .sort-button {
    min-height: 34px;
    padding: 0 12px 0 31px;
    font-size: 12px;
  }

  .sort-button::before {
    left: 12px;
  }

  .sort-button::after {
    left: 14px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding-bottom: 28px;
  }

  .empty-state {
    min-height: calc(100dvh - 260px);
    padding-top: 24px;
  }

  .empty-visual-wrap {
    width: min(340px, 90vw);
    margin-bottom: 8px;
  }

  .empty-visual {
    border-radius: 12px;
  }

  .empty-kicker {
    min-height: 28px;
    margin-bottom: 9px;
    padding-inline: 11px;
    font-size: 12px;
  }

  .empty-state h2 {
    max-width: 340px;
    margin-bottom: 10px;
    font-size: 30px;
    line-height: 1.08;
  }

  .empty-state p:not(.empty-kicker) {
    max-width: 330px;
    font-size: 14px;
    line-height: 1.5;
  }

  .product-card {
    border-radius: 10px;
  }

  .product-body {
    min-height: 138px;
    gap: 5px;
    padding: 8px;
  }

  .product-meta {
    font-size: 10px;
    line-height: 1.2;
  }

  .product-name {
    font-size: 13px;
    line-height: 1.25;
    height: calc(2 * 1.25em);
  }

  .price-stack {
    gap: 3px;
  }

  .price-label {
    font-size: 10px;
  }

  .bought-price {
    font-size: 15px;
  }

  .value-meter-track {
    height: 4px;
  }

  .value-meter {
    margin-top: 1px;
    padding-bottom: 30px;
  }

  .value-meter-label {
    min-height: 20px;
    min-width: 0;
    bottom: 2px;
    font-size: 10px;
    padding-inline: 6px;
    letter-spacing: 0;
  }

  .value-meter[data-level="waste"] .value-meter-label {
    left: 0;
    transform: none;
  }

  .value-meter[data-level="ok"] .value-meter-label {
    left: 50%;
  }

  .value-meter[data-level="waste"] .value-meter-tooltip {
    --tooltip-arrow-left: 24px;
  }

  .value-meter[data-level="ok"] .value-meter-tooltip {
    --tooltip-arrow-left: 50%;
  }

  .shopee-link {
    min-height: 34px;
    margin: 0 8px 8px;
    padding: 0 8px;
    font-size: 12px;
  }

  .pagination {
    justify-content: flex-start;
    padding-bottom: 28px;
  }

  .page-btn,
  .page-ellipsis {
    flex: 0 0 auto;
    min-width: 34px;
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .waste-popup-overlay {
    padding: 16px;
  }

  .waste-popup {
    width: min(100%, 340px);
    padding: 24px 18px 18px;
    border-radius: 16px;
  }

  .waste-popup-emoji {
    font-size: 42px;
  }

  .waste-popup-body {
    font-size: 13px;
    line-height: 1.55;
  }

  .panel-card {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    transform: none;
  }

  .icon-button {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .close-button {
    top: calc(8px + env(safe-area-inset-top));
    right: 8px;
  }

  .panel-content {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .detail-hero {
    aspect-ratio: 1 / 0.92;
  }

  .hero-nav-btn {
    width: 34px;
    height: 34px;
  }

  .detail-body {
    gap: 13px;
    padding: 16px 14px 0;
  }

  .detail-name {
    font-size: 20px;
    line-height: 1.28;
  }

  .detail-bought-price {
    font-size: 24px;
  }

  .detail-body > .eyebrow,
  .price-label {
    font-size: 12px;
  }

  .value-meter-label {
    font-size: 12px;
  }

  .review-body {
    font-size: 16px;
  }

  .detail-section h3 {
    font-size: 15px;
  }

  .detail-section p,
  .detail-section li {
    font-size: 14px;
    line-height: 1.55;
  }

  .detail-cta-wrap {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    gap: 7px;
    padding: 10px 12px calc(12px + max(env(safe-area-inset-bottom), 0px));
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.08);
  }

  .detail-cta,
  .detail-share-btn {
    min-height: 42px;
    height: 42px;
    font-size: 14px;
  }

  .detail-share-btn {
    flex-basis: 42px;
  }
}

@media (max-width: 380px) {
  :root {
    --page-gutter: 8px;
  }

  .brand-logo {
    max-width: 138px;
  }

  .category-menu-button {
    padding-inline: 8px;
  }

  .category-menu-button > span:nth-child(2) {
    display: none;
  }

  .sort-filters.sort-filters-mobile {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-sort-button {
    gap: 5px;
    min-height: 48px;
    padding-inline: 5px;
    font-size: 13px;
  }

  .mobile-sort-tab[aria-pressed="true"]::after {
    right: 9px;
    left: 9px;
  }

  .mobile-sort-filter svg {
    width: 21px;
    height: 21px;
  }

  .product-grid {
    gap: 8px;
  }

  .product-body {
    min-height: 134px;
    padding: 7px;
  }

  .product-name {
    font-size: 12px;
  }

  .bought-price {
    font-size: 13px;
  }

  .value-meter-label {
    font-size: 9px;
  }

  /* Detail panel — giữ đúng size trên màn hình rất nhỏ */
  .detail-body > .eyebrow,
  .price-label {
    font-size: 12px;
  }

  .detail-bought-price {
    font-size: 24px;
  }

  .detail-body .value-meter-label {
    font-size: 12px;
  }

  .review-body {
    font-size: 16px;
  }
}

