@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* ── W4 STORE Design System ── */
  --bg:           #F7F5F3;
  --surface:      #FFFFFF;
  --surface-2:    #F2EFEC;
  --surface-3:    #EAE5E0;
  --border:       #E4DDD6;
  --border-2:     #CFC7BE;

  --ink:          #1C1917;          /* near-black, main text */
  --ink-2:        #57534E;          /* warm stone, secondary */
  --ink-3:        #A8A29E;          /* muted, hints */

  --accent:       #6B1420;          /* W4 brand burgundy */
  --accent-2:     #4E0E17;
  --accent-light: #F5EAEB;
  --gold:         #C9A84C;          /* luxury gold accent */
  --gold-light:   #FBF4E1;

  --red:          #C0392B;
  --green:        #2D6A4F;
  --star:         #C9A84C;          /* gold stars */

  --badge-hit:    #C0392B;
  --badge-new:    #1C1917;
  --badge-sale:   #C9A84C;

  --r-xs: 2px;
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --shadow-xs: 0 1px 2px rgba(28,25,23,0.06);
  --shadow-sm: 0 2px 8px rgba(28,25,23,0.08);
  --shadow:    0 4px 20px rgba(28,25,23,0.10);

  --header-h:    56px;
  --subnav-h:    44px;
  --bottomnav-h: 58px;

  /* ── Typography scale ── */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Inter', -apple-system, sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════
   SEARCH BAR — collapsible, under header
══════════════════════════════════════════════ */
.search-bar {
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  height: 0; overflow: hidden;
  background: var(--ink);
  z-index: 195;
  transition: height .22s ease;
}
.search-bar.open {
  height: 48px;
}
.search-bar-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.search-bar-inner svg { color: rgba(255,255,255,0.45); flex-shrink: 0; }
.search-bar-inner input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; font-family: var(--font-ui); color: #fff;
  font-weight: 300; letter-spacing: 0.02em;
}
.search-bar-inner input::placeholder { color: rgba(255,255,255,0.35); }
.search-bar-close {
  width: 28px; height: 28px; border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,0.5); flex-shrink: 0;
  padding: 0;
}
.search-bar-close:active { color: #fff; }

/* When search is open, shift subnav/pages down by 48px */
.search-bar.open ~ .subnav,
.search-bar.open ~ [id="subnav"] { top: calc(var(--header-h) + 48px); }
.search-open .page { padding-top: calc(var(--header-h) + 48px + var(--subnav-h)); }
.search-open .page.no-subnav { padding-top: calc(var(--header-h) + 48px); }

/* ══════════════════════════════════════════════
   TOP HEADER — editorial dark bar
══════════════════════════════════════════════ */
.header {
  position: fixed; top:0; left:0; right:0;
  height: var(--header-h);
  background: var(--ink);
  display: flex; align-items: center;
  padding: 0 12px;
  z-index: 200;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-logo {
  display: flex; align-items: center;
  text-decoration: none; flex: 1; cursor: pointer;
}

.header-logo-text {
  color: #fff;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1;
}
.header-logo-text em {
  color: var(--gold);
  font-style: normal;
}

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

.header-icon-btn {
  width: 40px; height: 40px;
  border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: var(--r-xs); position: relative;
  color: rgba(255,255,255,0.8); flex-shrink: 0;
  transition: color .15s, background .15s;
}
.header-icon-btn:active { background: rgba(255,255,255,0.1); color: #fff; }

.badge-dot {
  position: absolute; top: 7px; right: 5px;
  background: var(--gold); color: var(--ink);
  font-size: 8px; font-weight: 700;
  min-width: 15px; height: 15px;
  border-radius: 8px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui);
}

.back-btn {
  width: 40px; height: 40px;
  border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,0.9); flex-shrink: 0;
  display: none;
}
.back-btn.visible { display: flex; }

/* ══════════════════════════════════════════════
   SUBNAV — category tabs with icons
══════════════════════════════════════════════ */
.subnav {
  position: fixed;
  top: var(--header-h); left:0; right:0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 190;
  display: flex; align-items: stretch;
  overflow-x: auto; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display:none; }
/* Adjust page padding for taller subnav */
:root { --subnav-h: 56px; }

.subnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 14px; gap: 3px;
  border: none; background: none; cursor: pointer;
  font-size: 10px; font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap; flex-shrink: 0;
  position: relative; transition: color .15s;
  font-family: var(--font-ui);
  letter-spacing: 0.06em; text-transform: uppercase;
  min-width: 56px;
}
.subnav-icon { display: flex; line-height: 0; transition: color .15s; }
.subnav-item::after {
  content: ''; position: absolute; bottom: 0; left: 10px; right: 10px;
  height: 1.5px; background: var(--ink);
  transform: scaleX(0); transition: transform .2s ease;
}
.subnav-item.active { color: var(--ink); }
.subnav-item.active::after { transform: scaleX(1); }

