/* =====================================================
   SOFAMALL TRADE — styles
   Mobile-first, large touch targets, high contrast.
   ===================================================== */
:root {
  --navy: #0e1626;
  --navy-2: #17233a;
  --gold: #c9a227;
  --gold-dark: #a5841b;
  --cream: #f7f2e9;
  --card: #ffffff;
  --ink: #1b2333;
  --muted: #5b6474;
  --line: #e5ddcc;
  --ok: #1e7a3c;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(14, 22, 38, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--cream);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px calc(10px);
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  border-bottom: 3px solid var(--gold);
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px; letter-spacing: 4px; font-weight: 700;
}
.brand-sub { font-size: 11px; letter-spacing: 3px; color: var(--gold); font-weight: 600; }
.call-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--gold); color: var(--navy);
  text-decoration: none; font-weight: 700; font-size: 16px;
  padding: 12px 16px; border-radius: 999px; white-space: nowrap;
  min-height: 48px;
}
.call-btn:active { background: var(--gold-dark); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.cart-btn {
  display: flex; align-items: center; gap: 8px; position: relative;
  background: #fff; color: var(--navy);
  text-decoration: none; font-weight: 800; font-size: 16px;
  padding: 12px 16px; border-radius: 999px; white-space: nowrap;
  min-height: 48px;
}
.cart-badge {
  background: var(--danger); color: #fff; font-size: 14px; font-weight: 800;
  min-width: 24px; height: 24px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
@media (max-width: 480px) {
  .call-txt { display: none; }
  .call-btn { padding: 12px; }
  .brand-mark { font-size: 21px; letter-spacing: 3px; }
  .brand-sub { font-size: 9.5px; letter-spacing: 2.2px; }
}

/* ---------- white label mode ---------- */
body.wl .call-btn, body.wl .cart-btn { display: none !important; }
.wl-lock {
  display: none; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 999px; flex: none;
  border: 2px solid rgba(255, 255, 255, .28); color: #fff; text-decoration: none;
}
body.wl .wl-lock { display: flex; }
.wl-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 2px dashed var(--navy); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px; min-height: 58px;
  font-size: 16px; font-weight: 600; color: var(--navy); text-decoration: none;
}
.wl-banner svg { flex: none; }
.wl-banner .arr { margin-left: auto; font-size: 22px; font-weight: 800; }
.wl-exit { color: var(--muted); font-size: 14px; }
.cfg-row.plain { cursor: default; }
.cfg-row.plain .cfg-tick { color: var(--ok); }

/* ---------- password gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gate-box { width: 100%; max-width: 420px; text-align: center; color: #fff; }
.gate-box .brand-mark { font-size: 34px; display: block; }
.gate-box .brand-sub { font-size: 13px; display: block; margin-bottom: 30px; }
.gate-box p { font-size: 18px; color: #cfd6e4; margin: 0 0 18px; }
.gate-field { display: flex; gap: 8px; margin-bottom: 12px; }
.gate-field input {
  flex: 1; min-width: 0; font-size: 22px; text-align: center; letter-spacing: 1px;
  padding: 16px 14px; border-radius: var(--radius); border: 2px solid #33415e;
  background: #17233a; color: #fff; outline: none;
}
.gate-field input:focus { border-color: var(--gold); }
.gate-show {
  flex: none; background: #17233a; border: 2px solid #33415e; color: #cfd6e4;
  border-radius: var(--radius); padding: 0 16px; font-size: 16px; font-weight: 700;
}
.gate-btn {
  width: 100%; background: var(--gold); color: var(--navy); border: 0;
  border-radius: var(--radius); font-size: 21px; font-weight: 800;
  min-height: 62px; margin-top: 4px;
}
.gate-btn:active { background: var(--gold-dark); }
.gate-err { color: #ff9d94; font-size: 17px; min-height: 24px; margin: 10px 0 0; font-weight: 600; }
.gate-or {
  display: flex; align-items: center; gap: 14px; color: #8894ab;
  font-size: 14px; letter-spacing: 2px; margin: 20px 0 12px;
}
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: #33415e; }
.gate-wl {
  width: 100%; background: transparent; border: 2px solid #33415e; color: #e8ecf4;
  border-radius: var(--radius); font-size: 18px; font-weight: 700; min-height: 62px; padding: 10px 16px;
}
.gate-wl small { display: block; font-weight: 400; font-size: 14px; color: #8894ab; margin-top: 2px; }
.gate-wl:active { background: #17233a; }
.gate-help { margin-top: 26px !important; font-size: 15px !important; }
.gate-help a { color: var(--gold); font-weight: 700; }

/* ---------- layout ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.footer {
  max-width: 1100px; margin: 24px auto 0; padding: 24px 16px 40px;
  border-top: 2px solid var(--line);
  text-align: center; color: var(--muted); font-size: 16px;
}
.footer a { color: var(--navy); font-weight: 600; }
.footer-note { font-size: 14px; }

/* ---------- hero strip ---------- */
.hero-strip {
  background: var(--navy-2);
  color: #fff; text-align: center;
  margin: -16px -16px 16px; padding: 14px 16px;
  font-size: 15px; letter-spacing: .4px;
}
.hero-strip strong { color: var(--gold); }

/* ---------- filters ---------- */
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 4px 14px; margin-bottom: 12px;
}
.searchbox svg { flex: none; color: var(--muted); }
.searchbox input {
  border: 0; outline: none; width: 100%; font-size: 18px; padding: 12px 0; background: transparent;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 2px solid var(--navy); background: var(--card); color: var(--navy);
  border-radius: 999px; padding: 10px 18px; font-size: 16px; font-weight: 600; min-height: 48px;
}
.chip.active { background: var(--navy); color: #fff; }
.chip .count { opacity: .6; font-weight: 400; }

/* ---------- product grid ---------- */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; } }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; position: relative;
  border: 1px solid rgba(0,0,0,.04);
}
.card:active { transform: scale(.99); }
.card-img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: #eee; }
.card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-name { font-weight: 700; font-size: 18px; }
.card-type { color: var(--muted); font-size: 14px; }
.card-price { margin-top: auto; padding-top: 6px; font-size: 17px; }
.card-price strong { font-size: 20px; color: var(--navy); }
.badge-new {
  position: absolute; top: 10px; left: 10px;
  background: var(--gold); color: var(--navy);
  font-size: 13px; font-weight: 800; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 6px;
}
.no-results { text-align: center; color: var(--muted); padding: 40px 0; font-size: 18px; }

