/* ===== tokens ===== */
:root {
  --blue: #2874f0;
  --blue-dark: #1a5fd0;
  --page: #f1f3f6;
  --text: #212121;
  --muted: #878787;
  --green: #388e3c;
  --gold: #ffe500;
  --footer: #172337;
  --footer-line: #454d5e;
  --line: #f0f0f0;
  --container: 1248px;
  --shadow-1: 0 1px 2px 0 rgba(0, 0, 0, .2);
  --shadow-2: 0 2px 8px 0 rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 14px/1.4 Roboto, Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
address { font-style: normal; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 8px; top: 8px; z-index: 200;
  background: #fff; color: var(--blue);
  padding: 8px 14px; border-radius: 2px;
  box-shadow: var(--shadow-2);
}

/* ===== header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-1);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 8px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand { padding: 0 12px 0 4px; }
.brand-name {
  display: block;
  font-size: 20px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -.2px;
  line-height: 1.1;
}
.brand-tagline {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-style: italic;
  color: #f0f0f0;
}
.brand-plus { color: var(--gold); font-weight: 500; }
.brand-star { width: 10px; height: 10px; fill: var(--gold); }

.search {
  flex: 1 1 auto;
  max-width: 564px;
  display: flex;
  align-items: center;
  height: 36px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.search-btn {
  display: flex;
  align-items: center;
  border: 0;
  background: none;
  padding: 0 8px 0 10px;
}
.search-btn svg { width: 20px; height: 20px; fill: var(--blue); }
.search-input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  padding-right: 12px;
  font-size: 14px;
  color: var(--text);
  background: none;
}
.search-input::placeholder { color: #9e9e9e; }
.search-input::-webkit-search-cancel-button { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: 12px;
  white-space: nowrap;
}
.header-link {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 0;
}
.caret { width: 18px; height: 18px; fill: #fff; transition: transform .2s; }
.menu-wrap:hover .caret,
.menu-wrap:focus-within .caret { transform: rotate(180deg); }
.cart-icon { width: 16px; height: 16px; filter: brightness(0) invert(1); }

.btn-login {
  width: 154px;
  height: 32px;
  border: 0;
  border-radius: 2px;
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
}

/* dropdowns */
.menu-wrap { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) scaleY(.96);
  transform-origin: top;
  min-width: 240px;
  background: #fff;
  color: var(--text);
  border-radius: 2px;
  box-shadow: var(--shadow-2);
  padding: 4px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s, transform .15s, visibility .15s;
}
.dropdown::before {
  content: "";
  position: absolute;
  top: -7px; left: 50%;
  margin-left: -7px;
  width: 14px; height: 14px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, .06);
}
.menu-wrap:hover .dropdown,
.menu-wrap:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scaleY(1);
}
.dropdown-cta {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
}
.dropdown-cta a { color: var(--blue); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.dropdown-item:last-child { border-bottom: 0; }
.dropdown-item:hover { background: #f5faff; color: var(--blue); }
.di-icon { width: 18px; text-align: center; }
.di-icon-img { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }

/* ===== category nav ===== */
.category-nav {
  background: #fff;
  box-shadow: var(--shadow-1);
}
.category-list {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 8px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}
.category-item { position: relative; }
.category-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px 8px;
  font-size: 14px;
  font-weight: 500;
}
.category-link img { width: 64px; height: 64px; object-fit: contain; }
.category-label { display: flex; align-items: center; gap: 2px; }
.category-label .caret { width: 16px; height: 16px; fill: var(--muted); }
.category-item:hover .category-link { color: var(--blue); }

.category-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  box-shadow: var(--shadow-2);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 90;
}
.category-item:hover .category-menu,
.category-item:focus-within .category-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.category-menu a {
  display: block;
  padding: 9px 18px;
  font-size: 14px;
}
.category-menu a:hover { background: #f5faff; color: var(--blue); }

/* ===== hero carousel ===== */
.hero {
  position: relative;
  max-width: var(--container);
  margin: 8px auto 0;
  background: #fff;
}
.hero-viewport { overflow: hidden; }
.hero-track {
  display: flex;
  transition: transform .45s cubic-bezier(.25, .8, .25, 1);
}
.hero-slide { min-width: 100%; }
.hero-slide img { width: 100%; height: 280px; object-fit: cover; }

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 74px;
  border: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
}
.hero-arrow svg { width: 26px; height: 26px; fill: currentColor; }
.hero-arrow:hover { color: var(--blue); }
.hero-arrow.prev { left: 0; border-radius: 0 4px 4px 0; }
.hero-arrow.next { right: 0; border-radius: 4px 0 0 4px; }