/* ══════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display:none; }

.filter-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  border-radius: 2px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-size: 11px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap; cursor: pointer; flex-shrink: 0;
  font-family: var(--font-ui); letter-spacing: 0.04em;
  transition: all .15s;
}
.filter-chip.active {
  border-color: var(--ink); color: var(--ink);
  background: var(--ink); color: #fff;
}
.filter-chip svg { width: 11px; height: 11px; }

/* ══════════════════════════════════════════════
   PAGES
══════════════════════════════════════════════ */
.page {
  display: none;
  padding-top: calc(var(--header-h) + var(--subnav-h));
  min-height: 100vh;
  padding-bottom: calc(var(--bottomnav-h) + 16px);
}
.page.active { display: block; }
.page.no-subnav { padding-top: var(--header-h); }

/* ══════════════════════════════════════════════
   PRODUCT GRID — editorial 2-col
══════════════════════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
}

/* SKELETON */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-xs);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.product-card {
  background: var(--surface);
  cursor: pointer;
  position: relative;
  display: flex; flex-direction: column;
  transition: opacity .15s;
}
.product-card:active { opacity: 0.8; }

.product-img-wrap {
  position: relative;
  width: 100%; aspect-ratio: 2/3;
  background: var(--surface-2);
}
.product-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: flex-start;
  font-size: 44px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.product-img::-webkit-scrollbar { display: none; }
.product-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  flex: 0 0 100%; scroll-snap-align: start;
}
.product-img span {
  width: 100%; height: 100%; flex: 0 0 100%; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
}

/* Badges */
.product-badge {
  position: absolute; top: 0; left: 0;
  padding: 5px 9px;
  font-size: 9px; font-weight: 700; color: #fff;
  letter-spacing: 0.1em; text-transform: uppercase;
  font-family: var(--font-ui);
  z-index: 3; pointer-events: none;
}
.badge-hit  { background: var(--badge-hit); }
.badge-new  { background: var(--badge-new); }
.badge-sale { background: var(--gold); color: #fff; }

.badge-discount {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 3px 7px; border-radius: 4px;
  letter-spacing: 0.03em;
  font-family: var(--font-ui);
  z-index: 3; pointer-events: none;
}

/* Wishlist heart */
.card-fav {
  position: absolute; bottom: 8px; right: 8px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.92);
  border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: transform .18s, background .15s;
  box-shadow: 0 1px 4px rgba(28,25,23,0.12);
}
.card-fav:active { transform: scale(1.3); }

.product-info { padding: 10px 10px 14px; }

.product-brand {
  font-size: 9px; font-weight: 600;
  color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.12em; margin-bottom: 4px;
  font-family: var(--font-ui);
}

.product-name {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 400;
  line-height: 1.35; color: var(--ink);
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.product-price-row {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 4px;
}

.price-current {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500; color: var(--ink);
  letter-spacing: -0.01em;
}
.price-old { font-size: 11px; color: var(--ink-3); text-decoration: line-through; }
.price-sale { font-size: 10px; font-weight: 600; color: var(--accent); letter-spacing: 0.03em; }

/* Stars */
.product-rating {
  display: flex; align-items: center; gap: 4px; margin-bottom: 4px;
}
.stars { color: var(--star); font-size: 10px; letter-spacing: -0.5px; }
.rating-count { font-size: 10px; color: var(--ink-3); font-family: var(--font-ui); }

.product-colors { display: flex; gap: 3px; margin-top: 5px; }
.color-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(28,25,23,0.12); }

