:root {
  --sand: #cebca8;
  --sand-light: #f8f4ef;
  --sand-soft: #eee4da;
  --wine: #711a00;
  --wine-dark: #47160b;
  --orange: #d48b40;
  --orange-light: #f3dfc8;
  --paper: #fffdfb;
  --white: #ffffff;
  --ink: #351b13;
  --muted: #75665e;
  --line: #e7ddd5;
  --success: #356b45;
  --success-bg: #e8f3eb;
  --danger: #8a321f;
  --danger-bg: #f8e8e2;
  --shadow: 0 16px 46px rgba(73, 34, 16, 0.08);
  --shadow-strong: 0 26px 80px rgba(55, 24, 10, 0.18);
  --heading: "League Spartan", "Arial Black", sans-serif;
  --body: "Inter", "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--sand-light);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 253, 251, 0.94);
  border-bottom: 1px solid rgba(113, 26, 0, 0.08);
  backdrop-filter: blur(14px);
}
.header-inner,
.hero-inner,
.catalog-shell,
.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand,
.checkout-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--wine);
  text-decoration: none;
}
.brand img { width: 58px; height: 58px; object-fit: contain; }
.brand-copy strong,
.brand-copy small { display: block; }
.brand-copy strong {
  font-family: var(--heading);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand-copy small { color: var(--muted); font-size: 0.75rem; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.live-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--wine-dark);
  font-size: 0.8rem;
  font-weight: 700;
}
.live-label > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(53, 107, 69, 0.11);
}
.cart-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(113, 26, 0, 0.14);
  border-radius: 12px;
  background: var(--white);
  color: var(--wine);
  font-weight: 700;
}
.cart-button:hover { border-color: var(--orange); }
.cart-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cart-button strong { font-size: 0.8rem; color: var(--ink); }
.cart-count {
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--wine);
  color: white;
  font-size: 0.72rem;
}

.hero {
  background: linear-gradient(110deg, #f2e9df 0%, #f8f4ef 58%, #f2e1ce 100%);
  border-bottom: 1px solid rgba(113, 26, 0, 0.07);
}
.hero-inner {
  min-height: 315px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(235px, 0.65fr);
  align-items: center;
  gap: 54px;
  padding: 54px 0 62px;
}
.hero-copy-wrap { position: relative; z-index: 2; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.hero h1,
.catalog-toolbar h2,
.product-card h3,
.empty-state h3,
.error-state h3,
.drawer-header h2,
.checkout-heading h1,
.form-section h2,
.order-summary h2,
.cart-empty h3 {
  font-family: var(--heading);
}
.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--wine);
  font-size: clamp(2.55rem, 5.9vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}
.hero-copy {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--wine-dark);
  font-size: clamp(0.96rem, 2vw, 1.08rem);
  line-height: 1.7;
}
.hero-brand-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  border: 1px solid rgba(113, 26, 0, 0.11);
  border-radius: 26px;
  background: rgba(255, 253, 251, 0.72);
  box-shadow: 0 14px 40px rgba(113, 26, 0, 0.06);
  overflow: hidden;
}
.hero-brand-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -55px;
  width: 150px;
  height: 150px;
  border: 28px solid rgba(212, 139, 64, 0.13);
  border-radius: 50%;
}
.hero-accent-line {
  position: absolute;
  top: 0;
  left: 26px;
  width: 76px;
  height: 5px;
  border-radius: 0 0 5px 5px;
  background: var(--orange);
}
.hero-brand-card img { position: relative; z-index: 1; width: 155px; }
.hero-brand-card p {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  color: var(--wine);
  text-align: center;
  font-family: var(--heading);
  font-size: 1.1rem;
  line-height: 1.05;
}

