/* ============================================================
   1MM INDIA - Design System
   Mobile-first. Desktop styles live in the media queries below.
   Brand: gold (#C9A227) + dark ink, taken from the logo.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --gold:       #C9A227;
  --gold-dark:  #A8871C;
  --gold-soft:  #FBF6E6;
  --ink:        #14161A;
  --ink-2:      #232830;
  --ink-3:      #3A414D;
  --muted:      #6B7280;
  --muted-2:    #9CA3AF;
  --line:       #E5E7EB;
  --line-2:     #F0F2F5;
  --bg:         #F6F7F9;
  --card:       #FFFFFF;
  --green:      #0E9F6E;
  --green-soft: #E6F6F0;
  --red:        #DC2626;
  --red-soft:   #FEECEC;
  --blue:       #2563EB;
  --blue-soft:  #EFF4FE;
  --amber-soft: #FEF6E7;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sh-sm: 0 1px 2px rgba(16,24,40,.05);
  --sh:    0 2px 8px rgba(16,24,40,.07);
  --sh-lg: 0 8px 28px rgba(16,24,40,.12);

  --header-h: 56px;
  --bottomnav-h: 60px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

/* An author `display` rule beats the UA's [hidden], so state it here. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* The header is sticky, so an in-page jump (the Enquiry button -> #enquiry)
   would otherwise land with the heading hidden underneath it. */
[id] { scroll-margin-top: calc(var(--header-h) + 14px); }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* Keep content clear of the bottom nav */
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

h1,h2,h3,h4 { line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 19px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 14px; }
.section { padding-block: 22px; }
.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }

/* The reset makes every svg display:block, and a block element ignores
   text-align:center - it just sits on the left. Centre icons explicitly
   wherever they sit directly inside a centred block. */
.center > svg,
.empty > svg,
.empty .ic > svg { margin-inline: auto; }
.hide-mobile { display: none; }
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}
.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}
.mb-24{margin-bottom:24px}

/* ---------- Typography helpers ---------- */
.t-sm    { font-size: 13px; }
.t-xs    { font-size: 12px; }
.t-lg    { font-size: 17px; }
.muted   { color: var(--muted); }
.bold    { font-weight: 700; }
.semi    { font-weight: 600; }
.gold    { color: var(--gold-dark); }
.green   { color: var(--green); }
.red     { color: var(--red); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.clamp-3 {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Section heading ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.sec-head h2 { font-size: 18px; }
.sec-head .more { font-size: 13px; font-weight: 600; color: var(--gold-dark); white-space: nowrap; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.header-bar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand-text { display: none; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: .3px; color: #fff; }
.brand-tag  { font-size: 10px; color: var(--gold); letter-spacing: .4px; text-transform: uppercase; }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  color: #fff; position: relative;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--ink);
}

/* ---------- Search bar ---------- */
.searchbar { padding: 0 14px 12px; }
.search-form {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: var(--r-xl);
  padding: 0 6px 0 14px; height: 42px;
  box-shadow: var(--sh);
  /* The bar is white but it lives inside .header, which sets color:#fff.
     Without this every child - the magnifier, the typed text - is white on
     white. Set it once here so anything added later is readable too. */
  color: var(--ink);
}
/* The magnifier is a hint, not content: match the placeholder. */
.search-form > svg { color: var(--muted-2); flex-shrink: 0; }
.search-form input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 14px; min-width: 0;
  /* The bar sits inside .header, which sets color:#fff, and the reset makes
     inputs inherit it - so typed text came out white on the white bar. */
  color: var(--ink);
}
.search-form input::placeholder { color: var(--muted-2); }

/* City picker inside the search bar */
.search-city {
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0; max-width: 132px;
  padding-left: 10px; margin-left: 2px;
  border-left: 1px solid var(--line);
  color: var(--muted);
}
.search-city svg { flex-shrink: 0; }
.search-city select {
  border: none; outline: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--ink);
  max-width: 104px; padding: 0; cursor: pointer;
  /* Native arrow takes room we do not have; the pin already reads as a menu. */
  appearance: none; -webkit-appearance: none;
  text-overflow: ellipsis;
}
@media (max-width: 400px) {
  .search-city { max-width: 96px; padding-left: 8px; }
  .search-city select { max-width: 70px; }
}
.search-form .search-go {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: var(--ink);
  display: grid; place-items: center; flex-shrink: 0;
}

/* ---------- Search tabs ---------- */
.search-tabs { display: flex; gap: 6px; padding: 0 14px 10px; }
.search-tabs button {
  flex: 1; height: 32px; border-radius: 16px;
  font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.75);
}
.search-tabs button.on { background: var(--gold); color: var(--ink); }