.delivery-badge {
  font-size: 10px; color: var(--green); font-weight: 500; margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════
   PRODUCT DETAIL — editorial layout
══════════════════════════════════════════════ */
.product-page { padding-bottom: calc(var(--bottomnav-h) + 72px); }

.product-gallery {
  width: 100%; aspect-ratio: 2/3;
  background: var(--surface-2);
  display: flex; align-items: stretch;
  font-size: 72px; position: relative;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  flex-shrink: 0;
}
.product-gallery::-webkit-scrollbar { display: none; }
.product-gallery img {
  width:100%; height:100%; object-fit:cover;
  flex: 0 0 100%; scroll-snap-align: start;
  display: block;
}
.product-gallery span {
  width: 100%; height: 100%; flex: 0 0 100%; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
}
.video-slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: start;
  width: 100%; height: 100%; overflow: hidden; cursor: pointer;
  display: flex; align-items: stretch;
}
.video-slide video { width:100%; height:100%; object-fit:cover; flex-shrink:0; display:block; }
.video-play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; pointer-events: none;
  transition: opacity .2s;
}

.gallery-dots {
  position: absolute; bottom: 14px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 5px;
}
.gallery-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.55); transition: all .2s; cursor: pointer;
}
.gallery-dot.active { background: #fff; width: 20px; border-radius: 2px; }

.gallery-thumbs {
  display: flex; gap: 4px;
  padding: 8px 12px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.gallery-thumbs::-webkit-scrollbar { display:none; }
.gallery-thumb {
  width: 44px; height: 58px; border-radius: var(--r-xs); flex-shrink: 0;
  border: 1.5px solid transparent; background-size: cover; background-position: center;
  cursor: pointer; transition: border-color .15s, opacity .15s; opacity: 0.6;
}
.gallery-thumb.active { border-color: var(--ink); opacity: 1; }

.product-detail { padding: 18px 14px 0; background: var(--surface); }

.detail-brand {
  font-size: 10px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 6px;
  font-family: var(--font-ui);
}

.product-detail-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 400; line-height: 1.25;
  margin-bottom: 12px; color: var(--ink);
  letter-spacing: -0.01em;
}

.detail-rating-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.detail-stars { color: var(--star); font-size: 12px; letter-spacing: -0.5px; }
.detail-rating-num { font-size: 12px; font-weight: 600; color: var(--ink); }
.detail-reviews {
  font-size: 12px; color: var(--accent);
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-price-row {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; flex-wrap: wrap;
}
.detail-price {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 400; color: var(--ink);
  letter-spacing: -0.02em;
}
.detail-old-price { font-size: 14px; color: var(--ink-3); text-decoration: line-through; }
.detail-discount-badge {
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-xs);
  letter-spacing: 0.06em;
  font-family: var(--font-ui);
}

.detail-section { padding: 16px 14px; background: var(--surface); margin-top: 6px; }
.detail-section-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 500; margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.section-label {
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-ui);
}
.section-label span { color: var(--ink-3); font-weight: 400; text-transform: none; letter-spacing: 0; }

.colors-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-option {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid transparent;
  cursor: pointer; transition: all .15s;
  box-shadow: 0 1px 3px rgba(28,25,23,0.18);
  outline: 2px solid transparent; outline-offset: 2px;
}
.color-option.selected { outline-color: var(--ink); transform: scale(1.08); }

.sizes-row { display: flex; gap: 6px; flex-wrap: wrap; }
.size-option {
  min-width: 46px; height: 40px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0 10px; transition: all .15s;
  font-family: var(--font-ui); letter-spacing: 0.04em;
}
.size-option:active { transform: scale(0.94); }
.size-option.selected {
  border-color: var(--ink); background: var(--ink); color: #fff;
}

.description-text {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 300; line-height: 1.7; color: var(--ink-2);
}

/* Delivery info */
.delivery-block {
  padding: 16px 14px; background: var(--surface); margin-top: 6px;
  display: flex; flex-direction: column; gap: 12px;
}
.delivery-row {
  display: flex; align-items: flex-start; gap: 10px;
}
.delivery-row svg { color: var(--ink-3); flex-shrink: 0; margin-top: 1px; }
.delivery-row-text { font-size: 13px; line-height: 1.4; }
.delivery-row-text strong { color: var(--ink); font-weight: 500; }
.delivery-row-text span { color: var(--ink-2); font-weight: 300; }