.catalog-shell {
  position: relative;
  margin-top: 30px;
  margin-bottom: 68px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.catalog-toolbar,
.catalog-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.catalog-toolbar h2 {
  margin: 0;
  color: var(--wine);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
}
.updated-at { margin: 0; color: var(--muted); font-size: 0.78rem; text-align: right; }
.filters {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(145px, 1fr));
  gap: 13px;
  margin-top: 25px;
}
.filters label { min-width: 0; }
.filters label > span:first-child,
.checkout-form label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--wine-dark);
  font-size: 0.74rem;
  font-weight: 700;
}
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.filters input[type="search"],
.filters select,
.checkout-form input,
.checkout-form select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  padding: 0 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.filters input[type="search"] { padding-left: 41px; }
.filters input:focus,
.filters select:focus,
.checkout-form input:focus,
.checkout-form select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(212, 139, 64, 0.15);
}
.stock-toggle {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--wine-dark);
  font-weight: 600;
}
.stock-toggle input { width: 17px; height: 17px; accent-color: var(--wine); }
.stock-toggle > span { margin: 0 !important; }
.catalog-summary {
  margin: 20px 0 15px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  align-items: center;
}
.catalog-summary p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.summary-actions { display: flex; align-items: center; gap: 16px; }
.catalog-cart-summary { color: var(--wine); font-size: 0.85rem; font-weight: 800; }
.text-button,
.back-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wine);
  font-weight: 800;
}
.text-button:hover,
.back-button:hover { color: var(--orange); }
.centered { margin: 15px auto 0; display: block; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
}
.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 139, 64, 0.55);
  box-shadow: 0 14px 35px rgba(70, 30, 12, 0.09);
}
.product-media {
  position: relative;
  aspect-ratio: 1 / 0.86;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f6f0ea;
  border-bottom: 1px solid var(--line);
}
.product-media > img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.product-placeholder {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-light);
  color: var(--wine);
  font-family: var(--heading);
  font-size: 1.4rem;
  font-weight: 800;
}
.stock-badge {
  position: absolute;
  top: 11px;
  left: 11px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}
.stock-badge.in-stock { background: var(--success-bg); color: var(--success); }
.stock-badge.out-of-stock { background: var(--danger-bg); color: var(--danger); }
.product-body { padding: 16px; }
.product-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.7rem; }
.product-brand { color: var(--orange); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.product-card h3 {
  min-height: 2.25em;
  margin: 9px 0 0;
  color: var(--wine-dark);
  font-size: 1.18rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.product-description { margin: 9px 0 0; color: var(--muted); font-size: 0.77rem; line-height: 1.45; }
.product-footer { margin-top: 17px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.product-price { color: var(--wine); font-family: var(--heading); font-size: 1.35rem; font-weight: 800; }
.product-sku { max-width: 48%; overflow: hidden; color: #9b8f87; font-size: 0.58rem; text-overflow: ellipsis; white-space: nowrap; }
.add-cart-button {
  width: 100%;
  min-height: 41px;
  margin-top: 13px;
  border: 1px solid var(--wine);
  border-radius: 10px;
  background: var(--wine);
  color: white;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.add-cart-button:hover:not(:disabled) { background: var(--orange); border-color: var(--orange); transform: translateY(-1px); }
.add-cart-button:disabled { border-color: var(--line); background: #f0ebe7; color: #9a8f88; }

.status-panel,
.empty-state,
.error-state {
  min-height: 270px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  text-align: center;
}
.status-panel p,
.empty-state p,
.error-state p { max-width: 540px; margin: 0; color: var(--muted); line-height: 1.6; }
.empty-state h3,
.error-state h3 { margin: 0; color: var(--wine); font-size: 1.8rem; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--sand-soft); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.primary-button,
.secondary-button {
  min-height: 45px;
  padding: 0 18px;
  border-radius: 11px;
  font-weight: 800;
}
.primary-button { border: 1px solid var(--wine); background: var(--wine); color: white; }
.primary-button:hover:not(:disabled) { border-color: var(--orange); background: var(--orange); }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--wine); }
.secondary-button:hover:not(:disabled) { border-color: var(--orange); }
.full-width { width: 100%; }
.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--wine);
  font-size: 1.55rem;
  line-height: 1;
}

.site-footer { border-top: 1px solid var(--line); background: white; }
.footer-inner { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--wine); font-family: var(--heading); font-weight: 800; }
.footer-brand img { width: 45px; }
.footer-inner p { margin: 0; color: var(--muted); font-size: 0.78rem; text-align: right; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(45, 20, 10, 0.34);
  backdrop-filter: blur(2px);
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(440px, 100%);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 25px;
  background: var(--paper);
  box-shadow: var(--shadow-strong);
  transform: translateX(104%);
  transition: transform 220ms ease;
}
.cart-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; color: var(--wine); font-size: 2.25rem; }
.cart-empty { margin: auto; text-align: center; }
.cart-empty h3 { margin: 0; color: var(--wine); font-size: 1.65rem; }
.cart-empty p { margin: 8px 0 0; color: var(--muted); }
.cart-content { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.cart-items { flex: 1; overflow: auto; padding: 13px 2px 8px 0; }
.cart-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-media,
.checkout-item-media {
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f6f0ea;
}
.cart-item-media { width: 70px; height: 70px; }
.cart-item-media img,
.checkout-item-media img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.mini-placeholder { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--orange-light); color: var(--wine); font-family: var(--heading); font-weight: 800; }
.cart-item-info { min-width: 0; }
.cart-item-info h3 { margin: 0; color: var(--wine-dark); font-family: var(--heading); font-size: 1.03rem; line-height: 1.1; }
.cart-item-info > p { margin: 5px 0 10px; color: var(--muted); font-size: 0.72rem; }
.cart-item-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quantity-control { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.quantity-control button { width: 31px; height: 31px; border: 0; background: white; color: var(--wine); font-weight: 800; }
.quantity-control span { min-width: 30px; text-align: center; font-size: 0.82rem; font-weight: 700; }
.remove-item { border: 0; background: transparent; color: var(--danger); font-size: 0.72rem; font-weight: 800; }
.cart-item-price { color: var(--wine); font-size: 0.82rem; font-weight: 800; }
.cart-total-row,
.checkout-total-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0 8px; }
.cart-total-row strong,
.checkout-total-row strong { color: var(--wine); font-family: var(--heading); font-size: 1.65rem; }
.fee-note { margin: 0 0 17px; color: var(--muted); font-size: 0.73rem; line-height: 1.45; }