/* ============================================================
   BOTTOM NAV (app-like feel, for the APK)
   ============================================================ */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  box-shadow: 0 -2px 12px rgba(16,24,40,.06);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  position: relative;
}
.bottomnav a.on { color: var(--gold-dark); }
.bottomnav a.on::before {
  content: ''; position: absolute; top: 0;
  width: 30px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--gold);
}
.bottomnav svg { width: 21px; height: 21px; }
.bottomnav .fab {
  flex: 0 0 auto; width: 60px;
}
.bottomnav .fab span {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gold); color: var(--ink);
  display: grid; place-items: center;
  margin-top: -18px; box-shadow: var(--sh-lg);
  border: 3px solid var(--card);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 18px;
  border-radius: var(--r); font-size: 14.5px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: var(--gold-dark); color: #fff; }
.btn-dark    { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-green   { background: var(--green); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-ghost   { background: var(--line-2); color: var(--ink-3); }
.btn-danger  { background: var(--red-soft); color: var(--red); }
.btn-block   { display: flex; width: 100%; }
.btn-sm      { height: 36px; padding: 0 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg      { height: 50px; font-size: 16px; }
.btn:disabled, .btn.is-loading { opacity: .6; pointer-events: none; }
/* flex-shrink:0 matters: inside a narrow column the button shrinks to fit,
   and without this the icon is the first thing squashed to nothing. */
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-sm svg { width: 16px; height: 16px; }

.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1DA851; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.card-pad { padding: 14px; }

/* ---------- Category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat-item {
  background: var(--card); border-radius: var(--r);
  border: 1px solid var(--line-2);
  padding: 14px 8px; text-align: center;
  transition: all .15s;
}
.cat-item:hover { border-color: var(--gold); box-shadow: var(--sh); }
.cat-icon {
  width: 46px; height: 46px; margin: 0 auto 8px;
  border-radius: 14px; background: var(--gold-soft);
  display: grid; place-items: center; font-size: 22px;
  color: var(--gold-dark);          /* the SVG inherits this */
}
/* Chips carry an icon before the label - keep it from squashing */
.chip svg { flex-shrink: 0; opacity: .75; }
.chip.on svg { opacity: 1; }
.cat-name { font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.cat-count { font-size: 10px; color: var(--muted-2); margin-top: 2px; }

/* ---------- Product card ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prod-card { background: var(--card); border-radius: var(--r); border: 1px solid var(--line-2); overflow: hidden; }
.prod-card:hover { box-shadow: var(--sh); }
.prod-img { position: relative; aspect-ratio: 4/3; background: var(--line-2); }
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-body { padding: 10px; }
.prod-name { font-size: 13px; font-weight: 600; line-height: 1.35; min-height: 35px; }
.prod-price { font-size: 15px; font-weight: 800; color: var(--ink); margin-top: 5px; }
.prod-price small { font-size: 11px; font-weight: 500; color: var(--muted); }
.prod-price.ask { font-size: 13.5px; color: var(--gold-dark); }
.prod-seller { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.prod-tag {
  position: absolute; top: 7px; left: 7px;
  background: rgba(20,22,26,.82); color: #fff;
  font-size: 10px; font-weight: 700; padding: 3px 7px;
  border-radius: 5px; text-transform: uppercase; letter-spacing: .3px;
}
.prod-tag.featured { background: var(--gold); color: var(--ink); }
.prod-save {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--muted);
  display: grid; place-items: center; box-shadow: var(--sh-sm);
}
.prod-save.on { color: var(--red); }
.prod-save svg { width: 16px; height: 16px; }

/* ---------- Job card ---------- */
.job-card { background: var(--card); border-radius: var(--r); border: 1px solid var(--line-2); padding: 13px; }
.job-card:hover { box-shadow: var(--sh); border-color: var(--line); }
.job-top { display: flex; gap: 11px; }
.job-logo {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: var(--gold-soft); display: grid; place-items: center;
  font-size: 17px; font-weight: 800; color: var(--gold-dark);
  overflow: hidden;
}
.job-logo img { width: 100%; height: 100%; object-fit: cover; }
.job-title { font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.job-company { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.job-salary { font-size: 13.5px; font-weight: 700; color: var(--green); margin-top: 8px; }

/* ---------- Company card ---------- */
.co-card { background: var(--card); border-radius: var(--r); border: 1px solid var(--line-2); padding: 13px; display: flex; gap: 12px; min-width: 0; }
/* A long business name must be cut with "..." inside the card, never push
   the card past the screen edge: flex items refuse to shrink below their
   content unless told so, and this is what let the home page scroll sideways. */
.co-card .grow { min-width: 0; }
.co-card .grow > .row { min-width: 0; }
.co-card .truncate { min-width: 0; flex: 0 1 auto; }
.co-logo {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  background: var(--gold-soft); display: grid; place-items: center;
  font-size: 19px; font-weight: 800; color: var(--gold-dark); overflow: hidden;
}
.co-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   BADGES / CHIPS / PILLS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  background: var(--line-2); color: var(--ink-3);
}
.badge-gold   { background: var(--gold-soft); color: var(--gold-dark); }
.badge-green  { background: var(--green-soft); color: var(--green); }
.badge-red    { background: var(--red-soft); color: var(--red); }
.badge-blue   { background: var(--blue-soft); color: var(--blue); }
.badge-amber  { background: var(--amber-soft); color: #B45309; }
.badge-verify { background: var(--green-soft); color: var(--green); }
.badge svg { width: 12px; height: 12px; }

/* Horizontal scroll chips */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 34px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 17px; font-size: 13px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-3); white-space: nowrap;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* The chip row is a swipe strip on a touch screen, and its scrollbar is
   hidden to keep that clean. A mouse has no way to swipe, so on a pointer
   device the row wraps onto a second line instead - otherwise the last tabs
   (Payments, Settings) are simply unreachable. */
@media (pointer: fine) {
  .chips { flex-wrap: wrap; overflow-x: visible; padding-bottom: 0; }
}
/* Always allow wrapping where a view asks for it. */
.chips.wrap { flex-wrap: wrap; overflow-x: visible; }

/* Scroll row (horizontal cards) */
.scroll-row {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.scroll-row::-webkit-scrollbar { display: none; }

@media (pointer: fine) {
  /* Give the carousel a slim, visible scrollbar so a mouse user can reach
     the cards past the fold. */
  .scroll-row { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .scroll-row::-webkit-scrollbar { display: block; height: 8px; }
  .scroll-row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
  .scroll-row::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
  .scroll-row::-webkit-scrollbar-track { background: transparent; }
}
.scroll-row > * { flex: 0 0 46%; scroll-snap-align: start; }

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: 15px; }
.label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--ink-2);
}
.label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; height: 46px;
  padding: 0 13px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 15px; /* below 16px iOS zooms on focus - 15 is safe here */
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 100px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.13);
}
.input.err, .select.err, .textarea.err { border-color: var(--red); }
.err-text { font-size: 12px; color: var(--red); margin-top: 5px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.input-group { display: flex; }
.input-group .prefix {
  height: 46px; padding: 0 12px;
  display: grid; place-items: center;
  background: var(--line-2); border: 1.5px solid var(--line); border-right: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.input-group .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* Register: the three "what brings you here" choices as tappable cards */
.role-pick { display: grid; gap: 8px; }
.role-pick label { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; cursor: pointer;
                   border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); }
.role-pick input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); flex-shrink: 0; }
.role-pick b { display: block; font-size: 14px; }
.role-pick small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.role-pick label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--gold); flex-shrink: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }

/* Photo upload */
.photo-up { display: flex; align-items: center; gap: 14px; }
.photo-preview {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--line-2); border: 2px dashed var(--line);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Multi image upload */
.img-up-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.img-up-box {
  aspect-ratio: 1; border-radius: var(--r-sm);
  border: 2px dashed var(--line); background: var(--line-2);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.img-up-box img { width: 100%; height: 100%; object-fit: cover; }
.img-up-box .rm {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(20,22,26,.75); color: #fff;
  display: grid; place-items: center; font-size: 13px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-sm);
  font-size: 13.5px; margin-bottom: 14px;
  border-left: 3px solid;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-soft); color: #05614A; border-color: var(--green); }
.alert-error   { background: var(--red-soft);   color: #991B1B; border-color: var(--red); }
.alert-info    { background: var(--blue-soft);  color: #1E40AF; border-color: var(--blue); }
.alert-warn    { background: var(--amber-soft); color: #92400E; border-color: #F59E0B; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; background: var(--ink); overflow: hidden; }
.hero-img { position: absolute; inset: 0; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.hero-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(20,22,26,.94) 0%, rgba(20,22,26,.72) 55%, rgba(20,22,26,.45) 100%);
}
.hero-body { position: relative; padding: 30px 0 34px; color: #fff; }
.hero h1 { font-size: 25px; line-height: 1.22; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { font-size: 14.5px; color: rgba(255,255,255,.8); margin-top: 10px; max-width: 460px; }
.hero-stats { display: flex; gap: 22px; margin-top: 22px; }
.hero-stat b { display: block; font-size: 21px; color: var(--gold); line-height: 1.1; }
.hero-stat span { font-size: 11.5px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .4px; }
.hero-cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Launch offer banner ---------- */
.offer-banner {
  background: linear-gradient(96deg, var(--gold) 0%, #E0BE4A 100%);
  color: var(--ink); border-radius: var(--r);
  padding: 13px 15px; display: flex; align-items: center; gap: 12px;
}
.offer-banner .big { font-size: 24px; font-weight: 900; line-height: 1; }
.offer-banner .txt { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.offer-banner .seats {
  margin-left: auto; flex-shrink: 0; text-align: center;
  background: rgba(20,22,26,.16); border-radius: 9px; padding: 6px 11px;
}
.offer-banner .seats b { display: block; font-size: 18px; line-height: 1; }
.offer-banner .seats span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; }

/* ============================================================
   PLANS
   ============================================================ */
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.plan {
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; position: relative;
}
.plan.popular { border-color: var(--gold); box-shadow: var(--sh-lg); }
.plan-tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--ink);
  font-size: 11px; font-weight: 800; padding: 4px 13px;
  border-radius: 12px; text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap;
}
.plan-name { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.plan-price { font-size: 34px; font-weight: 900; margin: 6px 0 2px; letter-spacing: -.02em; }
.plan-price small { font-size: 14px; font-weight: 600; color: var(--muted); }
.plan-dur { font-size: 13px; color: var(--muted); }
.plan-gst { font-size: 12px; color: var(--muted); margin-top: -2px; }
.plan-feats { margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.plan-feats li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; }
.plan-feats svg { width: 17px; height: 17px; color: var(--green); flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   PANEL (user / seller / admin)
   ============================================================ */
.panel-head {
  background: var(--ink); color: #fff;
  padding: 18px 0 22px;
}
.panel-user { display: flex; align-items: center; gap: 13px; }
.panel-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--gold); color: var(--ink);
  display: grid; place-items: center; overflow: hidden;
  font-size: 21px; font-weight: 800; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.2);
}
.panel-avatar img { width: 100%; height: 100%; object-fit: cover; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--card); border-radius: var(--r);
  border: 1px solid var(--line-2); padding: 13px;
}
.stat b { display: block; font-size: 23px; font-weight: 800; line-height: 1.15; }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.menu-list { background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); }
.menu-list a {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 15px; border-bottom: 1px solid var(--line-2);
  font-size: 14.5px; font-weight: 500;
}
.menu-list a:last-child { border-bottom: none; }
.menu-list a:hover { background: var(--line-2); }
.menu-list .ic {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--gold-soft); color: var(--gold-dark);
  display: grid; place-items: center; flex-shrink: 0;
}
.menu-list .ic svg { width: 17px; height: 17px; }
.menu-list .arrow { margin-left: auto; color: var(--muted-2); }

