/* ===== Header ===== */
.g2u-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--g2u-forest);
  color: var(--g2u-white);
  padding: var(--g2u-s-2) var(--g2u-gutter);
}
.g2u-header__top {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--g2u-tap);
}
.g2u-header__logo { display: flex; align-items: center; gap: 8px; }
.g2u-header__logo img { height: 32px; width: auto; }
.g2u-header__account {
  width: var(--g2u-tap); height: var(--g2u-tap);
  display: flex; align-items: center; justify-content: center;
  color: var(--g2u-white);
}
.g2u-header__pincode {
  font-size: 12px; color: var(--g2u-cream); opacity: .9;
  display: flex; align-items: center; gap: 5px; padding: 2px 0 8px;
  background: none;
  width: 100%;
}
.g2u-header__pincode svg { flex-shrink: 0; }
.g2u-header__pincode b { color: var(--g2u-white); }
.g2u-header__pincode-text {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  min-width: 0; flex: 1; text-align: left;
}
.g2u-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--g2u-white); border-radius: var(--g2u-r-pill);
  padding: 0 var(--g2u-s-3); height: 40px;
}
.g2u-search input {
  border: none; outline: none; flex: 1; background: none;
  font-size: 14px; color: var(--g2u-ink);
}
.g2u-search svg { flex-shrink: 0; color: var(--g2u-stone); }
.g2u-search__placeholder {
  color: var(--g2u-stone);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  min-width: 0; flex: 1;
}
.g2u-header--withback { display: flex; align-items: center; gap: 12px; }
.g2u-header--withback .page-title { color: var(--g2u-white); font-size: 18px; }
.g2u-back { color: var(--g2u-white); width: var(--g2u-tap); height: var(--g2u-tap); display:flex; align-items:center; justify-content:center; margin-left: -8px; }

/* ===== Bottom nav ===== */
.g2u-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  background: var(--g2u-white); border-top: 1px solid var(--g2u-line);
  display: flex; height: var(--g2u-nav-h);
}
.g2u-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--g2u-stone); font-size: 11px; transition: color .15s ease;
}
.g2u-nav a:hover { color: var(--g2u-leaf); }
.g2u-nav a.active { color: var(--g2u-leaf); }
.g2u-nav svg { width: 22px; height: 22px; }

/* ===== Floating cart bar ===== */
.g2u-cartbar {
  position: fixed; left: var(--g2u-gutter); right: var(--g2u-gutter);
  bottom: calc(var(--g2u-nav-h) + 10px); z-index: 140;
  background: var(--g2u-leaf); color: var(--g2u-white);
  border-radius: var(--g2u-r-md); padding: 10px 16px;
  display: none; align-items: center; justify-content: space-between;
  box-shadow: 0 6px 16px rgba(11,93,30,.3);
}
.g2u-cartbar.visible { display: flex; }
.g2u-cartbar__info b { font-family: var(--g2u-font-head); }
.g2u-cartbar__info span { display: block; font-size: 11px; opacity: .85; }
.g2u-cartbar__cta { display: flex; align-items: center; gap: 4px; font-weight: 600; font-family: var(--g2u-font-head); }