.checkout-panel {
  position: fixed;
  inset: 0;
  z-index: 110;
  overflow: auto;
  background: var(--sand-light);
}
.checkout-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 max(20px, calc((100vw - 1160px) / 2));
  background: rgba(255, 253, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.checkout-topbar .icon-button { justify-self: end; }
.checkout-brand img { width: 43px; }
.checkout-brand span { font-family: var(--heading); font-weight: 800; }
.checkout-shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 72px; }
.checkout-heading { max-width: 700px; margin-bottom: 28px; }
.checkout-heading h1 { margin: 0; color: var(--wine); font-size: clamp(2.7rem, 6vw, 4.7rem); line-height: 0.95; letter-spacing: -0.04em; }
.checkout-heading > p:last-child { margin: 16px 0 0; color: var(--muted); line-height: 1.6; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(315px, 0.65fr); gap: 24px; align-items: start; }
.checkout-form { display: grid; gap: 16px; }
.form-section,
.order-summary {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  box-shadow: 0 10px 30px rgba(73, 34, 16, 0.045);
}
.form-section { padding: 24px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.section-heading > span { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--orange-light); color: var(--wine); font-size: 0.78rem; font-weight: 800; }
.section-heading h2 { margin: 0; color: var(--wine); font-size: 1.55rem; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 0.78rem; }
.field-grid { display: grid; gap: 13px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { position: relative; display: block; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card > span { min-height: 83px; display: flex; flex-direction: column; justify-content: center; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.choice-card input:checked + span { border-color: var(--orange); background: #fffaf4; box-shadow: 0 0 0 3px rgba(212, 139, 64, 0.11); }
.choice-card strong { color: var(--wine); }
.choice-card small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.delivery-fields { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.pin-box { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbf7f2; }
.pin-box > div:first-child strong { color: var(--wine); }
.pin-box > div:first-child p { margin: 4px 0 13px; color: var(--muted); font-size: 0.76rem; line-height: 1.45; }
.pin-actions { display: flex; gap: 9px; margin-bottom: 13px; }
.pin-actions button { flex: 1; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { min-width: 0; }
.copy-field button { min-width: 70px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--wine); font-weight: 800; }
.field-status { min-height: 1.2em; margin: 8px 0 0; color: var(--muted); font-size: 0.72rem; }
.payment-details { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fbf7f2; }
.payment-copy { min-width: 0; }
.payment-copy > span { display: block; margin-top: 11px; color: var(--muted); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.payment-copy > strong { display: block; margin-top: 3px; color: var(--wine-dark); }
.payment-bank { margin: 0; color: var(--wine); font-family: var(--heading); font-size: 1.45rem; font-weight: 800; }
.payment-number-field { margin-top: 5px; }
.payment-qr-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: white; }
.payment-qr-wrap img { width: 100%; height: 230px; object-fit: contain; }
.notice-box { margin-bottom: 14px; padding: 15px; border-left: 4px solid var(--orange); border-radius: 8px; background: #fff8ef; }
.notice-box strong { color: var(--wine); }
.notice-box p { margin: 5px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.final-section .secondary-button { margin-top: 9px; }
.checkout-status { min-height: 1.4em; margin: 10px 0 0; color: var(--success); font-size: 0.78rem; text-align: center; }
.order-summary { position: sticky; top: 90px; padding: 21px; }
.order-summary-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.order-summary h2 { margin: 0; color: var(--wine); font-size: 1.55rem; }
.checkout-items { max-height: 420px; overflow: auto; }
.checkout-item { display: grid; grid-template-columns: 55px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.checkout-item-media { width: 55px; height: 55px; }
.checkout-item h3 { margin: 0; color: var(--wine-dark); font-family: var(--heading); font-size: 0.92rem; line-height: 1.1; }
.checkout-item p { margin: 4px 0 0; color: var(--muted); font-size: 0.68rem; }
.checkout-item > strong { color: var(--wine); font-size: 0.78rem; }
.checkout-total-row { border-top: 1px solid var(--line); }

.mobile-cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 55;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 17px;
  border: 0;
  border-radius: 14px;
  background: var(--wine);
  color: white;
  box-shadow: 0 14px 35px rgba(71, 22, 11, 0.28);
}
.mobile-cart-bar span { text-align: left; }
.mobile-cart-bar strong,
.mobile-cart-bar small { display: block; }
.mobile-cart-bar small { margin-top: 2px; opacity: 0.75; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 160;
  max-width: min(430px, calc(100% - 30px));
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--wine-dark);
  color: white;
  box-shadow: var(--shadow-strong);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 1000px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: minmax(230px, 2fr) repeat(2, minmax(145px, 1fr)); }
  .filters label:nth-child(4) { grid-column: 2 / 3; }
  .checkout-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; order: -1; }
}

@media (max-width: 760px) {
  body { padding-bottom: 78px; }
  .header-inner { min-height: 66px; }
  .brand img { width: 50px; height: 50px; }
  .brand-copy small,
  .live-label,
  #header-cart-total { display: none; }
  .header-actions { gap: 8px; }
  .cart-button { padding: 0 10px; }
  .hero-inner { min-height: 0; grid-template-columns: 1fr; gap: 25px; padding: 43px 0 45px; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 4rem); }
  .hero-brand-card { min-height: 150px; flex-direction: row; gap: 20px; justify-content: flex-start; padding: 18px 22px; }
  .hero-brand-card img { width: 108px; }
  .hero-brand-card p { text-align: left; }
  .catalog-shell { width: min(100% - 18px, 1180px); margin-top: 15px; padding: 20px 14px 26px; border-radius: 17px; }
  .catalog-toolbar { align-items: flex-start; }
  .updated-at { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filters label:nth-child(4) { grid-column: auto; }
  .stock-toggle { grid-column: 1 / -1; }
  .catalog-summary { align-items: flex-start; }
  .summary-actions { flex-direction: column; align-items: flex-end; gap: 5px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-body { padding: 13px; }
  .product-card h3 { font-size: 1.03rem; }
  .product-footer { display: block; }
  .product-sku { display: block; max-width: 100%; margin-top: 5px; }
  .footer-inner { min-height: 120px; flex-direction: column; justify-content: center; gap: 8px; }
  .footer-inner p { text-align: center; }
  .mobile-cart-bar:not([hidden]) { display: flex; }
  .checkout-topbar { grid-template-columns: 1fr auto; padding: 0 14px; }
  .checkout-brand { display: none; }
  .checkout-shell { width: min(100% - 18px, 1160px); padding-top: 27px; }
  .checkout-heading h1 { font-size: 2.85rem; }
  .two-columns,
  .choice-cards,
  .payment-details { grid-template-columns: 1fr; }
  .payment-qr-wrap img { height: auto; max-height: 470px; }
  .pin-actions { flex-direction: column; }
  .form-section { padding: 19px 15px; }
}

@media (max-width: 480px) {
  .header-inner,
  .hero-inner,
  .footer-inner { width: calc(100% - 22px); }
  .brand-copy strong { font-size: 1rem; }
  #header-cart-label { display: none; }
  .hero-brand-card { display: none; }
  .filters { grid-template-columns: 1fr; }
  .filters label,
  .filters label:nth-child(4),
  .search-field,
  .stock-toggle { grid-column: 1; }
  .catalog-summary { flex-direction: column; gap: 8px; }
  .summary-actions { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .product-media { aspect-ratio: 1; }
  .product-placeholder { width: 58px; height: 58px; }
  .product-meta { display: block; }
  .product-meta span { display: block; }
  .product-meta span:last-child { margin-top: 3px; }
  .product-price { font-size: 1.18rem; }
  .add-cart-button { font-size: 0.78rem; }
  .cart-drawer { padding: 18px 15px; }
  .checkout-item { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .checkout-item-media { width: 48px; height: 48px; }
}

/* Version 4: pickup, delivery map, payment QR, and order capture */
.website-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.pickup-details {
  margin-top: 17px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbf7f2;
  color: var(--wine-dark);
}
.pickup-details strong { display: block; color: var(--wine); font-family: var(--heading); font-size: 1.15rem; }
.pickup-details p { margin: 5px 0 0; font-size: 0.82rem; line-height: 1.45; }
.pickup-details a { color: var(--wine); font-weight: 700; text-decoration: none; }
.pickup-details span { display: block; margin-top: 10px; color: var(--muted); font-size: 0.74rem; font-weight: 700; }

.map-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbf7f2;
}
.map-box-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}
.map-box-heading strong { color: var(--wine); }
.map-box-heading p { max-width: 520px; margin: 4px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.45; }
.map-preview-wrap {
  position: relative;
  overflow: hidden;
  min-height: 265px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #efe5da;
}
.map-preview-wrap iframe { width: 100%; height: 310px; border: 0; display: block; }
.map-placeholder {
  min-height: 265px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
}

.payment-details {
  grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.25fr);
  grid-template-areas:
    "bank bank"
    "qr details";
  align-items: start;
}
.payment-bank { grid-area: bank; }
.payment-qr-wrap { grid-area: qr; }
.payment-copy { grid-area: details; }
.payment-note { margin: 12px 0 0; color: var(--muted); font-size: 0.75rem; line-height: 1.45; }
.payment-qr-wrap img { height: auto; max-height: 390px; object-fit: contain; }

.checkout-status.success { color: var(--success); }
.checkout-status.warning { color: var(--wine); }

@media (max-width: 760px) {
  .map-box-heading { display: block; }
  .map-box-heading .pin-actions { margin-top: 12px; }
  .payment-details {
    grid-template-columns: 1fr;
    grid-template-areas: "bank" "qr" "details";
  }
  .payment-qr-wrap img { max-height: none; }
}

/* Version 5: prioritized filters, bulk quantity, simplified delivery, notes, downloadable QR */
.filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}
.filter-category { grid-column: 1; }
.filter-brand { grid-column: 2; }
.filter-sort { grid-column: 3; }
.filter-search { grid-column: 1 / span 2; }
.filter-stock {
  grid-column: 3;
  align-self: center;
  margin-top: 22px;
}

.product-purchase-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 9px;
  align-items: stretch;
  margin-top: 13px;
}
.product-quantity-control {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(38px, 1fr) 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.product-quantity-control button,
.product-quantity-control input {
  min-width: 0;
  min-height: 41px;
  border: 0;
  background: transparent;
  color: var(--wine);
  font: inherit;
  font-weight: 800;
  text-align: center;
}
.product-quantity-control button { cursor: pointer; }
.product-quantity-control button:hover:not(:disabled) { background: var(--orange-light); }
.product-quantity-control input {
  width: 100%;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
.product-quantity-control input::-webkit-inner-spin-button,
.product-quantity-control input::-webkit-outer-spin-button { margin: 0; appearance: none; -webkit-appearance: none; }
.product-quantity-control :disabled { color: #a69b94; cursor: not-allowed; }
.product-purchase-row .add-cart-button { margin-top: 0; }

.checkout-form textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  font: inherit;
  line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.checkout-form textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(212, 139, 64, 0.15);
}
.checkout-form label small { color: var(--muted); font-weight: 500; }

.delivery-pin-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbf7f2;
}
.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.payment-qr-wrap {
  padding: 10px;
  text-align: center;
}
.download-qr-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 4px);
  margin: 8px 2px 2px;
  padding: 0 14px;
  border: 1px solid var(--wine);
  border-radius: 9px;
  background: white;
  color: var(--wine);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}
.download-qr-button:hover { background: var(--wine); color: white; }

@media (max-width: 1000px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-category { grid-column: 1; }
  .filter-brand { grid-column: 2; }
  .filter-sort { grid-column: 3; }
  .filter-search { grid-column: 1 / span 2; }
  .filter-stock { grid-column: 3; }
}

@media (max-width: 760px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filter-category { grid-column: 1; }
  .filter-brand { grid-column: 2; }
  .filter-sort { grid-column: 1; }
  .filter-search { grid-column: 1 / -1; }
  .filter-stock { grid-column: 2; margin-top: 22px; }
  .product-purchase-row { grid-template-columns: 96px minmax(0, 1fr); gap: 7px; }
  .product-quantity-control { grid-template-columns: 28px minmax(36px, 1fr) 28px; }
}

@media (max-width: 480px) {
  .filter-category,
  .filter-brand,
  .filter-sort,
  .filter-search,
  .filter-stock { grid-column: 1; }
  .filter-stock { margin-top: 0; }
  .product-purchase-row { grid-template-columns: 1fr; }
  .product-quantity-control { grid-template-columns: 36px minmax(42px, 1fr) 36px; }
}


/* Version 6: phone-first filters and embedded pickup/delivery maps */
.pickup-map-wrap,
.delivery-map-wrap {
  overflow: hidden;
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #efe5da;
}
.pickup-map-wrap iframe,
.delivery-map-wrap iframe {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
}
.delivery-pin-field {
  display: block;
  margin-top: 14px;
}
.delivery-map-wrap {
  min-height: 280px;
  margin-bottom: 0;
}
.delivery-map-wrap .map-placeholder {
  min-height: 280px;
}

/* Desktop/tablet filter placement remains deliberate regardless of DOM order. */
.filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}
.filter-category { grid-column: 1; grid-row: 1; }
.filter-brand { grid-column: 2; grid-row: 1; }
.filter-sort { grid-column: 3; grid-row: 1; }
.filter-search { grid-column: 1 / span 2; grid-row: 2; }
.filter-stock {
  grid-column: 3;
  grid-row: 2;
  width: 100%;
  min-height: 46px;
  justify-content: center;
  margin-top: 0;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbf7f2;
}