/* Progress (profile completeness) */
.progress { height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width .4s; }

/* ============================================================
   TABLE (for admin - scrolls on mobile)
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.table { min-width: 620px; font-size: 13.5px; }
.table th {
  text-align: left; padding: 11px 13px; font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); background: var(--line-2); white-space: nowrap;
}
.table td { padding: 11px 13px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: #FAFBFC; }

/* ============================================================
   MISC
   ============================================================ */
.empty { text-align: center; padding: 44px 20px; }
.empty .ic { font-size: 42px; margin-bottom: 12px; opacity: .35; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }

.pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 11px;
  display: grid; place-items: center; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600;
}
.pagination .on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .off { opacity: .4; pointer-events: none; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--gold-dark); }

.divider { height: 1px; background: var(--line); margin: 18px 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12.5px; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Sticky action bar (on product detail) */
.action-bar {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  z-index: 55; background: var(--card);
  border-top: 1px solid var(--line);
  padding: 10px 14px; display: flex; gap: 9px;
  box-shadow: 0 -3px 14px rgba(16,24,40,.08);
}
.has-action-bar { padding-bottom: calc(var(--bottomnav-h) + 66px + env(safe-area-inset-bottom)); }

/* Gallery */
.gallery-main { aspect-ratio: 4/3; background: var(--line-2); border-radius: var(--r); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 9px; overflow-x: auto; scrollbar-width: none; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumbs img {
  width: 58px; height: 58px; border-radius: var(--r-sm);
  object-fit: cover; border: 2px solid transparent; flex-shrink: 0;
}
.gallery-thumbs img.on { border-color: var(--gold); }

/* ---------- Contact rows (contact page sidebar) ---------- */
.contact-row {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.contact-row:first-child { padding-top: 4px; }
.contact-row:last-child  { padding-bottom: 4px; border-bottom: none; }
.contact-row .ic {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
}
.contact-row .tx { min-width: 0; }        /* lets a long address wrap */
.contact-row .lb {
  font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 3px;
}
.contact-row .vl {
  font-size: 14.5px; font-weight: 600; line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Spec table */
.specs { font-size: 13.5px; }
.specs div { display: flex; padding: 9px 0; border-bottom: 1px solid var(--line-2); gap: 12px; }
.specs div:last-child { border-bottom: none; }
.specs dt { color: var(--muted); flex: 0 0 42%; }
.specs dd { font-weight: 600; flex: 1; }

/* Footer */
.footer { background: var(--ink); color: rgba(255,255,255,.62); padding: 30px 0 26px; font-size: 13px; }
.footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
/* Long category names and email addresses must break rather than push the
   column wide - the grid tracks are minmax(0,1fr) so they will shrink.
   Buttons are excluded: shrinking them squashes their icon. */
.footer p,
.footer li,
.footer span:not(.btn),
.footer a:not(.btn) { overflow-wrap: break-word; min-width: 0; }

/* Only the button pair may wrap. A blanket rule here also wrapped the
   contact rows, dropping each icon onto its own line. */
.footer-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Android app badge: the image is the button, the line under it says
   plainly that this is a direct APK, not the Play Store (yet). */
.footer-app { display: inline-flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.footer-app img { display: block; width: 100%; max-width: 180px; height: auto; border-radius: 8px;
                  border: 1px solid rgba(255,255,255,.18); transition: transform .15s, border-color .15s; }
.footer-app:hover img { transform: translateY(-1px); border-color: var(--gold); }
.footer-app span { font-size: 11.5px; color: rgba(255,255,255,.55); }
/* Already running as the installed app (TWA or home-screen PWA): no point
   offering the download inside it. */
@media (display-mode: standalone) { .footer-app { display: none; } }

/* Contact rows: icon pinned beside the text, never on its own line */
.footer-contact li { display: flex; align-items: flex-start; gap: 8px; }
.footer-contact li svg { flex-shrink: 0; margin-top: 3px; }
.footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 18px; }
.footer-bottom {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12px; text-align: center;
}

/* Developer credit - one link, three homes (footer, auth pages, admin bar) */
.credit { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
          color: inherit; text-decoration: none; opacity: .8; transition: opacity .15s, color .15s; }
.credit strong { font-weight: 700; color: var(--gold); letter-spacing: .2px; }
.credit:hover { opacity: 1; color: var(--gold); }
.footer-credit { margin-top: 10px; }
.auth-credit { text-align: center; margin-top: 18px; color: var(--muted); }
.auth-credit .credit strong { color: var(--gold-dark); }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-credit { color: var(--muted); padding: 4px 0 10px; }
.admin-credit .credit strong { color: var(--gold-dark); }
/* Inside the installed Android app the credit is hidden (client's call);
   it stays on the website, including the site opened in a phone browser. */
@media (display-mode: standalone) { .footer-credit, .auth-credit, .admin-credit { display: none; } }

/* Skeleton loading */
@keyframes shimmer { 100% { background-position: -200% 0; } }
.skel {
  background: linear-gradient(90deg, var(--line-2) 25%, #E8EAEE 50%, var(--line-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--r-sm);
}

/* ============================================================
   TABLET  >= 640px
   ============================================================ */
@media (min-width: 640px) {
  body { font-size: 15.5px; }
  .container { padding-inline: 20px; }
  .cat-grid  { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .prod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2    { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scroll-row > * { flex-basis: 31%; }
  .hero h1 { font-size: 32px; }
  .brand-text { display: block; }
  h1 { font-size: 26px; }
}

/* ============================================================
   DESKTOP  >= 1024px
   ============================================================ */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }               /* bottom nav is hidden */
  .bottomnav { display: none; }
  .action-bar { bottom: 0; }
  .has-action-bar { padding-bottom: 80px; }
  .hide-mobile { display: block; }
  .hide-desktop { display: none !important; }

  :root { --header-h: 66px; }

  .header-bar { gap: 22px; }
  .brand img { width: 42px; height: 42px; }
  .searchbar { flex: 1; padding: 0; max-width: 620px; }
  .search-form { height: 44px; }
  .header-nav { display: flex; gap: 4px; margin-left: auto; }
  .header-nav a {
    padding: 8px 13px; border-radius: var(--r-sm);
    font-size: 14px; font-weight: 600; color: rgba(255,255,255,.82);
  }
  .header-nav a:hover, .header-nav a.on { background: rgba(255,255,255,.11); color: #fff; }

  .cat-grid  { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .prod-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .scroll-row > * { flex-basis: 23%; }
  .prod-name { font-size: 14px; min-height: 38px; }

  .hero-body { padding: 62px 0 66px; }
  .hero h1 { font-size: 42px; max-width: 700px; }
  .hero p  { font-size: 16px; }

  .section { padding-block: 34px; }
  .sec-head h2 { font-size: 22px; }

  .footer-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  /* minmax(0,1fr) rather than 1fr: stops wide content (images, tables, long
     words) from forcing the column open and scrolling the whole page sideways. */
  .split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
  .split-wide { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
  .sticky-side { position: sticky; top: calc(var(--header-h) + 16px); }
}

/* Slightly wider container on large screens */
@media (min-width: 1280px) {
  .container { max-width: 1240px; }
}

/* For users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* Print */
@media print {
  .header, .bottomnav, .action-bar, .footer { display: none !important; }
  body { padding: 0; background: #fff; }
}

/* ============================================================
   AUTH GATE MODAL
   A bottom sheet on phones, a centred dialog from tablet up.
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(16, 24, 40, .55);
  opacity: 0; transition: opacity .22s ease;
}
.modal.in .modal-backdrop { opacity: 1; }

.modal-sheet {
  position: relative; width: 100%; max-width: 420px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 30px rgba(16, 24, 40, .18);
  text-align: center;
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.22, .8, .3, 1);
}
.modal.in .modal-sheet { transform: translateY(0); }
/* The sheet takes focus when it opens so screen readers and the keyboard land
   inside it; it is not itself interactive, so it needs no ring. */
.modal-sheet:focus { outline: none; }

/* The grab handle that says "this slides" */
.modal-sheet::before {
  content: ''; position: absolute; top: 9px; left: 50%;
  width: 38px; height: 4px; margin-left: -19px;
  border-radius: 2px; background: var(--line);
}

.modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted);
}
.modal-x:hover { background: var(--line-2); color: var(--ink); }

.modal-ic {
  width: 52px; height: 52px; border-radius: 50%;
  margin: 2px auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold-dark);
}
.modal-sheet h2 { font-size: 18px; }
.modal-sub {
  font-size: 13.5px; color: var(--muted);
  margin: 6px auto 20px; max-width: 320px; line-height: 1.55;
}
.modal-foot {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); margin-top: 16px;
}
.modal-foot svg { flex-shrink: 0; }

/* Stop the page behind from scrolling while the sheet is open */
body.modal-open { overflow: hidden; }

@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal-sheet {
    border-radius: var(--r-lg);
    padding: 30px 26px 26px;
    transform: translateY(14px) scale(.97);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
  }
  .modal.in .modal-sheet { transform: translateY(0) scale(1); opacity: 1; }
  .modal-sheet::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-sheet { transition: none; }
}

/* ---- One-time password readout (admin) ---- */
.pw-out {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--gold-soft); border: 1px solid var(--gold);
  border-radius: var(--r); padding: 12px 14px;
}
.pw-out code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 19px; font-weight: 700; letter-spacing: 1px;
  color: var(--ink); user-select: all;      /* one tap selects the lot */
}

/* ---- Confirm dialog (shares the .modal shell) ---- */
.confirm-modal .modal-sheet { max-width: 380px; }
.confirm-ic { background: var(--blue-soft); color: var(--blue); }
.confirm-ic.is-danger { background: var(--red-soft); color: var(--red); }
.confirm-msg { font-size: 16px; line-height: 1.5; margin: 0 auto 20px; max-width: 30ch; }
.confirm-actions { display: flex; gap: 10px; }

/* ============================================================
   PASSWORD FIELDS - show/hide, Caps Lock, match
   ============================================================ */
.pw-wrap { position: relative; display: block; }
/* Room for the eye, so the text never runs underneath it. */
.pw-wrap .input { padding-right: 44px; }

.pw-eye {
  position: absolute; top: 50%; right: 6px;
  transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); transition: color .15s, background .15s;
}
.pw-eye:hover { color: var(--ink); background: var(--line-2); }
.pw-eye:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.pw-caps,
.pw-match { font-size: 12px; margin-top: 5px; }
.pw-caps  { color: var(--red); font-weight: 600; }
.pw-match { color: var(--red); }
.pw-match.ok { color: var(--green); }

/* ============================================================
   IMAGE CROPPER
   Full screen on a phone, a centred panel on a desktop.
   ============================================================ */
.cropper {
  position: fixed; inset: 0; z-index: 300;
  background: #101216;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.cropper-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; flex-shrink: 0;
  color: #fff;
}
.cropper-title { font-size: 14px; font-weight: 600; }
.cropper-bar button {
  background: none; border: 0; cursor: pointer;
  font-size: 14.5px; font-weight: 600; padding: 6px 4px;
}
.cropper-cancel { color: rgba(255,255,255,.75); }
.cropper-cancel:hover { color: #fff; }
.cropper-done   { color: var(--gold); }
.cropper-done:hover { color: #fff; }

.cropper-stage {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 0 16px;
}
.cropper-frame {
  position: relative; overflow: hidden;
  /* The ratio must survive a short screen. max-height would silently squash
     the frame, and then a "square" crop was not square at all - the photo
     came out stretched. Limiting the WIDTH by the available height keeps the
     shape exact. --crop-ar is set by the cropper. */
  aspect-ratio: var(--crop-ar, 1);
  width: min(88vw, 460px, calc(56vh * var(--crop-ar, 1)));
  background: #000;
  border-radius: var(--r);
  /* A ring rather than a border, so it does not affect the frame size -
     the crop maths reads clientWidth/clientHeight. */
  box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 0 0 100vmax rgba(0,0,0,.45);
  touch-action: none;              /* we handle drag and pinch ourselves */
  cursor: grab;
}
.cropper-frame:active { cursor: grabbing; }
.cropper-frame img {
  position: absolute; top: 50%; left: 50%;
  max-width: none;                 /* the reset would otherwise cap the zoom */
  transform-origin: 0 0;
  user-select: none; -webkit-user-drag: none;
  pointer-events: none;
}
.cropper-hint {
  font-size: 12.5px; color: rgba(255,255,255,.6);
  text-align: center; margin: 0;
}

.cropper-tools {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px 22px; flex-shrink: 0;
  max-width: 460px; width: 100%; margin-inline: auto;
}
.cropper-zoom {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff;
  font-size: 18px; line-height: 1;
}
.cropper-zoom:hover { background: rgba(255,255,255,.25); }
.cropper-range { flex: 1; min-width: 0; accent-color: var(--gold); }

@media (min-width: 640px) {
  .cropper { padding: 5vh 0; }
}

/* ============================================================
   TOAST (JS notifications)
   ============================================================ */
.toast {
  position: fixed; left: 50%; z-index: 999;
  bottom: calc(var(--bottomnav-h) + 20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: 11px 18px; border-radius: 22px;
  background: var(--ink); color: #fff;
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--sh-lg);
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }

@media (min-width: 1024px) {
  .toast { bottom: 26px; }
}

/* ============================================================
   PRODUCT GALLERY  (e-commerce style)
   Mobile: swipeable main image + thumbnail strip below.
   Desktop: vertical thumbnail rail on the left, hover-zoom on the main image.
   ============================================================ */
.gallery { position: relative; min-width: 0; }

/* Grid and flex children default to min-width:auto, which lets a wide image
   push the whole page sideways. Zero it out everywhere in the gallery. */
.gallery > *,
.gal-stage,
.gal-track,
.gal-slide,
.lb-track,
.lb-slide { min-width: 0; }

/* ---------- Main stage ---------- */
.gal-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}
.gal-track {
  display: flex;
  height: 100%;
  transition: transform .3s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.gal-track.dragging { transition: none; }
.gal-slide {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.gal-slide img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform .25s ease;
  pointer-events: none;
}

/* ---------- Arrows ---------- */
.gal-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.94); color: var(--ink);
  display: grid; place-items: center;
  box-shadow: var(--sh); z-index: 3;
  opacity: 0; transition: opacity .2s, background .15s;
}
.gal-arrow:hover { background: #fff; }
.gal-arrow.prev { left: 10px; }
.gal-arrow.next { right: 10px; }
.gal-arrow[disabled] { opacity: 0 !important; pointer-events: none; }
.gallery:hover .gal-arrow { opacity: 1; }

/* ---------- Counter + badges ---------- */
.gal-count {
  position: absolute; bottom: 10px; right: 10px; z-index: 3;
  background: rgba(20,22,26,.72); color: #fff;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  pointer-events: none;
}
.gal-zoom-hint {
  position: absolute; bottom: 10px; left: 10px; z-index: 3;
  background: rgba(20,22,26,.72); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 20px;
  display: none; align-items: center; gap: 5px;
  pointer-events: none;
}
.gal-expand {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.94); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--sh-sm);
}
.gal-expand:hover { background: #fff; }

/* ---------- Dots (mobile) ---------- */
.gal-dots {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 10px;
}
.gal-dots button {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line); transition: all .2s;
}
.gal-dots button.on { background: var(--gold); width: 20px; border-radius: 4px; }