/* ---------- product page ---------- */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; color: var(--navy);
  font-size: 18px; font-weight: 700; padding: 10px 0; margin-bottom: 4px;
  text-decoration: none; min-height: 48px;
}
.product { display: grid; gap: 18px; }
@media (min-width: 860px) { .product { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.product > * { min-width: 0; }
.gallery-main {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
}
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.thumb {
  flex: none; width: 84px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 3px solid transparent; background: #fff; padding: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--gold); }
.p-name { font-family: Georgia, serif; font-size: 34px; margin: 0; line-height: 1.1; }
.p-blurb { color: var(--muted); margin: 6px 0 0; font-size: 17px; }
.p-section { margin-top: 18px; }
.p-section > h2 {
  font-size: 15px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; font-weight: 700;
}
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  border: 2px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 10px 16px; font-size: 16px; font-weight: 600; min-height: 48px;
}
.swatch.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.cfg-list { display: flex; flex-direction: column; gap: 8px; }
.cfg-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; font-size: 18px; min-height: 60px; text-align: left; width: 100%;
}
.cfg-row .cfg-label { font-weight: 600; }
.cfg-row .cfg-price { font-weight: 800; font-size: 20px; color: var(--navy); white-space: nowrap; }
.cfg-row.active { border-color: var(--gold); background: #fdf8ea; box-shadow: inset 0 0 0 1px var(--gold); }
.cfg-row.active .cfg-tick { color: var(--ok); }
.cfg-tick { color: transparent; flex: none; }
.dims { margin: 0; padding-left: 20px; color: var(--ink); font-size: 16px; }
.dims li { margin-bottom: 4px; }

/* quantity stepper */
.qty { display: flex; align-items: center; gap: 0; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); width: max-content; overflow: hidden; }
.qty button {
  width: 60px; height: 56px; border: 0; background: transparent; font-size: 30px; font-weight: 700; color: var(--navy);
}
.qty button:disabled { opacity: .3; }
.qty .qty-val { min-width: 56px; text-align: center; font-size: 22px; font-weight: 800; }

/* sticky book bar */
.bookbar {
  position: sticky; bottom: 0; z-index: 30;
  margin: 22px -16px calc(-16px);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(247, 242, 233, .96); backdrop-filter: blur(4px);
  border-top: 2px solid var(--line);
  display: flex; align-items: center; gap: 14px;
}
@media (min-width: 860px) { .bookbar { position: static; margin: 22px 0 0; padding: 0; border: 0; background: none; } }
.bookbar .total { flex: 1; min-width: 0; }
.bookbar .total .t-label { display: block; font-size: 13px; color: var(--muted); }
.bookbar .total .t-value { font-size: 26px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.bookbar .total .t-vat { font-size: 13px; color: var(--muted); }
.btn-book {
  flex: 2; background: var(--gold); color: var(--navy);
  border: 0; border-radius: var(--radius);
  font-size: 21px; font-weight: 800; letter-spacing: .5px;
  min-height: 64px; padding: 10px 20px;
  box-shadow: var(--shadow);
}
.btn-book:active { background: var(--gold-dark); }
.btn-book:disabled { background: #d8d2c2; color: #8b8574; }
.book-hint { text-align: center; color: var(--danger); font-size: 15px; margin: 6px 0 0; min-height: 20px; }

/* ---------- booking form ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--cream); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.sheet-head {
  position: sticky; top: 0; z-index: 5;
  background: var(--navy); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  border-bottom: 3px solid var(--gold);
}
.sheet-head h2 { margin: 0; font-size: 21px; flex: 1; }
.sheet-close {
  background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px;
  width: 48px; height: 48px; font-size: 26px; line-height: 1; flex: none;
}
.sheet-body { padding: 18px 16px 40px; max-width: 620px; width: 100%; margin: 0 auto; }
.order-summary {
  display: flex; gap: 14px; align-items: center;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; margin-bottom: 20px;
}
.order-summary img { width: 110px; height: 82px; object-fit: cover; border-radius: 10px; flex: none; }
.order-summary .os-name { font-weight: 800; font-size: 19px; }
.order-summary .os-line { color: var(--muted); font-size: 16px; }
.order-summary .os-price { font-weight: 800; color: var(--navy); font-size: 19px; margin-top: 2px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.field label .opt { color: var(--muted); font-weight: 400; font-size: 15px; }
.field input, .field textarea {
  width: 100%; font-size: 19px; padding: 16px 14px;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--navy); }
.field input.invalid { border-color: var(--danger); background: #fdf3f2; }
.field .err { color: var(--danger); font-size: 15px; margin-top: 4px; display: none; }
.field.show-err .err { display: block; }
.btn-send {
  width: 100%; background: var(--ok); color: #fff; border: 0; border-radius: var(--radius);
  font-size: 22px; font-weight: 800; min-height: 68px; margin-top: 6px;
}
.btn-send:disabled { opacity: .6; }
.send-fail {
  display: none; margin-top: 14px; padding: 14px;
  background: #fdf3f2; border: 2px solid var(--danger); border-radius: var(--radius); font-size: 16px;
}
.send-fail.show { display: block; }
.privacy-note { color: var(--muted); font-size: 14px; margin-top: 14px; text-align: center; }

/* ---------- added-to-order confirm ---------- */
.added-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(14, 22, 38, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .added-overlay { align-items: center; } }
.added-box {
  background: var(--cream); border-radius: 20px 20px 0 0; width: 100%; max-width: 480px;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}
@media (min-width: 640px) { .added-box { border-radius: 20px; } }
.added-box .tick-sm {
  width: 64px; height: 64px; border-radius: 50%; background: var(--ok);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.added-box h3 { margin: 0 0 4px; font-size: 22px; }
.added-box .added-line { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.added-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-goto-cart {
  background: var(--gold); color: var(--navy); border: 0; border-radius: var(--radius);
  font-size: 20px; font-weight: 800; min-height: 62px; width: 100%;
}
.btn-continue {
  background: var(--card); color: var(--navy); border: 2px solid var(--navy); border-radius: var(--radius);
  font-size: 19px; font-weight: 700; min-height: 58px; width: 100%;
}

/* ---------- cart ---------- */
.cart-title { font-family: Georgia, serif; font-size: 32px; margin: 6px 0 14px; }
.cart-empty { text-align: center; padding: 40px 0; }
.cart-empty .cart-empty-ico { font-size: 54px; margin-bottom: 8px; }
.cart-empty p { color: var(--muted); font-size: 19px; }
.cart-item {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; margin-bottom: 12px;
}
.cart-item img { width: 96px; height: 74px; object-fit: cover; border-radius: 10px; }
.ci-name { font-weight: 800; font-size: 18px; }
.ci-line { color: var(--muted); font-size: 15px; }
.ci-price { font-weight: 800; color: var(--navy); font-size: 18px; margin-top: 2px; }
.ci-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.qty.qty-sm button { width: 52px; height: 48px; font-size: 26px; }
.qty.qty-sm .qty-val { min-width: 44px; font-size: 19px; }
.ci-remove {
  background: none; border: 0; color: var(--danger); font-size: 16px; font-weight: 700;
  padding: 12px 8px; min-height: 48px;
}
.cart-total-box {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 16px 18px; margin: 16px 0 22px; font-size: 18px;
}
.cart-total-box strong { font-size: 26px; color: var(--gold); }
.cart-form-title { font-family: Georgia, serif; font-size: 26px; margin: 26px 0 4px; }
.cart-form-sub { color: var(--muted); font-size: 16px; margin: 0 0 16px; }
.cart-addmore {
  display: inline-flex; align-items: center; gap: 6px; color: var(--navy);
  font-weight: 700; font-size: 17px; text-decoration: none; padding: 8px 0; min-height: 44px;
}

/* ---------- success ---------- */
.success { text-align: center; padding: 30px 0 10px; }
.success .tick {
  width: 96px; height: 96px; border-radius: 50%; background: var(--ok);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.success h2 { font-family: Georgia, serif; font-size: 30px; margin: 0 0 8px; }
.success p { font-size: 18px; color: var(--muted); margin: 6px auto; max-width: 460px; }
.success .order-summary { text-align: left; max-width: 460px; margin: 18px auto; }
.success-actions { display: flex; flex-direction: column; gap: 10px; max-width: 460px; margin: 22px auto 0; }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--card); border: 2px solid var(--navy); color: var(--navy);
  border-radius: var(--radius); font-size: 19px; font-weight: 700;
  min-height: 60px; text-decoration: none; padding: 8px 16px;
}
.btn-whatsapp { background: #1faa53; border-color: #1faa53; color: #fff; }
.btn-home { background: var(--navy); border-color: var(--navy); color: #fff; }

/* larger text on desktop */
@media (min-width: 860px) {
  .p-name { font-size: 40px; }
}