.hero-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.hero-dot {
  width: 9px; height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .22);
}
.hero-dot[aria-selected="true"] { background: var(--blue); }

/* ===== sections ===== */
.section {
  max-width: var(--container);
  margin: 8px auto 0;
  background: #fff;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 10px;
}
.section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}
.btn-viewall {
  border: 0;
  border-radius: 2px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .3px;
  padding: 9px 22px;
}
.btn-viewall:hover { background: var(--blue-dark); }

.tile-row {
  display: flex;
  gap: 4px;
  padding: 0 12px 22px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 0 12px 22px;
}

.tile {
  flex: 1 0 0;
  min-width: 152px;
  display: block;
  padding: 14px 10px 18px;
  text-align: center;
  border-radius: 2px;
  transition: box-shadow .2s;
}
.tile:hover { box-shadow: 0 0 10px rgba(0, 0, 0, .12); }
.tile-media {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.tile-media img { max-height: 150px; width: auto; }
.tile-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-offer {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--green);
}
.tile-brand {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ===== banners ===== */
.banner-pair {
  max-width: var(--container);
  margin: 8px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.banner-card, .wide-banner {
  display: block;
  background: #fff;
  overflow: hidden;
}
.banner-card img { width: 100%; height: 240px; object-fit: cover; }
.wide-banner {
  max-width: var(--container);
  margin: 8px auto 0;
}
.wide-banner img { width: 100%; height: 160px; object-fit: cover; }

/* ===== deals section ===== */
.deals { display: flex; align-items: stretch; }
.deals-aside {
  flex: 0 0 280px;
  padding: 26px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.deals-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.timer-icon { width: 16px; height: 16px; fill: var(--muted); }
.deals .tile-row { flex: 1; padding: 22px 12px; }

/* ===== footer ===== */
.site-footer {
  margin-top: 24px;
  background: var(--footer);
  color: #fff;
  font-size: 12px;
}
.footer-top {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 8px;
  display: flex;
  gap: 8px;
}
.footer-col { flex: 1 1 0; min-width: 0; }
.footer-head {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.footer-col li { margin-bottom: 10px; }
.footer-col a:hover { text-decoration: underline; }
.footer-address {
  flex: 1.6 1 0;
  padding-left: 20px;
  border-left: 1px solid var(--footer-line);
  line-height: 1.9;
}
.footer-address a { color: var(--blue); }
.social-head { margin: 18px 0 12px; }
.footer-social { display: flex; gap: 18px; }

.footer-bottom {
  border-top: 1px solid var(--footer-line);
}
.footer-bottom > * { }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 34px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 8px 26px;
}
.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
}
.footer-bottom-links a { display: flex; align-items: center; gap: 6px; }
.fb-icon { color: var(--gold); }
.footer-copy { margin: 0; }
.pay-chips {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.pay-chips li {
  background: #fff;
  color: #333;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 7px;
  border-radius: 2px;
}

/* ===== responsive ===== */
@media (max-width: 1100px) {
  .tile-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-top { flex-wrap: wrap; }
  .footer-col { flex: 1 1 180px; }
  .footer-address { flex: 1 1 320px; border-left: 0; padding-left: 0; }
}

@media (max-width: 820px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 8px; gap: 8px; }
  .search { order: 3; max-width: 100%; flex-basis: 100%; }
  .header-actions { gap: 16px; margin-left: auto; }
  .header-link, .btn-login { font-size: 13px; }
  .btn-login { width: auto; padding: 0 18px; }
  .category-list { overflow-x: auto; justify-content: flex-start; }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .banner-pair { grid-template-columns: 1fr; }
  .deals { flex-direction: column; }
  .deals-aside { flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-slide img { height: 180px; }

  /* Dropdowns — anchor to the LEFT edge of the trigger button so the
     panel appears to "hang" from the button. max-width caps it inside
     the viewport so it never overflows on narrow phones. */
  .dropdown {
    left: 0;
    right: auto;
    transform: translateX(0) scaleY(.96);
    min-width: 200px;
    max-width: calc(100vw - 16px);
  }
  .menu-wrap:hover .dropdown,
  .menu-wrap:focus-within .dropdown {
    transform: translateX(0) scaleY(1);
  }
  .dropdown::before {
    left: 18px;
    right: auto;
    margin-left: 0;
  }
}

/* Right-side triggers (Cart-like) — keep dropdown within viewport by
   anchoring to the right edge instead of letting it overflow. */
@media (max-width: 820px) {
  .menu-wrap.dropdown-right .dropdown,
  .header-actions > .menu-wrap:last-child .dropdown {
    left: auto;
    right: 0;
  }
  .menu-wrap.dropdown-right .dropdown::before,
  .header-actions > .menu-wrap:last-child .dropdown::before {
    left: auto;
    right: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ============================================================
   Flipkart-style mobile shell — applied at <= 820px.
   ============================================================ */

/* Mobile top bar — hidden on desktop */
.m-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--blue);
  padding: 8px 10px;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.m-topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--muted);
  border: 0;
  border-radius: 4px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.m-topbar-search span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-topbar-search svg { width: 18px; height: 18px; fill: var(--muted); flex-shrink: 0; }
.m-topbar-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  color: #fff;
}
.m-topbar-cart svg { width: 22px; height: 22px; fill: #fff; }
.m-topbar-cart .m-cart-icon { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.m-topbar-cart-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff6161;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Search overlay (full-screen search on mobile) */
.m-search-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 200;
  display: none;
  flex-direction: column;
}
.m-search-overlay.open { display: flex; }
.m-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  padding: 8px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.m-search-back,
.m-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
}
.m-search-back:hover,
.m-search-submit:hover { background: rgba(255,255,255,.15); }
.m-search-back svg,
.m-search-submit svg { width: 22px; height: 22px; fill: #fff; }
.m-search-input {
  flex: 1;
  height: 40px;
  border: 0;
  outline: 0;
  border-radius: 4px;
  background: #fff;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
}

/* Bottom tab nav */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
  padding: 4px 0 max(4px, env(safe-area-inset-bottom));
}
.bn-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  position: relative;
  transition: color .15s;
}
.bn-tab svg { width: 22px; height: 22px; fill: currentColor; }
.bn-tab .bn-icon { width: 22px; height: 22px; }
.bn-tab.is-active { color: var(--blue); font-weight: 600; }
.bn-tab.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 32px;
  height: 3px;
  background: var(--blue);
  transform: translateX(-50%);
  border-radius: 0 0 2px 2px;
}
.bn-tab .bn-label { line-height: 1.1; }
.bn-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  margin-right: -18px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff6161;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 820px) {
  /* Show mobile shell */
  .m-topbar { display: flex; }
  .bottom-nav { display: flex; }
  /* Hide desktop header chrome */
  .site-header { display: none; }
  /* Reserve space for sticky bottom nav */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  /* Page content goes edge-to-edge on mobile */
  main, .container, .page, .account-main, .checkout-main { padding-left: 0 !important; padding-right: 0 !important; }

  /* Category nav still useful, make it horizontally scrollable chips */
  .category-nav { box-shadow: none; border-bottom: 1px solid var(--line); }
  .category-list { padding: 8px 10px; gap: 16px; }
  .category-list a { font-size: 13px; }

  /* Hero full-bleed */
  .hero { border-radius: 0; margin-bottom: 8px; }
  .hero-slide img { height: 200px; object-fit: cover; }
  .hero-arrow { display: none; }
  .hero-dots { bottom: 8px; }
}