/* ---------- Thumbnails ---------- */
.gal-thumbs {
  display: flex; gap: 8px; margin-top: 10px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.gal-thumbs::-webkit-scrollbar { display: none; }
.gal-thumb {
  flex: 0 0 auto;
  width: 62px; height: 62px;
  border-radius: var(--r-sm);
  border: 2px solid var(--line-2);
  background: var(--card);
  overflow: hidden; padding: 0;
  transition: border-color .15s;
}
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-thumb.on { border-color: var(--gold); }
.gal-thumb:hover { border-color: var(--gold-dark); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12,13,16,.96);
  display: none;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.lightbox.open { display: flex; }
body.lb-open { overflow: hidden; }

.lb-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; color: #fff; flex-shrink: 0;
}
.lb-bar .lb-title { font-size: 13.5px; font-weight: 600; opacity: .85; }
.lb-close {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff;
  display: grid; place-items: center;
}
.lb-close:hover { background: rgba(255,255,255,.22); }

.lb-stage {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  /* none, not pan-y: the JS owns every gesture here so it can tell a
     pinch from a swipe from a pan. The lightbox never scrolls anyway. */
  touch-action: none;
}
.lb-track { display: flex; width: 100%; height: 100%; transition: transform .3s cubic-bezier(.22,.61,.36,1); }
.lb-track.dragging { transition: none; }
.lb-slide { flex: 0 0 100%; display: grid; place-items: center; padding: 8px 14px; }
.lb-slide img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 6px;
  cursor: zoom-in;
  will-change: transform;
  /* No transition here - the JS sets one only for tap/wheel zooms, so that
     pinching and panning track the finger with no lag. */
}
.lb-slide img.zoomed { cursor: grab; border-radius: 0; }
.lb-slide img.zoomed:active { cursor: grabbing; }

