/* =====================================================================
   STOREFRONT STYLES
   Mobile-first: these rules are for phones; @media rules add space for
   bigger screens. Most shoppers in Nepal browse on phones.

   THEME: every colour comes from these variables. A shop's own colour
   (--brand) is set from the database, so one stylesheet fits every shop.
   ===================================================================== */

:root {
  --brand: #8b1e2d;                                   /* replaced by the shop's colour */
  --brand-dark: color-mix(in srgb, var(--brand) 70%, black);
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
  --ink: #22262e;          /* text */
  --ink-soft: #5b6270;     /* secondary text */
  --paper: #ffffff;
  --mist: #eef1f4;         /* behind photos, quiet surfaces */
  --sky: #2f4a6d;          /* Himalayan blue: secondary accent */
  --warn: #c2410c;         /* "only 2 left" */
  --line: #e3e6ea;

  --font: "Mukta", system-ui, sans-serif;
  --step-0: 0.95rem;   /* small text */
  --step-1: 1.0625rem; /* body */
  --step-2: 1.25rem;   /* section headings */
  --step-3: 1.6rem;    /* product sheet title */
  --step-4: clamp(2.3rem, 9vw, 3.6rem);   /* shop name */

  --radius-photo: 10px;
  --radius-button: 8px;
  --gap: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
body.no-scroll { overflow: hidden; }

img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Visible focus for keyboard users (never removed, only styled) */
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

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


/* ---------- Banner (the one bold element) ---------- */

.hero {
  position: relative;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: white;
  background-color: var(--brand);
  /* 22 Nov (Batch C): a clean, soft gradient in the shop's own colour (like Shopify's default
     theme) instead of the dhaka diamond pattern, which looked dated and not like the shop.
     A light glow top-right + a deeper shade bottom-left give depth without a picture. */
  background-image:
    radial-gradient(120% 90% at 90% 0%, color-mix(in srgb, var(--brand) 55%, white) 0%, transparent 60%),
    radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--brand) 70%, black) 0%, transparent 70%),
    linear-gradient(160deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 85%, black) 100%);
}
.hero.has-photo { background-image: none; }

.hero-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Darkens the bottom of the photo so the shop name is always readable */
.hero.has-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,.05) 65%);
}