/* Detail footer */
.product-detail-footer {
  position: fixed;
  bottom: var(--bottomnav-h);
  left: 0; right: 0;
  padding: 10px 14px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: stretch;
  z-index: 150;
  flex-direction: row;
}
.product-detail-footer .btn-primary { flex: 1; }
.btn-wishlist-detail {
  width: 48px; height: 48px; min-height: 48px; flex-shrink: 0; align-self: stretch;
  border: 1px solid var(--border-2); border-radius: var(--r-xs);
  background: var(--surface); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; transition: all .15s;
}
.btn-wishlist-detail.active { background: var(--accent-light); border-color: var(--accent); }
.btn-wishlist-detail:active { background: var(--accent-light); border-color: var(--accent); }

/* ══════════════════════════════════════════════
   REVIEWS MODAL
══════════════════════════════════════════════ */
.reviews-overlay {
  position: fixed; inset: 0;
  background: rgba(28,25,23,0.55);
  display: none; align-items: flex-end; z-index: 300;
}
.reviews-overlay.open { display: flex; }
.reviews-sheet {
  background: var(--surface);
  border-radius: 12px 12px 0 0;
  width: 100%; height: 88vh;
  display: flex; flex-direction: column;
}
.reviews-header {
  padding: 0 16px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.reviews-handle-row {
  display: flex; align-items: center; justify-content: center;
  padding-top: 10px; padding-bottom: 4px;
  position: relative;
}
.reviews-handle {
  width: 32px; height: 3px; background: var(--border-2);
  border-radius: 2px;
}
.reviews-close-btn {
  position: absolute; right: 0; top: 6px;
  width: 32px; height: 32px; border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-3); padding: 0;
  transition: color .15s;
}
.reviews-close-btn:active { color: var(--ink); }
.reviews-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 400; margin-bottom: 14px;
  letter-spacing: 0.02em;
}

/* Rating summary */
.rating-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.rating-big { text-align: center; min-width: 58px; }
.rating-big-num {
  font-family: var(--font-display);
  font-size: 38px; font-weight: 300; line-height: 1; color: var(--ink);
}
.rating-big-stars { color: var(--star); font-size: 14px; letter-spacing: -0.5px; margin: 4px 0; }
.rating-big-count { font-size: 10px; color: var(--ink-3); font-family: var(--font-ui); }
.rating-bars { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rating-bar-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--ink-2);
  font-family: var(--font-ui);
}
.rating-bar-row span:first-child { min-width: 8px; text-align: right; }
.rating-bar-track {
  flex: 1; height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.rating-bar-fill { height: 100%; background: var(--star); border-radius: 2px; transition: width .4s; }

/* Review list */
.reviews-list { flex: 1; overflow-y: auto; padding: 0 16px; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; touch-action: pan-y; }
.review-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.review-item:last-child { border-bottom: none; }
.review-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.review-author { font-size: 12px; font-weight: 600; color: var(--ink); letter-spacing: 0.02em; }
.review-date { font-size: 10px; color: var(--ink-3); }
.review-stars { color: var(--star); font-size: 12px; letter-spacing: -0.5px; margin-bottom: 5px; }
.review-text {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 300; color: var(--ink-2); line-height: 1.6;
}
.review-size-tag {
  display: inline-block; margin-top: 6px;
  font-size: 10px; color: var(--ink-3);
  background: var(--surface-2); padding: 2px 8px; border-radius: var(--r-xs);
  font-family: var(--font-ui);
}

/* Write review form */
.review-form {
  padding: 14px 16px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface);
}
.review-form-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 400; margin-bottom: 10px;
}
.star-picker {
  display: flex; gap: 4px; margin-bottom: 10px;
}
.star-pick-btn {
  font-size: 24px; background: none; border: none; cursor: pointer;
  transition: transform .15s; line-height: 1;
}
.star-pick-btn:active { transform: scale(1.3); }
.star-pick-btn.dim { filter: grayscale(1) opacity(.3); }

