/* Grand Bazaar offers */

/* Nunito (SIL Open Font License), self-hosted latin subset, weights 600–900. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url("/fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Fallback tuned to Nunito's line metrics so text doesn't jump when the font arrives. */
@font-face {
  font-family: "Nunito Fallback";
  src: local("Arial"), local("Roboto"), local("Helvetica");
  ascent-override: 101%;
  descent-override: 35%;
  line-gap-override: 0%;
  size-adjust: 100%;
}

:root {
  --brand-logo: #3AAB47;   /* Grand Bazaar logo green: decoration only (too light for white text) */
  --brand: #237A34;        /* same hue, deep enough for white text (5.4:1) */
  --brand-dark: #1A6029;
  --brand-soft: #E9F6EB;
  --green: #32AD4A;
  --yellow: #FCC10A;
  --wa: #12833B;          /* WhatsApp-style green, dark enough for white text (4.8:1) */
  --wa-dark: #0E6E31;
  --call: #1E66D0;
  --call-dark: #1753AD;

  --ink: #1C2230;
  --muted: #5A6273;
  --line: #E8EBF0;
  --bg: #FFFFFF;
  --surface: #F6F7FA;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 6px 18px rgba(20, 24, 40, .07);
  --shadow-lg: 0 4px 10px rgba(20, 24, 40, .08), 0 16px 40px rgba(20, 24, 40, .12);
  --gutter: 16px;
  --max: 1180px;
  --bar-h: 76px;
  --accent: var(--brand-logo);

  --font: "Nunito", "Nunito Fallback", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.icon { width: 22px; height: 22px; flex: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, white); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border: 0; border-radius: 999px;
  font-weight: 800; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); }