.hero-text {
  position: relative; z-index: 1;
  width: 100%; max-width: 1100px; margin: 0 auto;
  padding: 48px var(--gap) 22px;
}
.shop-name {
  margin: 0;
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.shop-tagline {
  margin: 8px 0 0;
  font-size: var(--step-1);
  max-width: 34ch;
  opacity: 0.92;
}
/* 📞 Call / WhatsApp / Viber (039): small pills on the banner, also used on the order page */
.shop-contact { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.contact-link {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.92); color: #1d2733; text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
}
.contact-link.whatsapp { background: #25d366; color: #fff; }
.contact-link.viber    { background: #7360f2; color: #fff; }


/* ---------- Search + categories (sticky) ---------- */

.finder {
  position: sticky; top: 0; z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.finder-top {
  display: flex; align-items: center; gap: 12px;
  max-width: 1100px; margin: 0 auto;
  padding: 10px var(--gap) 6px;
}
.bar-shop-name { display: none; font-weight: 800; white-space: nowrap; color: var(--brand); }
@media (min-width: 700px) { .bar-shop-name { display: block; } }

.search { flex: 1; }
.search input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  font-size: 1rem;                 /* 16px+ stops iPhones zooming in */
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  background: var(--mist)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235b6270' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E")
    no-repeat 13px 50%;
}
.search input:focus { background-color: var(--paper); border-color: var(--sky); }

.category-tabs {
  display: flex; gap: 4px;
  max-width: 1100px; margin: 0 auto;
  padding: 0 var(--gap);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  flex-shrink: 0;
  padding: 8px 10px 10px;
  border: none; background: none;
  border-bottom: 3px solid transparent;
  color: var(--ink-soft);
  font-size: var(--step-0);
  font-weight: 600;
}
.category-tab[aria-pressed="true"] { color: var(--brand); border-bottom-color: var(--brand); }


/* ---------- Page sections ---------- */

main {
  max-width: 1100px; margin: 0 auto;
  padding: 8px var(--gap) 40px;
}
.status { color: var(--ink-soft); padding: 24px 0; }

.section-heading {
  margin: 24px 0 12px;
  font-size: var(--step-2);
  font-weight: 800;
  scroll-margin-top: 120px;        /* lands below the sticky search bar */
}


/* ---------- Product card (grid) ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
}
@media (min-width: 700px)  { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 22px; } }
@media (min-width: 1000px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.product-card, .pick-card { display: flex; flex-direction: column; }

.card-open {
  display: flex; flex-direction: column;
  padding: 0; border: none; background: none;
  text-align: left;
}

.product-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-photo);
  background: var(--mist);
  overflow: hidden;
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo {
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; font-weight: 800;
  color: color-mix(in srgb, var(--brand) 45%, var(--mist));
}

.product-name {
  margin: 10px 0 0;
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.25;
}
.product-price { margin: 2px 0 0; font-weight: 800; }
.stock-note { margin: 2px 0 0; min-height: 1.4em; font-size: var(--step-0); color: var(--warn); }

.stock-tag {
  position: absolute; left: 8px; bottom: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--warn);
  font-size: 0.85rem; font-weight: 600;
}
.sold-out .product-photo img, .sold-out .no-photo { filter: grayscale(1); }
.sold-out .product-photo img { opacity: 0.55; }
.sold-out .stock-tag { color: var(--ink-soft); }
.sold-out .stock-note { color: var(--ink-soft); }

/* Cards in a row line up: the button always sits at the bottom */
.card-open { flex: 1; }

.add-button {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-button);
  background: var(--paper);
  color: var(--brand);
  font-weight: 600;
}
.add-button:hover:not(:disabled) { background: var(--brand-soft); }
.add-button:disabled { border-color: var(--line); color: var(--ink-soft); cursor: not-allowed; }


/* ---------- Shop favourites (sideways row) ---------- */

.picks-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 44%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gap);   /* snapping keeps the side margin */
  margin: 0 calc(-1 * var(--gap));
  padding: 0 var(--gap) 6px;
  scrollbar-width: none;
}
.picks-row::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .picks-row { grid-auto-columns: 32%; } }
@media (min-width: 1000px) { .picks-row { grid-auto-columns: 24%; } }

.pick-card { scroll-snap-align: start; }
.pick-card .product-photo { aspect-ratio: 4 / 5; }
.pick-card .add-button { background: var(--brand); color: white; }
.pick-card .add-button:hover:not(:disabled) { background: var(--brand-dark); }


/* ---------- Empty search ---------- */

.empty-state { padding: 20px 0; color: var(--ink-soft); }
.empty-state p { margin: 0 0 12px; max-width: 40ch; }


/* ---------- Footer ---------- */

.site-footer {
  background: var(--mist);
  padding: 28px var(--gap) 110px;   /* bottom room: the cart bar never covers it */
}
.site-footer h2 { max-width: 1100px; margin: 0 auto 10px; font-size: var(--step-2); }
.how-steps {
  max-width: 1100px; margin: 0 auto;
  padding-left: 1.3em;
  color: var(--ink-soft);
}
.how-steps li { margin-bottom: 4px; max-width: 60ch; }
/* Developer credit: every customer sees it at the end of the page,
   separated by a line, but it stays smaller than the shop's own content */
.credit {
  max-width: 1100px; margin: 24px auto 0; padding-top: 16px;
  border-top: 1px solid #d5dae1;
  text-align: center;
  font-size: var(--step-0); font-weight: 600; color: var(--ink-soft);
}