@media (max-width: 760px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbf7f2;
  }
  .filter-category { grid-column: 1; grid-row: 1; }
  .filter-brand { grid-column: 2; grid-row: 1; }
  .filter-sort { grid-column: 1; grid-row: 2; }
  .filter-stock { grid-column: 2; grid-row: 2; }
  .filter-search { grid-column: 1 / -1; grid-row: 3; }
  .filters label > span:first-child { margin-bottom: 5px; font-size: 0.69rem; }
  .filters input[type="search"],
  .filters select,
  .filter-stock { min-height: 44px; border-radius: 10px; }
  .filter-stock {
    align-self: end;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 11px;
    background: white;
    font-size: 0.76rem;
    white-space: nowrap;
  }
  .filter-stock input { flex: 0 0 auto; }
  .pickup-map-wrap iframe,
  .delivery-map-wrap iframe { height: 265px; }
  .delivery-map-wrap,
  .delivery-map-wrap .map-placeholder { min-height: 265px; }
}

@media (max-width: 420px) {
  .catalog-shell { padding-right: 11px; padding-left: 11px; }
  .filters { gap: 8px; padding: 10px; }
  .filters select { padding-right: 7px; padding-left: 9px; font-size: 0.78rem; }
  .filters input[type="search"] { font-size: 0.82rem; }
  .filter-stock { padding: 0 8px; font-size: 0.7rem; letter-spacing: -0.01em; }
  .filter-stock input { width: 16px; height: 16px; }
  .pickup-map-wrap iframe,
  .delivery-map-wrap iframe { height: 235px; }
  .delivery-map-wrap,
  .delivery-map-wrap .map-placeholder { min-height: 235px; }
}