.review-textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-xs);
  font-family: var(--font-display); font-size: 14px; font-weight: 300;
  color: var(--ink); resize: none; outline: none; min-height: 66px;
  transition: border-color .15s; background: var(--surface);
}
.review-textarea:focus { border-color: var(--ink); }

/* ══════════════════════════════════════════════
   CART
══════════════════════════════════════════════ */
.cart-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh;
  gap: 8px; text-align: center; padding: 24px;
}
.cart-empty p {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 400; color: var(--ink);
}
.cart-empty span { font-size: 13px; color: var(--ink-2); font-weight: 300; }
.empty-icon { font-size: 52px; margin-bottom: 8px; opacity: 0.7; }

.cart-items { background: var(--surface); }

.cart-item {
  display: flex; gap: 12px; padding: 14px 14px;
  border-bottom: 1px solid var(--border); align-items: flex-start;
}
.cart-item-img {
  width: 76px; height: 96px;
  background: var(--surface-2); border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0; overflow: hidden;
}
.cart-item-img img { width:100%; height:100%; object-fit:cover; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-brand {
  font-size: 9px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.12em;
  font-family: var(--font-ui);
}
.cart-item-name {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 400; line-height: 1.3;
  color: var(--ink); margin: 3px 0 6px;
}
.cart-item-meta { font-size: 11px; color: var(--ink-2); margin-bottom: 8px; }
.cart-item-price {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 500; color: var(--ink);
}

.qty-row {
  display: flex; align-items: center; margin-top: 8px;
  width: fit-content; border: 1px solid var(--border-2);
  border-radius: var(--r-xs); overflow: hidden;
}
.qty-btn {
  width: 32px; height: 30px;
  border: none; background: var(--surface-2);
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink); font-weight: 300;
  transition: background .15s;
}
.qty-btn:active { background: var(--border); }
.qty-val {
  font-size: 12px; font-weight: 500; min-width: 28px;
  text-align: center; background: var(--surface);
  line-height: 30px; font-family: var(--font-ui);
}

.del-btn {
  width: 32px; height: 32px; border: none; background: none;
  cursor: pointer; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs); transition: all .15s; margin-left: auto;
}
.del-btn:active { color: var(--accent); }

/* Cart summary */
.cart-summary {
  background: var(--surface); margin-top: 6px; padding: 14px 14px;
}
.cart-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 6px 0; font-family: var(--font-ui);
}
.cart-summary-row.total {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 500;
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px;
}
.cart-summary-row span:first-child { color: var(--ink-2); }
.cart-summary-row.total span:first-child { color: var(--ink); }