/* While zoomed, get the chrome out of the way so a pan does not hit an arrow */
.lightbox.is-zoomed .lb-arrow,
.lightbox.is-zoomed .lb-thumbs { opacity: 0; pointer-events: none; }
.lb-arrow, .lb-thumbs { transition: opacity .2s; }

/* Hint, shown once the lightbox opens */
.lb-hint {
  position: absolute; bottom: 14px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.13); color: #fff;
  font-size: 11.5px; font-weight: 600;
  padding: 6px 13px; border-radius: 20px;
  display: flex; align-items: center; gap: 6px;
  pointer-events: none; z-index: 4;
  animation: lbHintFade 3.4s ease forwards;
}
.lightbox.is-zoomed .lb-hint { display: none; }
@keyframes lbHintFade {
  0%, 70% { opacity: 1; }
  100%    { opacity: 0; }
}

/* Show the wording that matches the device */
.lb-hint-mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
  .lb-hint-touch { display: none; }
  .lb-hint-mouse { display: flex; }
}

.lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff;
  display: grid; place-items: center; z-index: 3;
  transition: background .15s;
}
.lb-arrow:hover { background: rgba(255,255,255,.26); }
.lb-arrow.prev { left: 12px; }
.lb-arrow.next { right: 12px; }
.lb-arrow[disabled] { opacity: .25; pointer-events: none; }