/* ============================================================
   Flipkart-style home page sections
   ============================================================ */

/* Circular category icon grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #fff;
  padding: 10px 6px 12px;
  margin-bottom: 8px;
}
.cat-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--text);
  text-align: center;
}
.cat-grid-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f0f3f8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--blue);
  flex-shrink: 0;
}
.cat-grid-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.cat-grid-label {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.2;
  max-width: 80px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cat-grid-discount {
  font-size: 10px;
  color: #2e7d32;
  font-weight: 600;
}

/* Flipkart-style product card — works on both desktop and mobile */
.tile {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  position: relative;
}
.tile-media {
  position: relative;
  background: #f5f7fa;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.tile-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}
.tile-owned-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #ff6161;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.tile-body {
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tile-discount-badge {
  display: inline-block;
  background: #2e7d32;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  align-self: flex-start;
  margin-bottom: 2px;
}
.tile-title {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.5em;
}
.tile-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.tile-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.tile-mrp {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
}
.tile-offer { display: none; }
.tile-brand {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.tile-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #2e7d32;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  align-self: flex-start;
  margin-top: 4px;
}

/* Horizontal scroll row */
.tile-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 12px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.tile-row .tile {
  flex: 0 0 130px;
  scroll-snap-align: start;
}
.tile-row .tile-body { padding: 6px 8px 8px; }
.tile-row .tile-title { font-size: 12px; }
.tile-row .tile-price { font-size: 13px; }
@media (min-width: 821px) {
  .tile-row .tile { flex: 0 0 180px; }
}

/* Empty-state hint */
.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  margin-bottom: 8px;
}
.empty .empty-icon { font-size: 40px; margin-bottom: 8px; }