.cart-footer {
  position: sticky; bottom: 0;
  padding: 10px 14px 14px; background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════
   BOTTOM NAV
══════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-h);
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; z-index: 200;
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; border: none; background: none;
  cursor: pointer; font-family: var(--font-ui);
  transition: opacity .15s; position: relative;
}
.bottom-nav-item:active { opacity: 0.6; }
.bottom-nav-item svg { color: rgba(255,255,255,0.35); transition: color .2s; }
.bottom-nav-item span { font-size: 9px; color: rgba(255,255,255,0.35); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; transition: color .2s; }
.bottom-nav-item.active svg { color: var(--gold); }
.bottom-nav-item.active span { color: var(--gold); }
.bottom-nav-badge {
  position: absolute; top: 7px;
  left: calc(50% + 7px);
  background: var(--accent); color: #fff;
  font-size: 8px; font-weight: 700;
  min-width: 14px; height: 14px;
  border-radius: 7px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink);
  font-family: var(--font-ui);
}

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn-primary {
  background: var(--ink); color: #fff;
  border: none; border-radius: var(--r-xs);
  padding: 14px 20px;
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; transition: all .18s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary:active { background: #000; transform: scale(0.99); }
.btn-primary:disabled { background: var(--border); color: var(--ink-3); cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--border-2); border-radius: var(--r-xs);
  padding: 13px 20px;
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.btn-ghost:active { background: var(--surface-2); }

.btn-outline {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: var(--r-xs);
  padding: 13px 20px;
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-outline:active { background: rgba(107,20,32,0.07); }

/* ══════════════════════════════════════════════
   SIZE / CONTACT MODAL
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28,25,23,0.55);
  display: none; align-items: flex-end; z-index: 300;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 12px 12px 0 0;
  padding: 0 16px 32px; width: 100%;
  max-height: 82vh; overflow-y: auto;
}
.modal-handle {
  width: 32px; height: 3px; background: var(--border-2);
  border-radius: 2px; margin: 10px auto 16px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 400; text-align: center;
  margin-bottom: 16px; letter-spacing: 0.02em;
}
.size-grid { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: calc(var(--bottomnav-h) + 14px); left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff;
  padding: 9px 18px; border-radius: 2px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
  opacity: 0; transition: all .2s; z-index: 400;
  white-space: nowrap; font-family: var(--font-ui);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════
   EMPTY / SUCCESS STATES
══════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 24px; gap: 8px; text-align: center;
}
.empty-state p {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 400;
}
.empty-state span { font-size: 13px; color: var(--ink-2); font-weight: 300; }

.success-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 70vh;
  padding: 32px 20px; text-align: center; gap: 12px;
}
.success-icon { font-size: 56px; animation: popIn .45s cubic-bezier(0.34,1.56,0.64,1); opacity: 0.85; }
.success-screen h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 300; letter-spacing: -0.01em;
}
.success-screen p { font-size: 13px; color: var(--ink-2); line-height: 1.65; font-weight: 300; }

@keyframes popIn { 0%{transform:scale(0)} 100%{transform:scale(1)} }
::-webkit-scrollbar { width:0; height:0; }

/* ══════════════════════════════════════════════
   LOYALTY CARD
══════════════════════════════════════════════ */
.loyalty-page {
  padding: 0 0 32px;
}
.loyalty-card-wrap {
  padding: 20px 16px 24px;
}
.loyalty-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1.6 / 1;
  border-radius: 20px;
  padding: 20px 24px;
  overflow: visible;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  animation: cardAppear 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes cardAppear {
  0% { opacity: 0; transform: translateY(30px) rotateX(10deg); }
  100% { opacity: 1; transform: translateY(0) rotateX(0); }
}
.loyalty-card-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, var(--card-dark) 0%, var(--card-color) 100%);
  transition: all 0.5s ease;
  border-radius: 20px; overflow: hidden;
}
.loyalty-card-glass {
  position: absolute; inset: 0; z-index: 1;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
}
.loyalty-card-shimmer {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  border-radius: 20px;
}
.loyalty-card-shimmer::before {
  content: '';
  position: absolute; top: -50%; left: -60%;
  width: 60%; height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  animation: shimmerSlide 3.5s ease-in-out infinite;
}
@keyframes shimmerSlide { 0%{left:-60%} 100%{left:140%} }
.loyalty-card-orb {
  position: absolute; border-radius: 50%; z-index: 1; opacity: 0.18;
}
.loyalty-card-orb-1 { width: 160px; height: 160px; background: rgba(255,255,255,0.3); right: -40px; top: -40px; }
.loyalty-card-orb-2 { width: 100px; height: 100px; background: rgba(255,255,255,0.15); right: 40px; bottom: -30px; }
.loyalty-card-top, .loyalty-card-bottom { position: relative; z-index: 2; }
.loyalty-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.loyalty-card-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 400;
  color: rgba(255,255,255,0.95); letter-spacing: 0.05em;
}
.loyalty-card-brand em { font-style: normal; font-weight: 600; color: #fff; }
.loyalty-level-badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  background: rgba(255,255,255,0.2); color: #fff;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.3);
}
.loyalty-card-name {
  font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 500; color: #fff; letter-spacing: 0.04em;
  margin-top: 24px;
}
.loyalty-card-uid {
  font-family: 'Inter', sans-serif; font-size: 11px;
  color: rgba(255,255,255,0.5); letter-spacing: 0.12em; margin-top: 2px;
}
.loyalty-card-bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 20px;
}
.loyalty-card-discount {
  text-align: left;
}
.loyalty-card-discount-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 40px; font-weight: 400; color: #fff; line-height: 1;
}
.loyalty-card-discount-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); margin-top: 2px;
}
.loyalty-card-qr {
  width: 100px; height: 100px; background: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.loyalty-card-qr canvas, .loyalty-card-qr img { width: 100%; height: 100%; }

/* Progress section */
.loyalty-progress-wrap {
  padding: 20px 16px 0;
}
.loyalty-progress-label {
  display: flex; justify-content: space-between;
  font-family: 'Inter', sans-serif;
  font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em;
  margin-bottom: 8px; font-weight: 400;
}
.loyalty-progress-label strong { color: var(--ink-2); font-weight: 500; }
.loyalty-progress-track {
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.loyalty-progress-fill {
  height: 100%; border-radius: 2px;
  transition: width .8s cubic-bezier(0.34,1.1,0.64,1);
}
.loyalty-levels-row {
  display: flex; gap: 8px; padding: 16px 16px 0;
}
.loyalty-level-item {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: 10px 8px; text-align: center;
  transition: border-color .2s, background .2s;
}
.loyalty-level-item.active {
  border-color: var(--gold); background: var(--gold-light);
}
.loyalty-level-dot {
  width: 10px; height: 10px; border-radius: 50%; margin: 0 auto 6px;
}
.loyalty-level-name {
  font-family: 'Inter', sans-serif; font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2);
}
.loyalty-level-pct {
  font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 400;
  color: var(--ink); margin-top: 2px;
}

/* Info rows */
.loyalty-info {
  padding: 20px 16px 0;
}
.loyalty-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.loyalty-info-row:last-child { border-bottom: none; }
.loyalty-info-label {
  font-family: 'Inter', sans-serif; font-size: 12px; color: var(--ink-3); font-weight: 400;
}
.loyalty-info-value {
  font-family: 'Inter', sans-serif; font-size: 13px; color: var(--ink); font-weight: 500;
}

/* No card state */
.loyalty-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 32px; gap: 12px; text-align: center;
}
.loyalty-empty-icon {
  width: 64px; height: 64px; background: var(--surface-2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.loyalty-empty h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 400;
}
.loyalty-empty p { font-size: 13px; color: var(--ink-2); line-height: 1.6; font-weight: 300; }

/* Scan page (cashier) */
.scan-page {
  min-height: 100vh; background: #0F0D0B; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px; font-family: 'Inter', sans-serif;
}
.scan-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 300; letter-spacing: 0.1em; margin-bottom: 8px;
}
.scan-logo em { color: var(--gold); font-style: normal; font-weight: 600; }
.scan-subtitle {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); margin-bottom: 40px;
}
.scan-container {
  width: 100%; max-width: 400px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px; padding: 24px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.scan-reader-wrap {
  position: relative; width: 100%; border-radius: 16px; overflow: hidden;
  aspect-ratio: 1; background: #000; margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.1);
}
.scan-reader-frame {
  position: absolute; inset: 20px; z-index: 10;
  border: 2px solid rgba(255,215,0,0.3); border-radius: 12px;
  pointer-events: none;
}
.scan-reader-line {
  position: absolute; top: 20px; left: 20px; right: 20px; height: 2px;
  background: var(--gold); box-shadow: 0 0 15px var(--gold);
  z-index: 11; animation: scanLine 2s ease-in-out infinite;
}
@keyframes scanLine { 
  0%, 100% { transform: translateY(0); opacity: 0.2; }
  50% { transform: translateY(220px); opacity: 1; }
}
.scan-input {
  width: 100%; padding: 16px; margin-bottom: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: #fff; font-size: 14px; text-align: center;
  outline: none; transition: border-color 0.3s;
}
.scan-input:focus { border-color: var(--gold); }
.scan-result-card {
  margin-top: 24px; text-align: center; display: none;
  animation: slideUp 0.4s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.scan-result-card.visible { display: block; }
.scan-res-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 12px; color: #fff;
}
.scan-res-name { font-size: 24px; font-family: 'Cormorant Garamond', serif; margin-bottom: 4px; }
.scan-res-meta { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 20px; }
.scan-res-discount { font-size: 56px; font-family: 'Cormorant Garamond', serif; color: var(--gold); line-height: 1; }
.scan-charge-section { margin-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; }
.scan-status { font-size: 13px; margin-top: 16px; text-align: center; min-height: 20px; }
.scan-status.error { color: #FF4B4B; }
.scan-status.success { color: #4BFF4B; }