.btn-call { background: var(--call); color: #fff; }
.btn-call:hover { background: var(--call-dark); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: #ECEEF3; }
.btn-light { background: #fff; color: var(--ink); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 64px; }
.brand { display: flex; align-items: center; min-height: 44px; flex: none; }
.brand img { height: 36px; width: auto; }

@media (min-width: 560px) {
  .brand img { height: 42px; }
}

/* ---------- Hero ---------- */
.hero { padding: 22px 0 6px; }
.hero .wrap { display: grid; gap: 16px; }
.hero h1 { font-size: 28px; line-height: 1.15; font-weight: 900; letter-spacing: -.01em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 15px; font-weight: 700; background: var(--surface); color: var(--ink);
}
.pill .icon { width: 18px; height: 18px; color: var(--accent); }
.pill-accent { background: var(--brand-soft); color: var(--brand-dark); }
.hero .btn-share { width: 100%; min-height: 54px; font-size: 17px; box-shadow: 0 6px 16px rgba(18, 131, 59, .28); }
@media (min-width: 640px) {
  .hero .wrap { grid-template-columns: 1fr auto; align-items: end; }
  .hero .btn-share { width: auto; padding: 0 26px; }
  .hero h1 { font-size: 34px; }
}

/* ---------- Search + chips ---------- */
.finder { padding: 14px 0 4px; }
.search { position: relative; }
.search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 54px; padding: 0 52px 0 50px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 17px; font-weight: 600; outline: none;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: #8A90A0; font-weight: 600; }
.search input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  display: none; align-items: center; justify-content: center;
}
.search.has-value .clear { display: flex; }

.chips {
  display: flex; gap: 8px; min-height: 54px; /* reserve the row before the script fills it */ margin: 12px calc(var(--gutter) * -1) 0; padding: 2px var(--gutter) 8px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 700; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:last-child { margin-right: 20px; }

/* ---------- Sections ---------- */
.section { padding: 18px 0 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.section-head .count { color: var(--muted); font-weight: 700; font-size: 15px; }
.badge-live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: #E8F7EB; color: #1E7A33; font-size: 15px; font-weight: 800; white-space: nowrap;
}
.badge-live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(50, 173, 74, .5); animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(50, 173, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(50, 173, 74, 0); } }

/* Today's price boards: full poster, stacked on phones, side by side from tablet */
.boards { display: grid; gap: 14px; }
@media (min-width: 700px) { .boards { grid-template-columns: 1fr 1fr; gap: 18px; } }
.board {
  position: relative; display: block; width: 100%; padding: 0; text-align: left;
  border: 0; border-radius: var(--radius); background: #fff; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.board .img { aspect-ratio: 1102 / 1427; background: var(--surface); }
.board img { width: 100%; height: 100%; object-fit: cover; }
.board .cap {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 58px; padding: 12px 14px 14px; font-weight: 800; font-size: 17px;
}
.boards.single { grid-template-columns: minmax(0, 520px); }

/* Offer grid: 2 / 3 / 4 columns */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }

.card {
  display: flex; flex-direction: column; width: 100%; padding: 0; text-align: left;
  border: 0; border-radius: var(--radius); background: #fff; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.card .img { position: relative; aspect-ratio: 4 / 5; background: var(--surface); overflow: hidden; }
.card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.card .body { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 13px; flex: 1; }
.card .title {
  font-size: 15px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .price-row { margin-top: auto; }
@media (hover: hover) {
  .card:hover, .board:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
}
.card:active, .board:active { transform: scale(.985); }

.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.price .tag {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 10px; border-radius: 10px; background: var(--brand); color: #fff;
  font-size: 18px; font-weight: 900; line-height: 1.2; white-space: nowrap;
}
.price .tag small { font-size: 15px; font-weight: 700; opacity: .92; }
.price .tag.soft { background: var(--brand-soft); color: var(--brand-dark); font-size: 15px; }
.price s { color: var(--muted); font-size: 15px; font-weight: 700; }

.skeleton { background: linear-gradient(100deg, #F1F3F6 30%, #F8F9FB 50%, #F1F3F6 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.card.is-skeleton { pointer-events: none; }
.card.is-skeleton .line { height: 14px; border-radius: 6px; }

.empty {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 34px 18px; border-radius: var(--radius); background: var(--surface);
}
.empty h3 { font-size: 19px; font-weight: 900; }
.empty p { color: var(--muted); }
.empty .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

/* ---------- Stores ---------- */
.stores { padding-top: 28px; }
.store-cards { display: grid; gap: 14px; }
.store-cards { max-width: 560px; }
.store {
  display: grid; gap: 14px; padding: 18px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.store-logo { height: 48px; display: flex; align-items: center; }
.store-logo img { max-height: 48px; width: auto; max-width: 100%; }
.store h3 { font-size: 19px; font-weight: 900; }
.store dl { display: grid; gap: 8px; margin: 0; }
.store dl div { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-weight: 600; }
.store dl dt { flex: none; color: var(--accent); padding-top: 1px; }
.store dl dd { margin: 0; color: var(--ink); }
.store .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.store .actions .btn-ghost { grid-column: 1 / -1; }

/* ---------- Footer ---------- */
.foot { margin-top: 36px; padding: 26px 0 calc(var(--bar-h) + 30px); background: var(--surface); text-align: center; }
.foot .logos { display: flex; justify-content: center; align-items: center; gap: 18px 26px; flex-wrap: wrap; }
.foot .logos img { height: 34px; width: auto; }
.foot p { margin-top: 14px; color: var(--muted); font-size: 15px; }
@media (min-width: 900px) { .foot { padding-bottom: 40px; } }

/* ---------- Contact bar (mobile) / floating buttons (desktop) ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(20, 24, 40, .06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.actionbar .btn { min-height: 54px; font-size: 18px; }
.actionbar .btn .icon { width: 24px; height: 24px; }
@media (min-width: 900px) {
  .actionbar {
    left: auto; right: 24px; bottom: 24px; grid-template-columns: auto; gap: 12px;
    padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .actionbar .btn { min-height: 56px; padding: 0 22px; box-shadow: var(--shadow-lg); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 18px); z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Full-screen viewer ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: rgb(12, 13, 18); color: #fff;
  --bg-a: 1;
}
.viewer[hidden] { display: none; }
.viewer::before { content: ""; position: absolute; inset: 0; background: rgba(12, 13, 18, var(--bg-a)); z-index: -1; }
.viewer.is-dragging-down { background: transparent; }
.viewer-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px;
  transition: opacity .2s;
}
.viewer-top .meta { flex: 1; min-width: 0; }
.viewer-top .counter { font-size: 15px; font-weight: 800; color: rgba(255, 255, 255, .7); letter-spacing: .03em; }
.viewer-top .vtitle { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #fff; flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .2); }

.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.track { display: flex; height: 100%; will-change: transform; }
.track.anim { transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
.slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 6px 12px; overflow: hidden; }
.slide img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 10px; transform-origin: 50% 50%; will-change: transform;
  -webkit-user-drag: none; user-select: none;
}
.slide img.anim { transition: transform .25s ease; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; display: none; width: 56px; height: 56px; }
.nav-btn.prev { left: 16px; }
.nav-btn.next { right: 16px; }
@media (hover: hover) and (min-width: 700px) { .nav-btn { display: inline-flex; } }
.nav-btn[disabled] { opacity: .25; cursor: default; }

.viewer-bottom {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  max-width: 560px; width: 100%; margin: 0 auto;
  transition: opacity .2s;
}
.viewer-bottom .price .tag { font-size: 17px; }
.viewer-bottom .price s { color: rgba(255, 255, 255, .7); }
.viewer-bottom .price { grid-column: 1 / -1; justify-content: center; min-height: 30px; }
.viewer-bottom .btn { min-height: 54px; font-size: 17px; }
.viewer-bottom .btn-light { padding: 0 20px; }
.viewer .hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2;
  padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-weight: 700;
  pointer-events: none; transition: opacity .4s; white-space: nowrap; font-size: 15px;
}
.viewer.zoomed .hint, .viewer .hint.gone { opacity: 0; }

html.no-scroll, html.no-scroll body { overflow: hidden; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