/* ============================================================
   Phase 3 — Products list mobile
   ============================================================ */
@media (max-width: 820px) {
  .list-layout { display: block; }
  .crumbs {
    padding: 10px 12px;
    font-size: 12px;
    background: #fff;
    margin-bottom: 6px;
  }
  /* Sticky toolbar above the grid */
  .list-toolbar {
    position: sticky;
    top: 56px;          /* sit just below mobile topbar */
    z-index: 50;
    background: #fff;
    padding: 8px 12px !important;
    margin: 0 0 8px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    flex-direction: row !important;
    gap: 8px !important;
  }
  .list-toolbar .count {
    flex: 1;
    font-size: 12px;
    text-align: left !important;
  }
  .list-toolbar select { font-size: 13px; padding: 5px 8px; }

  /* Filter rail becomes a bottom sheet on mobile */
  .filter-rail {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 110;
    display: none;
    align-items: flex-end;
    justify-content: center;
  }
  .filter-rail.open { display: flex; }
  .filter-rail-inner {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    padding: 16px;
  }
  .filter-rail h3 { display: none; }   /* hide on mobile, the sheet title is enough */
  .filter-rail ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .filter-rail ul li a {
    display: block;
    padding: 10px 12px;
    background: #f5f7fa;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    border: 1.5px solid transparent;
    text-align: center;
  }
  .filter-rail ul li a.is-active {
    background: #e3f2fd;
    border-color: var(--blue);
    color: var(--blue);
    font-weight: 600;
  }
  /* Mobile-only filter trigger in toolbar */
  .m-filter-btn {
    border: 1px solid #d8dde4;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .m-filter-btn svg { width: 14px; height: 14px; fill: currentColor; }

  /* Grid as 2-col */
  .list-grid { padding: 0 8px; }

  /* Pager */
  .pager { padding: 12px; gap: 6px; }
  .pager button { flex: 1; }
}

/* ============================================================
   Phase 4 — Product detail mobile (sticky bottom CTA)
   ============================================================ */
@media (max-width: 820px) {
  .pdp-layout { display: block !important; gap: 0 !important; }
  .pdp-media { padding: 0; background: #fff; margin-bottom: 8px; }
  .pdp-info {
    padding: 12px !important;
    margin: 0 0 8px !important;
  }
  .pdp-title { font-size: 17px !important; }
  .pdp-price-row { font-size: 20px !important; }
  .pdp-actions {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    background: #fff;
    padding: 10px 12px;
    margin: 0 -8px;
    box-shadow: 0 -2px 6px rgba(0,0,0,.08);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pdp-actions .btn-add-cart,
  .pdp-actions .btn-buy-now {
    width: 100% !important;
    padding: 12px 0 !important;
    font-size: 14px !important;
  }
}

/* ============================================================
   Phase 5 — Cart + Checkout mobile
   ============================================================ */
@media (max-width: 820px) {
  .cart-page { padding: 0 !important; }
  .cart-item {
    display: grid !important;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    padding: 12px !important;
    margin: 0 0 6px !important;
    border-radius: 0 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.05) !important;
  }
  .cart-item .ci-media { grid-row: span 3; }
  .cart-item .ci-media img { width: 80px; height: 80px; object-fit: contain; }
  .cart-summary {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    background: #fff;
    padding: 12px !important;
    margin: 0 !important;
    box-shadow: 0 -2px 6px rgba(0,0,0,.08);
  }
  .cart-summary .btn-primary { width: 100%; padding: 12px 0; font-size: 15px; }

  .checkout-page { padding: 0 !important; }
  .checkout-step { padding: 12px !important; margin: 0 0 6px !important; border-radius: 0 !important; }
  .checkout-actions {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    background: #fff;
    padding: 12px !important;
    margin: 0 !important;
    box-shadow: 0 -2px 6px rgba(0,0,0,.08);
    display: grid;
    gap: 6px;
  }
  .checkout-actions .btn-primary { width: 100%; padding: 12px 0; font-size: 15px; }
}