/* ===== Buttons ===== */
.btn {
  min-height: var(--g2u-tap);
  border-radius: var(--g2u-r-md);
  font-family: var(--g2u-font-head);
  font-weight: 600; font-size: 14px; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 20px;
  transition: background-color .15s ease, border-color .15s ease, transform .08s ease, opacity .15s ease;
}
.btn-primary { background: var(--g2u-leaf); color: var(--g2u-white); }
.btn-primary:hover { background: #166a28; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: var(--g2u-line); color: var(--g2u-stone); cursor: not-allowed; }
.btn-outline { background: var(--g2u-white); color: var(--g2u-leaf); border: 1.5px solid var(--g2u-leaf); }
.btn-outline:hover { background: #f3faf3; }
.btn-outline:active { transform: scale(.98); }
.btn-outline:disabled { background: var(--g2u-white); color: var(--g2u-stone); border-color: var(--g2u-line); cursor: not-allowed; }
.btn-outline:disabled:hover { background: var(--g2u-white); }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 12px; border-radius: var(--g2u-r-sm); }

/* ADD button / stepper */
.g2u-add {
  min-width: 72px; height: 32px; border-radius: var(--g2u-r-sm);
  background: var(--g2u-white); border: 1.5px solid var(--g2u-leaf);
  color: var(--g2u-leaf); font-family: var(--g2u-font-head); font-weight: 600;
  font-size: 12px; letter-spacing: .03em;
  transition: background-color .15s ease, transform .08s ease;
}
.g2u-add:hover { background: #f3faf3; }
.g2u-add:active { transform: scale(.95); }
.g2u-stepper {
  min-width: 72px; height: 32px; border-radius: var(--g2u-r-sm);
  background: var(--g2u-leaf); color: var(--g2u-white);
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
  font-family: var(--g2u-font-head); font-weight: 600; font-size: 13px;
}
.g2u-stepper button {
  color: var(--g2u-white); width: 22px; height: 100%; font-size: 16px;
  display: flex; align-items: center; justify-content: center; border-radius: var(--g2u-r-sm);
  transition: background-color .12s ease;
}
.g2u-stepper button:hover { background: rgba(255,255,255,.15); }
.g2u-stepper button:active { background: rgba(255,255,255,.3); }
.g2u-stepper button:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Chips ===== */
.g2u-chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
  border-radius: var(--g2u-r-pill); border: 1px solid var(--g2u-line);
  background: var(--g2u-white); color: var(--g2u-ink); font-size: 13px; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.g2u-chip:hover { border-color: var(--g2u-leaf); }
.g2u-chip.active { background: var(--g2u-forest); border-color: var(--g2u-forest); color: var(--g2u-white); }
.g2u-chip.active:hover { border-color: var(--g2u-forest); }
.g2u-chiprow { display: flex; gap: 8px; overflow-x: auto; padding: var(--g2u-s-2) 0; scrollbar-width: none; }
.g2u-chiprow::-webkit-scrollbar { display: none; }

/* ===== Badges ===== */
.g2u-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: 11px; font-weight: 700; font-family: var(--g2u-font-head);
  padding: 3px 8px; border-radius: var(--g2u-r-sm); color: var(--g2u-ink);
  background: var(--g2u-gold);
}
.g2u-badge.sold-out { background: var(--g2u-red); color: var(--g2u-white); }

/* ===== Product card ===== */
.g2u-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: var(--g2u-s-2) 0 90px;
}
.g2u-card {
  background: var(--g2u-white); border: 1px solid var(--g2u-line); border-radius: var(--g2u-r-md);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.g2u-card:hover { border-color: var(--g2u-leaf); box-shadow: 0 2px 10px rgba(11,93,30,.08); }
.g2u-card__photo { position: relative; aspect-ratio: 1/1; background: var(--g2u-cream); }
.g2u-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.g2u-card__body { padding: var(--g2u-s-2) var(--g2u-s-3) var(--g2u-s-3); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.g2u-card__weight {
  align-self: flex-start; font-size: 11px; color: var(--g2u-stone);
  border: 1px solid var(--g2u-line); border-radius: var(--g2u-r-pill); padding: 2px 8px;
}
.g2u-card__name {
  font-size: 13px; line-height: 17px; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 34px;
}
.g2u-card__priceRow { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.g2u-card__prices { display: flex; flex-direction: column; }

/* ===== Bottom sheet ===== */
.g2u-sheet-overlay {
  position: fixed; inset: 0; background: rgba(27,42,31,.5); z-index: 300;
  display: none; align-items: flex-end; justify-content: center;
}
.g2u-sheet-overlay.open { display: flex; }
.g2u-sheet {
  background: var(--g2u-white); width: 100%; max-width: var(--g2u-max-w);
  border-radius: var(--g2u-r-lg) var(--g2u-r-lg) 0 0;
  padding: var(--g2u-s-4); max-height: 80vh; overflow-y: auto;
  animation: g2u-sheet-up .22s ease;
  outline: none;
}
@keyframes g2u-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.g2u-sheet__handle { width: 36px; height: 4px; background: var(--g2u-line); border-radius: 2px; margin: 0 auto 12px; }
.g2u-sheet__title { font-family: var(--g2u-font-head); font-weight: 600; font-size: 16px; margin-bottom: 12px; }

/* ===== Misc ===== */
.g2u-radio {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--g2u-line);
  position: relative; flex-shrink: 0; transition: border-color .15s ease;
}
.g2u-radio.checked { border-color: var(--g2u-leaf); }
.g2u-radio.checked::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--g2u-leaf);
}