/* "Get the app" + "Share this shop" in the footer */
.footer-actions {
  max-width: 1100px; margin: 20px auto 0;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.share-message { max-width: 1100px; margin: 8px auto 0; color: var(--ink-soft); font-size: var(--step-0); }
.share-message:empty { display: none; }


/* ---------- Install bar (top of the page) ----------
   Small and calm on purpose: the banner stays the one bold thing on the page. */

.install-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--gap);
  background: var(--brand-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 20%, white);
}
.install-bar[hidden] { display: none; }
.install-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.install-ios { color: var(--ink-soft); font-size: var(--step-0); }
.ios-share { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--ink); }
.ios-share svg { vertical-align: -2px; }
.install-button {
  padding: 8px 18px; border: none; border-radius: var(--radius-button);
  background: var(--brand); color: white; font-weight: 600; white-space: nowrap;
}
.install-button:hover { background: var(--brand-dark); }
.install-close {
  width: 36px; height: 36px; flex-shrink: 0;
  border: none; background: transparent; color: var(--ink-soft); font-size: 1rem; border-radius: 50%;
}


/* "← Subidha" over the banner (only when the customer came from Subidha) */
.market-back {
  position: absolute; z-index: 2;
  top: calc(12px + env(safe-area-inset-top)); left: var(--gap);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 600; font-size: var(--step-0);
  text-decoration: none;
}

/* "You also have items from 1 other shop. Check out all shops together" */
.other-shops-note {
  margin: 0 0 12px; padding: 10px 12px;
  border-radius: var(--radius-button);
  background: #eef3f9; color: var(--ink); font-size: var(--step-0);
}
.other-shops-note a { color: var(--sky); font-weight: 600; }

/* "Closed · opens 7:00 AM": calm, not alarming */
.hours-strip {
  margin: 0; padding: 8px var(--gap);
  background: #fff7ed; color: #7c2d12;
  font-size: var(--step-0); text-align: center;
}


/* ---------- Buttons ---------- */

.primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-button);
  background: var(--brand);
  color: white;
  font-weight: 600;
  font-size: 1.05rem;
}
.primary:hover:not(:disabled) { background: var(--brand-dark); }
.primary:disabled { opacity: 0.6; cursor: wait; }

.secondary {
  padding: 10px 16px;
  border: 1.5px solid var(--ink-soft);
  border-radius: var(--radius-button);
  background: var(--paper);
  font-weight: 600;
}

/* Looks like a link, acts like a button (e.g. "Remove" next to the shared location) */
.link-button {
  padding: 0; border: none; background: none;
  color: var(--sky); font: inherit; text-decoration: underline;
}

/* ---------- Share my location ---------- */
.location-share { margin: 2px 0 14px; }
.location-share .secondary { width: 100%; }
.location-status { margin: 6px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.location-status.ok    { color: #15803d; }
.location-status.warn  { color: var(--warn); }
.location-status.error { color: #b91c1c; }
.location-status a { color: var(--sky); }

.close-button {
  width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: var(--mist);
  font-size: 1.1rem;
}


/* ---------- Cart bar ---------- */

.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));   /* iPhone home-bar gap */
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.cart-bar button {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 14px 18px;
  border: none; border-radius: var(--radius-button);
  background: var(--brand); color: white;
  font-weight: 600; font-size: 1.05rem;
}


/* ---------- Sheets: product details and cart ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 24, 31, 0.5);
}
.sheet {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-radius: 16px 16px 0 0;
  animation: sheet-up 0.22s ease-out;     /* answers the tap: shows where it came from */
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 16px; }
}

/* Product sheet */
#close-product { position: absolute; top: 12px; right: 12px; z-index: 1; }
.sheet-photo {
  aspect-ratio: 1 / 1;
  margin: -16px -16px 0;
  background: var(--mist);
  overflow: hidden;
}
.sheet-photo img { width: 100%; height: 100%; object-fit: cover; }
.sheet-photo.no-photo { font-size: 5rem; }
.sheet-name { margin: 16px 0 0; font-size: var(--step-3); font-weight: 800; line-height: 1.1; }
.sheet-price { margin: 4px 0 0; font-size: var(--step-2); font-weight: 800; }
.sheet-description { margin: 10px 0 18px; color: var(--ink-soft); max-width: 60ch; }
.product-sheet-body .add-button.primary { margin-top: 12px; }