.lb-thumbs {
  display: flex; gap: 8px; justify-content: center;
  padding: 12px 14px; overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
}
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumbs button {
  flex: 0 0 auto; width: 52px; height: 52px;
  border-radius: 7px; overflow: hidden;
  border: 2px solid transparent; opacity: .55;
  transition: opacity .15s, border-color .15s;
}
.lb-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumbs button.on { opacity: 1; border-color: var(--gold); }

/* ---------- Desktop layout ---------- */
@media (min-width: 1024px) {
  /* Two columns only when there are thumbnails to put in the rail.
     With a single photo the stage takes the full width instead. */
  .gallery.has-thumbs {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }

  .gal-thumbs {
    order: -1;
    flex-direction: column;
    margin-top: 0;
    max-height: 520px;
    overflow-y: auto; overflow-x: hidden;
  }
  .gal-thumb { width: 68px; height: 68px; }

  .gal-dots { display: none; }
  .gal-stage { aspect-ratio: 1 / 1; cursor: zoom-in; }
  .gal-zoom-hint { display: flex; }

  /* Hover zoom - JS sets the transform-origin from the cursor position */
  .gal-stage.zooming .gal-slide.on img { transform: scale(2.2); }
  .gal-stage.zooming .gal-arrow,
  .gal-stage.zooming .gal-zoom-hint { opacity: 0; }
}