.g2u-divider { height: 1px; background: var(--g2u-line); margin: var(--g2u-s-4) 0; }

/* Base (mobile/tablet): the summary is just the next block in the stacked
   flow, separated with a divider. Laptop turns it into a sticky side card
   (see the 1024px block above). */
.g2u-cart-summary { border-top: 1px solid var(--g2u-line); margin-top: var(--g2u-s-4); padding-top: var(--g2u-s-4); }
.g2u-field { width: 100%; min-height: var(--g2u-tap); border: 1px solid var(--g2u-line); border-radius: var(--g2u-r-md); padding: 0 14px; background: var(--g2u-white); }
.g2u-field:focus { outline: none; border-color: var(--g2u-leaf); }
.g2u-label { font-size: 12px; color: var(--g2u-stone); margin-bottom: 4px; display: block; }
.g2u-error { color: var(--g2u-red); font-size: 12px; margin-top: 4px; }
.g2u-progress { height: 6px; background: var(--g2u-line); border-radius: var(--g2u-r-pill); overflow: hidden; }
.g2u-progress > div {
  height: 100%; width: 100%; background: var(--g2u-gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}

/* ===== Tablet (768px+) and laptop (1024px+) =====
   Mobile stays exactly as designed above this point — these only add
   rules, they never override mobile layout. Tablet gets its own column
   count rather than inheriting laptop's, since 768–1023px is too narrow
   for a 4-column grid or side-by-side product/cart layouts to breathe. */
@media (min-width: 768px) {
  .g2u-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .g2u-cartbar, .g2u-nav { max-width: var(--g2u-max-w); margin: 0 auto; }
  .g2u-nav { left: 0; right: 0; }

  /* Constrain the header's own content to the site grid — without this,
     the search bar and top row stretch edge-to-edge on wide viewports
     while every other section respects --g2u-max-w. */
  .g2u-header__top, .g2u-header__pincode, .g2u-search, .g2u-header--withback {
    max-width: var(--g2u-max-w);
    margin-left: auto;
    margin-right: auto;
  }

  /* Every fixed bottom bar across the app (product add-bar, cart total,
     address/payment continue-button) shares this full-bleed-by-default
     pattern. Centering them here, once, matches the nav/cart-bar fix above
     instead of patching each page's own inline <style> block separately. */
  .g2u-stickybar, .g2u-stickybtn, .g2u-stickytotal {
    max-width: var(--g2u-max-w);
    margin: 0 auto;
  }

  /* Narrow single-column forms (address, payment) — stretching inputs to
     the full 1180px grid is unusable; cap them to a comfortable form width. */
  .g2u-narrow-form {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1024px) {
  .g2u-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  /* Product page: gallery and buy-box sit side by side instead of the
     gallery stretching to the full page width at a 1:1 ratio (which made
     a single product photo ~1200px tall on a laptop screen). */
  .g2u-product-top {
    max-width: var(--g2u-max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(360px, 460px) 1fr;
    gap: 40px;
    align-items: start;
    padding-top: 24px;
  }
  .g2u-product-top .g2u-gallery {
    border-radius: var(--g2u-r-lg);
    position: sticky;
    top: calc(var(--g2u-header-h) + 16px);
  }
  .g2u-product-top .g2u-product-info {
    margin-top: 0 !important;
    padding-left: 0;
    padding-right: 0;
  }

  /* Cart: line items + cross-sell on the left, bill summary pinned on the
     right — a single stacked column wastes most of a laptop viewport. */
  .g2u-cart-layout {
    max-width: var(--g2u-max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    align-items: start;
  }
  .g2u-cart-layout .g2u-cart-summary {
    position: sticky;
    top: calc(var(--g2u-header-h) + 16px);
    background: var(--g2u-white);
    border: 1px solid var(--g2u-line);
    border-radius: var(--g2u-r-lg);
    padding: var(--g2u-s-4);
  }
}