/* Cart */
.cart-header { display: flex; justify-content: space-between; align-items: center; }
.cart-header h2 { margin: 0; font-size: var(--step-2); font-weight: 800; }

.cart-line {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.cart-line-name { font-weight: 600; }
.cart-line-price { font-size: var(--step-0); color: var(--ink-soft); }
.qty { display: flex; align-items: center; gap: 10px; }
.qty button {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--paper); font-size: 1.15rem;
}
.qty button:disabled { opacity: 0.35; cursor: not-allowed; }

.cart-total-line {
  display: flex; justify-content: space-between;
  margin: 14px 0; font-size: var(--step-2);
}

#checkout-form h3 { margin: 22px 0 10px; font-size: var(--step-1); font-weight: 800; }
#checkout-form label { display: block; margin-bottom: 12px; font-size: var(--step-0); color: var(--ink-soft); }
#checkout-form input, #checkout-form textarea {
  display: block; width: 100%; margin-top: 4px;
  padding: 12px; font-size: 1rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-button);
}
#checkout-form input:focus, #checkout-form textarea:focus {
  border-color: var(--sky); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 25%, transparent);
}

.cod-note {
  padding: 12px; margin: 4px 0 14px;
  border-left: 4px solid var(--sky);
  background: var(--mist);
  font-size: var(--step-0);
}

.message { min-height: 1.3em; margin: 8px 0 0; font-size: var(--step-0); }
.message.error { color: #b91c1c; }

.order-done { text-align: center; padding: 10px 0 4px; }
.done-icon {
  width: 64px; height: 64px; margin: 8px auto 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand); color: white;
  font-size: 2rem; font-weight: 800;
}
.order-done h3 { font-size: var(--step-3); margin: 12px 0 6px; }
.order-done p { max-width: 40ch; margin: 6px auto; }
.order-done .primary { margin-top: 16px; }


/* ---------- Payment choice + QR ---------- */

.payment-choice { border: none; padding: 0; margin: 6px 0 12px; }
.payment-choice legend { font-weight: 800; margin-bottom: 8px; padding: 0; }
.pay-option {
  display: flex !important; gap: 12px; align-items: flex-start;
  padding: 12px; margin-bottom: 8px !important;
  border: 1.5px solid var(--line); border-radius: var(--radius-button);
  color: var(--ink) !important; cursor: pointer;
}
/* the card rule above says display:flex !important, which beat [hidden]: a switched-off choice
   (courier, QR) still showed at checkout (found 22 Nov). Hidden must win. */
