:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --ink: #17201b;
  --muted: #657168;
  --line: #dce3dc;
  --green: #23785b;
  --green-soft: #e3f2eb;
  --amber: #9a641f;
  --amber-soft: #f7ead5;
  --blue: #315d8a;
  --blue-soft: #e3edf7;
  --red: #b54242;
  --yellow: #f3ca62;
  --shadow: 0 14px 36px rgba(24, 35, 30, 0.09);
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.cart-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
}

.checkout-item-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.order-modal label:has(input[name="address"][value="-"]) {
  display: none;
}

.account-prompt p {
  color: #516052;
  line-height: 1.5;
}

.account-prompt .secondary-button {
  width: 100%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 850;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-weight: 750;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.account-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  background: #1f7a4f;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.account-link.secondary {
  background: #eef4ec;
  color: #173d2b;
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
  align-items: center;
  gap: 28px;
  padding: 34px 0 24px;
}

.hero-copy {
  padding: 22px 0;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 5.3vw, 66px);
  line-height: 1;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 800;
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.text-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 850;
}

.hero-card .product-card {
  box-shadow: var(--shadow);
}

.stats {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 6px 0 18px;
}

.stats div,
.contact,
.catalog-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stats div {
  padding: 16px;
}

.stats strong {
  display: block;
  font-size: 32px;
}

.stats span {
  color: var(--muted);
  font-weight: 700;
}