/* ---------- Seller image manager ---------- */
.imgmgr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.imgmgr-item {
  position: relative; border: 2px solid var(--line);
  border-radius: var(--r-sm); overflow: hidden;
  background: var(--line-2);
}
.imgmgr-item.is-main { border-color: var(--gold); }
.imgmgr-item.is-removed { opacity: .35; }
.imgmgr-pic { aspect-ratio: 1; }
.imgmgr-pic img { width: 100%; height: 100%; object-fit: cover; }
.imgmgr-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px; background: var(--card);
  border-top: 1px solid var(--line-2);
}
.imgmgr-main {
  flex: 1; display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.imgmgr-main input { width: 15px; height: 15px; accent-color: var(--gold); margin: 0; }
.imgmgr-btn {
  width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--line-2); color: var(--ink-3);
  font-size: 13px; flex-shrink: 0;
}
.imgmgr-btn:hover { background: var(--line); }
.imgmgr-btn.danger { background: var(--red-soft); color: var(--red); }
.imgmgr-btn[disabled] { opacity: .3; pointer-events: none; }
.imgmgr-tag {
  position: absolute; top: 5px; left: 5px;
  background: var(--gold); color: var(--ink);
  font-size: 9.5px; font-weight: 800;
  padding: 3px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .3px;
  display: none;
}
.imgmgr-item.is-main .imgmgr-tag { display: block; }

@media (min-width: 640px) {
  .imgmgr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