.pay-option[hidden] { display: none !important; }
.owner-bar.private { background: #fff4d6; color: #5a4300; }
/* fix list #12: the link was yellow-on-yellow. Now a dark button-like link that's easy to read and tap */
.owner-bar.private a {
  display: inline-block; margin-left: 6px; padding: 6px 12px; min-height: 32px;
  background: #5a4300; color: #fff !important; border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.pay-option input { width: 20px !important; height: 20px; margin: 2px 0 0 !important; accent-color: var(--brand); flex-shrink: 0; }
.pay-option span { font-size: var(--step-0); line-height: 1.35; color: var(--ink-soft); }
.pay-option strong { color: var(--ink); font-size: var(--step-1); }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

.qr-box {
  margin: 4px 0 14px; padding: 14px;
  border: 1.5px solid var(--sky); border-radius: var(--radius-button);
  text-align: center;
}
.qr-step { margin: 0 0 10px; font-size: var(--step-1); }
.qr-image { width: min(240px, 80%); margin: 0 auto; border-radius: 6px; background: white; }
.qr-instructions { margin: 10px 0 0; font-size: var(--step-0); color: var(--ink-soft); }
.qr-box label { text-align: left; margin-top: 14px !important; }
.qr-after { margin: 4px 0 0; font-size: var(--step-0); color: var(--ink-soft); text-align: left; }
.qr-same-phone { margin: 10px 0 0; font-size: var(--step-0); color: var(--ink-soft); }
.qr-same-phone a { color: var(--sky); font-weight: 600; }


/* ---------- Delivery charge ---------- */
.delivery-strip {
  margin: 0; padding: 9px var(--gap);
  background: var(--mist); color: var(--ink);
  font-size: var(--step-0); font-weight: 600; text-align: center;
}
.cart-totals { margin: 12px 0; }
.cart-sub-line {
  display: flex; justify-content: space-between;
  margin: 4px 0; color: var(--ink-soft);
}
.cart-totals .cart-total-line { margin: 8px 0 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.free-delivery-hint { margin: 0; font-size: var(--step-0); color: var(--sky); font-weight: 600; }
.sheet-delivery { margin: 12px 0 0; font-size: var(--step-0); color: var(--ink-soft); }
.qty-kg { min-width: 4.2em; text-align: center; }


/* ---------- Kg picker ---------- */
.kg-picker { margin-top: 14px; }
.kg-modes {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 3px; border-radius: var(--radius-button); background: var(--mist);
}
.kg-modes button {
  padding: 9px; border: none; border-radius: 6px; background: none;
  font-weight: 600; color: var(--ink-soft);
}
.kg-modes button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.kg-weight { margin-top: 14px; }
.kg-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; }
.kg-step {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--paper); font-size: 1.5rem;
}
.kg-step:disabled { opacity: .35; cursor: not-allowed; }
.kg-value { min-width: 6ch; text-align: center; font-size: var(--step-3); font-weight: 800; }
.kg-quick { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.kg-quick button {
  padding: 7px 12px; border-radius: var(--radius-button);
  border: 1.5px solid var(--line); background: var(--paper); font-weight: 600;
}

.kg-price { display: block; margin-top: 14px; font-size: var(--step-0); color: var(--ink-soft); }
.kg-price input {
  display: block; width: 100%; margin-top: 6px; padding: 12px;
  font-size: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-button);
}
.kg-summary { margin: 14px 0 10px; font-size: var(--step-1); font-weight: 600; text-align: center; min-height: 1.5em; }
.kg-note { margin: 8px 0 0; font-size: var(--step-0); color: var(--ink-soft); text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Editable cart lines: type the quantity OR the price ---------- */
.cart-line { display: block; }
.cart-line-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cart-line .qty { gap: 6px; flex-wrap: wrap; }
.qty-input, .price-input {
  height: 38px; padding: 0 6px;
  border: 1.5px solid var(--line); border-radius: var(--radius-button);
  font-size: 1rem; text-align: center; color: var(--ink);
  -moz-appearance: textfield;
}
.qty-input { width: 4.2em; }
.price-input { width: 5.6em; text-align: right; border: none; padding-left: 2px; }
.qty-input::-webkit-inner-spin-button, .price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus, .price-input:focus { outline: 2px solid var(--sky); outline-offset: 1px; }
.qty-unit { min-width: 1.2em; color: var(--ink-soft); }
.qty-equals { margin: 0 2px 0 6px; color: var(--ink-soft); }
.price-input-wrap {
  display: inline-flex; align-items: center; margin-left: auto;
  padding-left: 8px; border: 1.5px solid var(--line); border-radius: var(--radius-button);
  font-weight: 600;
}
.price-input-wrap:focus-within { border-color: var(--sky); }
.cart-line-about { margin: 6px 0 0; font-size: var(--step-0); color: var(--ink-soft); }
.cart-line-note { margin: 6px 0 0; font-size: var(--step-0); color: var(--sky); }

/* Two cards side by side on wide screens, stacked on phones */
.explore-row {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin: 32px 0 0; max-width: 1000px;
}
@media (min-width: 700px) { .explore-row { grid-template-columns: 1fr 1fr; } }

/* "Explore local shops" / "Explore items" → Subidha home. In Subidha's blue (--sky), not the
   shop's colour, so customers see it's the marketplace, not part of this shop */
.explore-more {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-photo);
  background: var(--mist); color: var(--ink); text-decoration: none;
}
.explore-more:hover, .explore-more:focus-visible { border-color: var(--sky); }
.explore-icon { font-size: 1.6rem; line-height: 1; }
.explore-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.explore-text strong { color: var(--sky); font-weight: 600; }
.explore-text span { color: var(--ink-soft); font-size: var(--step-0); }
.explore-arrow { color: var(--sky); font-size: 1.3rem; font-weight: 600; }
.explore-after-order {
  display: inline-block; margin: 14px 8px 0; padding: 6px 4px;
  color: var(--sky); font-weight: 600; text-decoration: none;
}

/* ---------- Phase 3: remembered details + tracking (my-orders.js) ---------- */
.clear-details {
  display: block; margin: 0 0 6px auto; padding: 4px 0;
  border: none; background: none; color: var(--ink-soft);
  font-size: var(--step-0); text-decoration: underline; cursor: pointer;
}
.track-button { display: block; text-align: center; text-decoration: none; margin: 14px 0 8px; }
.track-link { color: var(--sky); font-weight: 600; white-space: nowrap; }


/* "Sell on Subidha" link in every shop's footer */
.sell-link { display: block; max-width: 1100px; margin: 18px auto 0; text-align: center; font-size: var(--step-0); color: var(--ink-soft); }
.sell-link a { color: var(--sky); font-weight: 600; }

/* Seller-first (21 Nov): Subidha is a small line at the bottom of each shop's own website */
.powered-by { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin: 28px 0 8px;
  font-size: var(--step-0); color: var(--ink-soft); text-align: center; }
.powered-by a { color: var(--ink-soft); text-decoration: underline; }
.save-tip { margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; background: #f0f9ff; color: var(--ink-soft); font-size: var(--step-0); text-align: left; }

/* 👋 Owner viewing their own shop (js/app.js showOwnerBar) */
.owner-bar { background: #1d2733; color: #fff; text-align: center; padding: 8px 10px; font-size: 0.95rem; }
.owner-bar a { color: #ffd166; font-weight: 700; }

/* Phase 4 checkout: contact choice */
.contact-choice { border: 0; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.contact-choice legend { font-weight: 600; margin-bottom: 4px; width: 100%; }
.contact-choice label { display: flex; align-items: center; gap: 6px; }
.contact-choice input { width: auto; }

/* 📜 Business details + policy links (049): shop footer, /policy/, order receipt */
.shop-legal { margin: 8px auto 20px; max-width: 640px; font-size: 0.85rem; color: var(--ink-soft);
              text-align: center; line-height: 1.5; }
.shop-legal p { margin: 2px 0; }
.shop-legal-links { margin-top: 8px !important; }
.shop-legal a, .checkout-consent a { color: var(--ink-soft); text-decoration: underline; }
.checkout-consent { font-size: 0.8rem; color: var(--ink-soft); margin: 8px 0 0; text-align: center; }
.policy-for { margin: 4px 0 0; opacity: 0.9; }
.policy-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 14px; }
.policy-nav a { color: var(--brand); font-weight: 600; }
.policy-nav a[aria-current="page"] { text-decoration: none; color: var(--ink); }
.policy-body h2 { font-size: 1.1rem; margin: 20px 0 6px; }
.policy-body p, .policy-body li { line-height: 1.55; }
.policy-page .shop-legal { text-align: left; border-top: 1px solid var(--line, #ddd); padding-top: 12px; }
.policy-page .shop-legal h2 { font-size: 1rem; color: var(--ink); }

/* 🧾 Order receipt (049): printable */
.receipt { border: 1px dashed #999; border-radius: 10px; padding: 14px; margin: 16px 0; background: #fff; }
.receipt h2 { margin: 0 0 6px; font-size: 1.1rem; }
.receipt .shop-legal { text-align: left; margin: 0 0 10px; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.receipt td { padding: 3px 0; vertical-align: top; }
.receipt td:last-child { text-align: right; white-space: nowrap; }
.receipt .receipt-total td { border-top: 1px solid #999; font-weight: 800; }
.receipt-note { font-size: 0.8rem; color: var(--ink-soft); margin-top: 10px; }
@media print {
  body.printing-receipt * { visibility: hidden; }
  body.printing-receipt .receipt, body.printing-receipt .receipt * { visibility: visible; }
  body.printing-receipt .receipt { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
  body.printing-receipt .receipt button { display: none; }
}
/* 051: old policy version banner + earlier versions list */
.policy-old { background: #fff6dd; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 10px; }
.policy-versions { margin-top: 24px; font-size: 0.9rem; color: var(--ink-soft); }
.policy-versions p { margin: 4px 0; }
.receipt-check { display: flex; gap: 12px; align-items: center; margin-top: 10px; font-size: 0.85rem; }
.receipt-check canvas { width: 96px; height: 96px; flex: none; }
.receipt-links { font-size: 0.85rem; margin-top: 8px; }
.receipt-links a { color: var(--ink-soft); }
/* 📣 Complaints (052): order page, Shop Admin, control room */
.complaint-box { margin: 18px 0; }
.complaint-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: #fff; }
.complaint-status { font-weight: 800; margin: 0 0 6px; }
.complaint-thread { display: grid; gap: 6px; }
.complaint-msg { margin: 0; padding: 6px 8px; border-radius: 8px; background: #f3f4f6; line-height: 1.45; }
.complaint-msg.from-buyer { background: #eef6ff; }
.complaint-msg.from-subidha { background: #fff6dd; }
.complaint-form { display: grid; gap: 8px; margin-top: 10px; }
/* fix list #13: fields stack under their label, never spill past the edge, big enough to tap */
.complaint-form .field { display: grid; gap: 4px; font-weight: 600; color: var(--ink); }
.complaint-form textarea, .complaint-form select {
  width: 100%; max-width: 100%; box-sizing: border-box;
  min-height: 44px; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1.5px solid var(--line); border-radius: var(--radius-button, 10px); background: #fff; color: var(--ink);
}
.complaint-form textarea { resize: vertical; }
.complaint-form select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft, #555) 50%), linear-gradient(135deg, var(--ink-soft, #555) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.complaint-form textarea:focus, .complaint-form select:focus { outline: none; border-color: var(--brand); }
.photo-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.photo-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-pick-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--brand); border-radius: 999px; color: var(--brand); font-weight: 600; background: #fff; }
.photo-pick:focus-within .photo-pick-btn { box-shadow: 0 0 0 3px var(--brand-soft, #e6f0ea); }
.photo-pick-info { color: var(--ink-soft); font-size: 0.9em; }
/* ⭐ Ratings + 🚩 Report (055) */
.shop-reviews, .review-box { margin: 20px auto; max-width: 640px; }
.review-card { border-bottom: 1px solid var(--line); padding: 8px 0; }
.review-card p { margin: 2px 0; }
.review-stars, .star-btn { color: #e0a100; letter-spacing: 2px; }
.star-row { display: flex; gap: 6px; margin: 8px 0; }
.star-btn { font-size: 2rem; background: none; border: 0; padding: 0 2px; cursor: pointer; }
.review-box textarea, .report-form textarea, .report-form input, .report-form select { width: 100%; margin: 4px 0; }
.shop-report { text-align: center; margin: 4px 0 24px; font-size: 0.85rem; }
.report-link { color: var(--ink-soft); text-decoration: underline; background: none; border: 0; cursor: pointer; }
.report-form { max-width: 480px; margin: 0 auto; text-align: left; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ✅ PAN verified badge under the shop name (060, js/shop-trust.js) */
.shop-verified { display: inline-block; margin: 6px 0 0; padding: 3px 10px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.92); color: #1b7a3d; font: inherit; font-size: var(--step-0, .95rem); font-weight: 600; cursor: pointer; }
.shop-verified-note { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.92);
  color: #222; font-size: .9rem; max-width: 36em; }

/* fix list #14: per-piece cart line shows its total as plain text (no editable Rs box) */
.line-total { font-weight: 700; color: var(--ink); white-space: nowrap; }


/* =====================================================================
   BATCH C (22 Nov 2026): loading placeholders, icons, quiet footer,
   fuller product sheet
   ===================================================================== */

/* While the shop loads: a grey banner and grey cards (like Daraz / Shopify) instead of the
   default colour, an empty "All products" and the footer jumping up. body.shop-loading is
   removed by app.js (showShop) whatever happens: loaded, offline, private or an error. */
body.shop-loading .hero { background: #e6e9ed; }
body.shop-loading .hero-text { visibility: hidden; }
body.shop-loading .powered-by,
body.shop-loading .site-footer,
body.shop-loading #products-heading { visibility: hidden; }
body.shop-loading #status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skeleton-card { display: flex; flex-direction: column; gap: 8px; }
.skeleton-card .sk-photo { aspect-ratio: 1 / 1; border-radius: var(--radius-photo); }
.skeleton-card .sk-line { height: 14px; border-radius: 6px; width: 85%; }
.skeleton-card .sk-line.short { width: 45%; }
.skeleton-card > div, body.shop-loading .hero {
  background: linear-gradient(90deg, #e6e9ed 0%, #f2f4f6 40%, #e6e9ed 80%) #e6e9ed;
  background-size: 200% 100%;
  animation: sk-shine 1.3s linear infinite;
}
@keyframes sk-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-card > div, body.shop-loading .hero { animation: none; } }

/* Line icons (same set as Shop Admin, admin/icons.js) instead of emojis */
.icon { flex-shrink: 0; vertical-align: -3px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.with-icon .icon { color: var(--brand); }
.contact-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }

/* Quiet footer: one Subidha line, big enough to tap (phones need ~44 px) */
.powered-by { align-items: center; }
.powered-by a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
.shop-legal-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 2px; }
.shop-legal-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.shop-report { margin: 0 0 24px; }
.report-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; font: inherit; }

/* Product sheet: quantity, share, more from this shop */
.sheet-buy { display: flex; gap: 10px; align-items: stretch; margin-top: 14px; }
.sheet-buy .add-button { flex: 1; margin: 0; min-height: 48px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius-button); }
.qty-stepper button { width: 44px; min-height: 46px; border: 0; background: none; display: grid; place-items: center; color: var(--ink); }
.qty-stepper button:disabled { color: #b8bec7; cursor: default; }
.qty-stepper output { min-width: 32px; text-align: center; font-weight: 700; font-size: var(--step-1); }
.sheet-in-cart { margin: 8px 0 0; color: var(--ink-soft); font-size: var(--step-0); }
.sheet-share { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; padding: 0 4px;
  border: 0; background: none; color: var(--brand-dark); font-weight: 600; }
.sheet-share-msg { margin: 2px 0 0; color: var(--ink-soft); font-size: var(--step-0); word-break: break-all; }
.sheet-share-msg:empty { display: none; }
.sheet-more { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sheet-more h3 { margin: 0 0 10px; font-size: var(--step-1); }
.sheet-more-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .sheet-more-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.more-card { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; text-align: left; color: var(--ink); }
.more-card .product-photo { aspect-ratio: 1 / 1; }
.more-card .more-name { font-size: var(--step-0); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.more-card .more-price { font-weight: 700; font-size: var(--step-0); }
.powered-by a.powered-link { text-decoration: none; }  /* "Online shop by Subidha" → seller front page (quiet, like "Powered by Shopify") */
/* "Order placed" → Save this shop (PLAN Stage 1.2): same quiet look as the other buttons there */
.done-save { display: block; width: 100%; margin-top: 10px; }
.done-save[hidden] { display: none; }