.catalog-section {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2,
.contact h2 {
  margin: 0;
  font-size: 28px;
}

.result-count {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 850;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.filter-panel {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 61, 88, 0.36) transparent;
}

.filter-panel::-webkit-scrollbar {
  width: 8px;
}

.filter-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(37, 61, 88, 0.28);
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.filter-panel-header strong {
  font-size: 15px;
}

.sale-filter-box {
  display: grid;
  gap: 9px;
  border: 2px solid rgba(181, 66, 66, 0.42);
  border-radius: 8px;
  padding: 11px;
  background: linear-gradient(180deg, #fff6d9, #fffdf5);
  box-shadow: 0 10px 22px rgba(181, 66, 66, 0.13);
}

.sale-filter-box strong {
  display: block;
  color: var(--red);
  font-size: 15px;
  font-weight: 900;
}

.sale-filter-box span {
  display: block;
  color: #6f4c10;
  font-size: 12px;
  font-weight: 800;
}

.sale-filter-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.sale-filter-button {
  min-height: 38px;
  border: 1px solid rgba(181, 66, 66, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.sale-filter-button.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 16px rgba(181, 66, 66, 0.22);
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.filter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.type-filter-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(37, 61, 88, 0.14);
  border-radius: 8px;
  padding: 9px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(37, 61, 88, 0.08);
}

.type-choice-panel,
.filter-choice-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.filter-choice-panel {
  max-height: 188px;
  overflow: auto;
  padding-right: 2px;
}

.filter-choice-panel.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.warehouse-filter-card {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(37, 61, 88, 0.12);
  border-radius: 8px;
  background: #fbfdfb;
}

.filter-panel label:has(+ .warehouse-filter-card) {
  display: none;
}

.warehouse-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.warehouse-filter-head small {
  color: var(--muted);
  font-size: 11px;
}

.warehouse-filter-head .filter-label,
.warehouse-filter-head small {
  font-size: 0;
}

.warehouse-filter-head .filter-label::before {
  content: "Ngu\1ED3 n h\E0 ng";
  font-size: 12px;
}

.warehouse-filter-head small::before {
  content: "l\1ECD c nhanh";
  font-size: 11px;
}

.warehouse-choice-panel .filter-choice-button {
  min-height: 32px;
  font-size: 12px;
}

.type-choice-button,
.filter-choice-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.type-choice-button.active,
.filter-choice-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 16px rgba(19, 124, 89, 0.2);
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.catalog-content {
  min-width: 0;
}

.active-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
  margin-bottom: 10px;
}

.active-filter-row span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-image-wrap {
  position: relative;
  background: #fff;
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
  padding: 10px;
  background: #fff;
}

.product-image.placeholder {
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(135deg, #1d2923, #315d8a);
  color: #fff;
  font-weight: 850;
}

.detail-button {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) translateY(6px);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(23, 32, 27, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.product-image-wrap:hover .detail-button,
.product-image-wrap:focus-within .detail-button {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.product-body {
  padding: 10px;
}

.mobile-quick {
  display: none;
}

.badges,
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 850;
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
}

.badge.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge.red {
  color: var(--red);
  background: #fae7e5;
}

.product-card h3 {
  margin: 0 0 3px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 16px;
  line-height: 1.22;
}

.product-card-code {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.muted,
.product-card p,
.meta,
.contact p {
  color: var(--muted);
}

.price-stack {
  display: grid;
  gap: 3px;
  margin: 7px 0;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.price-row span {
  color: var(--muted);
  font-size: 12px;
}

.price-row strong {
  white-space: nowrap;
}

.list-price strong {
  color: var(--muted);
  font-size: 13px;
  text-decoration: line-through;
}

.sale-price strong {
  color: var(--red);
  font-size: 19px;
  font-weight: 850;
}

.sale-price.price-range strong {
  font-size: 18px;
}

.price-size-note {
  margin-top: -2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

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

.mobile-price-stack .price-size-note {
  overflow: hidden;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-card p {
  margin: 10px 0 0;
  font-size: 13px;
}

.card-size-control {
  margin-top: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
}

.card-size-control span {
  color: var(--ink);
  font-weight: 850;
}

.card-size-control select {
  min-height: 38px;
  border-color: var(--green);
  font-size: 15px;
  font-weight: 800;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.card-actions .primary-button,
.card-actions .secondary-button {
  width: 100%;
  padding-inline: 8px;
}

.buy-now-button,
.add-cart-button {
  min-height: 40px;
  font-size: 14px;
}

.product-page {
  width: min(1180px, calc(100% - 28px));
  margin: 24px auto 56px;
}

.product-page-loading,
.product-page-empty {
  min-height: 45vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.product-detail-page {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 28px;
  align-items: start;
}

.product-gallery-main {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: pan-y;
  cursor: zoom-in;
}

.product-gallery-main img,
.product-gallery-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  object-fit: contain;
  padding: 16px;
  color: #fff;
  background: #fff;
  font-size: 28px;
  font-weight: 850;
}

.product-gallery-placeholder {
  background: linear-gradient(135deg, #1d2923, #315d8a);
}

.product-gallery-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82px;
  grid-template-columns: none;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.product-gallery-thumbs button {
  width: 82px;
  height: 82px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}

.product-gallery-thumbs button.active {
  border-color: var(--green);
}

.product-gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}

.product-lightbox-open {
  overflow: hidden;
}

.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 10, 0.9);
  padding: 56px 64px;
  touch-action: none;
}

.product-lightbox.open {
  display: flex;
}

.product-lightbox-frame {
  width: min(100%, 1180px);
  height: min(100%, 86vh);
  display: grid;
  place-items: center;
  margin: 0;
}

.product-lightbox-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #eef2f1;
  border-radius: 8px;
}

.product-lightbox-close,
.product-lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.product-lightbox-close {
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  font-size: 34px;
  line-height: 1;
}

.product-lightbox-nav {
  top: 50%;
  width: 48px;
  height: 72px;
  transform: translateY(-50%);
  font-size: 54px;
}

.product-lightbox-nav.prev {
  left: 18px;
}

.product-lightbox-nav.next {
  right: 18px;
}

.product-lightbox-close:hover,
.product-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.26);
}

.product-lightbox-counter {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: #fff;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.36);
  border-radius: 999px;
  padding: 6px 12px;
}

.product-detail-info {
  display: grid;
  gap: 9px;
}

.back-link {
  color: var(--green);
  font-weight: 850;
}

.product-detail-info h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.02;
}

.product-detail-code {
  margin: 0;
  color: var(--muted);
}

.product-introduction {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.product-introduction h2,
.quick-order-form h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.product-introduction p {
  margin: 6px 0;
  color: var(--muted);
  white-space: pre-line;
}

.product-purchase-panel {
  display: grid;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.product-purchase-panel h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.size-guide-link {
  justify-self: start;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.product-size-picker {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.product-size-picker > span {
  color: var(--muted);
  font-size: 15px;
}

.product-size-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-size-button {
  min-width: 56px;
  min-height: 28px;
  border: 2px solid #e4e6e2;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.product-size-button.active {
  border-color: #ff2f48;
  color: #ff2f48;
}

.product-warehouse-markers {
  min-height: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.product-warehouse-markers span {
  min-width: 24px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #e3e7e1;
  border-radius: 5px;
  padding: 0 5px;
  background: #f5f7f4;
  color: #9ba29b;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.product-warehouse-markers span.active {
  border-color: #178a5d;
  background: #e4f8ee;
  color: #0f6d49;
  box-shadow: 0 2px 8px rgba(23, 138, 93, 0.16);
}

.product-buy-row {
  display: grid;
  grid-template-columns: 116px minmax(180px, 260px);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.product-qty-stepper {
  display: grid;
  grid-template-columns: 28px 58px 28px;
  align-items: center;
}

.product-qty-stepper button {
  min-height: 42px;
  background: transparent;
  color: #8c8f8c;
  font-size: 22px;
  font-weight: 900;
}

.product-qty-stepper input {
  min-height: 42px;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 750;
}

.product-buy-row .add-cart-button,
.product-buy-row .buy-now-button {
  min-height: 44px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 10px 18px rgba(14, 111, 76, 0.16);
}

.product-buy-row .add-cart-button {
  gap: 8px;
  background: linear-gradient(180deg, #2fbf7b 0%, #16885c 100%);
  color: #fff;
  border: 1px solid #0b7049;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}

.product-buy-row .buy-now-button {
  gap: 9px;
  background: linear-gradient(180deg, #ff4058 0%, #f01f3d 100%);
  color: #fff;
  box-shadow: 0 10px 18px rgba(255, 47, 72, 0.18);
}

.button-cart-icon,
.floating-cart-icon {
  display: inline-grid;
  place-items: center;
}

.button-cart-icon svg,
.floating-cart-icon svg {
  width: 24px;
  height: 24px;
}

.cart-icon-3d svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .2));
}

.product-purchase-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-purchase-actions button {
  min-height: 48px;
}

.quick-order-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.quick-order-form.legacy-product-order-form {
  display: none;
}

.quick-order-form .form-message {
  min-height: 20px;
  color: var(--green);
  font-weight: 800;
}

.product-floating-cart {
  position: fixed;
  top: 50%;
  right: 18px;
  z-index: 75;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ff2f48;
  color: #fff;
  box-shadow: 0 16px 36px rgba(255, 47, 72, 0.28);
  transform: translateY(-50%);
  transition: top 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.product-floating-cart.has-items {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 18px 42px rgba(255, 47, 72, 0.36);
}

.product-cart-modal {
  gap: 12px;
}

.product-cart-modal #product-cart-items {
  display: grid;
  gap: 4px;
}

.floating-cart-count {
  position: absolute;
  top: -8px;
  right: -6px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0 7px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.card-actions button:disabled,
#checkout-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 20px 0 34px;
  padding: 24px;
}

.contact p {
  max-width: 620px;
  margin: 8px 0 0;
}

.cart-panel {
  position: fixed;
  right: 14px;
  bottom: max(72px, env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.cart-toggle {
  position: relative;
  min-width: 78px;
  height: 58px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  box-shadow: var(--shadow);
}

.cart-toggle span {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  padding: 0 8px;
  font-size: 15px;
  line-height: 1;
}

.cart-box {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(380px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 105px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.cart-panel.open .cart-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 12px;
}

.cart-box #cart-items {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.cart-header,
.cart-total,
.cart-item,
.checkout-items div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-item {
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.cart-item > div:first-child {
  display: grid;
  gap: 2px;
}

.cart-item span,
.empty-cart {
  color: var(--muted);
  font-size: 13px;
}

.qty-control {
  display: inline-grid;
  grid-template-columns: 30px 28px 30px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qty-control button {
  height: 30px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 850;
}

.qty-control span {
  text-align: center;
  color: var(--ink);
  font-weight: 850;
}

.cart-total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cart-box #checkout-button {
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.cart-notes,
.checkout-notes {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8e1;
  color: #5a4312;
  font-size: 13px;
  line-height: 1.45;
}

.cart-notes p,
.checkout-notes p {
  margin: 0;
}

.payment-method-box,
.momo-payment-box,
.quick-chat-box,
.order-follow-box,
.account-follow-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
}

.order-follow-box {
  background: #fbfcfb;
  border-color: rgba(22, 116, 79, 0.18);
}

.account-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mini-auth-form {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.mini-auth-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 750;
}

.mini-auth-form input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
}

.payment-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.payment-choice input[type="radio"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 2px 0 0;
  accent-color: #16744f;
}

.payment-choice.featured {
  border-color: rgba(22, 116, 79, 0.35);
  background: #f3fbf6;
}

.payment-choice:has(input[type="radio"]:checked) {
  border-color: rgba(37, 99, 235, 0.65);
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.14);
}

.payment-choice span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.payment-choice-mark {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  margin-top: 2px;
  border-radius: 999px;
  background: #16744f;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.payment-choice small,
.payment-method-note,
.quick-chat-box p,
.momo-payment-box p {
  color: var(--muted);
}

.payment-method-note {
  margin: 6px 0 10px;
}

.payment-trust-row,
.payment-safe-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.payment-trust-row span,
.payment-safe-notes span {
  border: 1px solid rgba(22, 116, 79, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.payment-safe-notes span {
  border-radius: 8px;
}

.momo-payment-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: start;
  margin-top: 12px;
}

.momo-payment-box dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 12px 0;
}

.momo-payment-box dt {
  color: var(--muted);
}

.momo-payment-box dd {
  margin: 0;
  font-weight: 700;
}

.momo-payment-box code {
  color: #a20a6c;
  font-size: 1.05em;
}

.momo-qr-image {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quick-chat-box {
  margin-top: 12px;
}

.account-follow-box {
  display: grid;
  gap: 12px;
  margin: 4px 0 12px;
  border: 1px solid rgba(22, 116, 79, 0.36);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #f3fbf6, #ffffff);
  box-shadow: 0 16px 34px rgba(22, 116, 79, 0.14);
}

.account-follow-box p {
  margin: 4px 0 0;
  color: var(--muted);
}

.chat-messenger {
  background: #1877f2;
}

.chat-zalo {
  background: #0068ff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(15, 22, 18, 0.5);
}

.order-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 24px);
  max-height: min(calc(100vh - 24px), calc(100dvh - 24px));
  display: grid;
  gap: 12px;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.checkout-info-modal {
  max-height: calc(100vh - 24px);
  max-height: min(calc(100vh - 24px), calc(100dvh - 24px));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.checkout-info-modal .modal-header {
  position: sticky;
  top: -20px;
  z-index: 2;
  margin: -20px -20px 0;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.checkout-info-modal button[type="submit"] {
  position: sticky;
  bottom: max(-12px, calc(env(safe-area-inset-bottom) * -1));
  z-index: 2;
  margin: 4px -20px calc(env(safe-area-inset-bottom) * -1);
  border-radius: 0 0 8px 8px;
}

.product-detail-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  display: grid;
  gap: 12px;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.product-detail-modal .product-image {
  aspect-ratio: 4 / 3;
}

.detail-meta {
  display: grid;
  gap: 4px;
}

.detail-policy {
  margin: 0;
  color: var(--muted);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 850;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--green);
  font-weight: 800;
}

.checkout-items {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.checkout-items div {
  align-items: flex-start;
}

@media (max-width: 980px) {
  .modal-overlay {
    place-items: end center;
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .modal-overlay:has(.checkout-info-modal) {
    padding-bottom: max(112px, calc(env(safe-area-inset-bottom) + 88px));
  }

  .order-modal.checkout-info-modal {
    max-height: calc(100vh - 136px);
    max-height: min(calc(100vh - 136px), calc(100dvh - 136px));
    border-radius: 12px 12px 0 0;
    padding: 12px;
    gap: 8px;
  }

  .checkout-info-modal .modal-header {
    top: -12px;
    margin: -12px -12px 0;
    padding: 12px;
  }

  .checkout-info-modal button[type="submit"] {
    min-height: 48px;
    margin: 4px -12px -12px;
    border-radius: 0;
  }

  .hero,
  .stats,
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 22px;
  }

  .filter-panel {
    position: static;
    max-height: none;
    overflow: visible;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-panel-header {
    grid-column: 1 / -1;
  }

  .sale-filter-box {
    grid-column: 1 / -1;
  }

  .contact,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 1024px), (pointer: coarse) {
  .hero-card {
    display: none;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
  }

  .product-grid .product-card:not(.featured) {
    min-width: 0;
    cursor: pointer;
  }

  .product-grid .product-card:not(.featured) .product-image {
    aspect-ratio: 1 / 1;
    padding: 5px;
  }

  .product-grid .product-card:not(.featured) .product-body {
    display: none;
  }

  .product-grid .product-card:not(.featured) .mobile-quick {
    display: grid;
    gap: 5px;
    padding: 6px;
  }

  .product-grid .product-card:not(.featured) .mobile-quick strong {
    overflow: hidden;
    color: var(--red);
    font-size: 13px;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .product-grid .product-card:not(.featured) .mobile-quick select {
    min-height: 30px;
    border-color: var(--line);
    padding: 3px 5px;
    font-size: 12px;
    font-weight: 800;
  }

  .product-grid .product-card:not(.featured) .mobile-quick select:disabled {
    opacity: 0.55;
  }

  .product-grid .product-card:not(.featured) .detail-button {
    display: none;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
  }

  .account-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .account-link {
    flex: 1 1 150px;
    justify-content: center;
  }

  .account-inline-grid {
    grid-template-columns: 1fr;
  }

  main {
    width: min(100% - 22px, 1220px);
  }

  .product-page {
    width: min(100% - 18px, 1180px);
    margin-top: 12px;
  }

  .product-detail-page {
    grid-template-columns: 1fr;
  }

  .product-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .product-detail-info h1 {
    font-size: 32px;
  }

  .product-lightbox {
    padding: 52px 14px;
  }

  .product-lightbox-nav {
    width: 42px;
    height: 58px;
    font-size: 42px;
  }

  .product-lightbox-nav.prev {
    left: 8px;
  }

  .product-lightbox-nav.next {
    right: 8px;
  }

  .product-buy-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  .product-qty-stepper {
    grid-template-columns: 32px minmax(76px, 1fr) 32px;
    max-width: 160px;
  }

  .product-buy-row .add-cart-button,
  .product-buy-row .buy-now-button {
    min-height: 46px;
    font-size: 15px;
  }

  .product-size-button {
    min-width: 62px;
  }

  .product-floating-cart {
    top: auto;
    right: 14px;
    bottom: 84px;
    width: 58px;
    height: 58px;
    transform: none;
  }

  .product-floating-cart.has-items {
    transform: scale(1.04);
  }

  h1 {
    font-size: 38px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .hero-card {
    display: none;
  }

  .hero-actions,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .stats {
    gap: 8px;
  }

  .stats div {
    padding: 12px;
  }

  .stats strong {
    font-size: 26px;
  }

  .catalog-section {
    padding: 12px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px;
  }

  input,
  select {
    min-height: 44px;
    font-size: 16px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
  }

  .product-card {
    cursor: pointer;
  }

  .product-grid .product-card:not(.featured) {
    min-width: 0;
  }

  .product-grid .product-card:not(.featured) .product-image {
    aspect-ratio: 1 / 1;
    padding: 5px;
  }

  .product-grid .product-card:not(.featured) .product-body {
    display: none;
  }

  .product-grid .product-card:not(.featured) .mobile-quick {
    display: grid;
    gap: 5px;
    padding: 6px;
  }

  .product-grid .product-card:not(.featured) .mobile-quick strong {
    overflow: hidden;
    color: var(--red);
    font-size: 13px;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .product-grid .product-card:not(.featured) .mobile-quick select {
    min-height: 30px;
    border-color: var(--line);
    padding: 3px 5px;
    font-size: 12px;
    font-weight: 800;
  }

  .product-grid .product-card:not(.featured) .mobile-quick select:disabled {
    opacity: 0.55;
  }

  .product-grid .product-card:not(.featured) .detail-button {
    display: none;
  }

  .hero-card .product-card {
    cursor: default;
  }

  .product-detail-modal {
    align-self: end;
    width: 100%;
    max-height: 92vh;
    border-radius: 8px 8px 0 0;
    padding-bottom: 22px;
  }

  .product-detail-modal .detail-button {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  .cart-toggle {
    min-width: 72px;
    height: 54px;
  }
}

.load-more-products {
  display: block;
  width: min(320px, 100%);
  margin: 20px auto 0;
}
