/* Phase 1 styles. No external fonts or CDNs: works on slow connections and blocked networks.
   Fonts fall back to system Arabic-capable fonts. */

:root {
  --bg: #f2efec;
  --card: #ffffff;
  --ink: #2b2b2b;
  --muted: #6b6b66;
  --accent: #c40000;
  --accent-dark: #8a0000;
  --tint: #fbe9e9;
  --accent-ink: #ffffff;
  --border: #e3e0d8;
  --danger: #a33a3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Tahoma, "Noto Naskh Arabic", "Arial Unicode MS", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar nav { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; }
.brand { font-weight: bold; font-size: 18px; color: var(--ink); }
.lang { font-weight: bold; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; min-height: 70vh; }
.foot { text-align: center; color: var(--muted); padding: 24px; font-size: 13px; }

h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 19px; margin: 24px 0 12px; }

.muted { color: var(--muted); font-size: 14px; }
.price { color: var(--accent); font-weight: bold; }
.total { font-size: 18px; }

.flash {
  background: var(--tint);
  border: 1px solid var(--accent);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card.product img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; }
.card.block { margin-bottom: 14px; }

.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.product-page img.big { width: 100%; border-radius: 10px; }

.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px; text-align: right; }

.form { display: grid; gap: 12px; max-width: 480px; background: var(--card); padding: 16px; border-radius: 10px; border: 1px solid var(--border); }
.form label { display: grid; gap: 4px; font-size: 14px; }

input, textarea, select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
input.qty { width: 80px; }

button, .btn {
  display: inline-block;
  font: inherit;
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--danger); padding: 4px 8px; }
form.inline { display: inline; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef0ec;
  font-size: 13px;
}

/* Small screens: stack the product page and keep tables scrollable. */
@media (max-width: 640px) {
  .product-page { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Booth (vendor storefront, 2D) ---- */
.booth { border-top: 6px solid var(--booth, var(--accent)); background: var(--card); border-radius: 10px; padding: 16px; border-inline-start: 1px solid var(--border); border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.booth-banner, .booth-banner-preview { width: 100%; max-height: 240px; object-fit: cover; border-radius: 8px; margin-bottom: 12px; }
.booth-banner-preview { max-width: 720px; }
.booth-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.booth-logo { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); flex-shrink: 0; }
.booth-tagline { color: var(--booth, var(--accent)); font-weight: bold; margin: 0 0 6px; }
.booth.list .grid { grid-template-columns: 1fr; }
.booth.list .card.product { flex-direction: row; align-items: center; }
.booth.list .card.product img { width: 110px; height: 90px; flex-shrink: 0; }
.booth .card.product:hover { border-color: var(--booth, var(--accent)); }

/* ---- Zher Market v2: navigation, search, dashboards, shipments ---- */
:root { --chart-bar: #0f8a6c; --chart-grid: #e6e2d8; --warn: #9a6b00; --ok: #1d6b3a; }

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { border-radius: 6px; }
.topsearch { flex: 1 1 260px; max-width: 520px; }
.topsearch input { width: 100%; border-radius: 999px; padding: 8px 16px; }
.topbar .quick { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; align-items: center; }
.quick a.on, .panelbar a.on { font-weight: bold; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; line-height: 20px; }

.panelbar { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 6px 16px; background: #fbfaf6; border-bottom: 1px solid var(--border); font-size: 14px; }
.panelbar a { padding: 4px 10px; border-radius: 999px; color: var(--ink); }
.panelbar a.on { background: var(--accent); color: #fff; }
.panelbar a.end { margin-inline-start: auto; color: var(--muted); }

.hero { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--accent-ink); border-radius: 14px; padding: 22px 18px; margin-bottom: 16px; }
.hero h1 { margin: 0 0 4px; font-size: 26px; }
.hero .muted { color: inherit; opacity: .88; }
.searchbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.searchbar input[type=search] { flex: 1 1 240px; border: 0; border-radius: 999px; padding: 10px 16px; }
.searchbar button { background: #f2c14e; color: #1d1d1b; border-radius: 999px; }
.searchbar .btn.ghost { background: rgba(255,255,255,.15); color: #fff; border-radius: 999px; }

.chips, .filters, .pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips a, .filters a, .pager a { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 14px; }
.chips a.on, .filters a.on, .pager a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin: 12px 0; font-size: 14px; }
.filterbar label { display: grid; gap: 2px; }
.filterbar input { width: 120px; }

.btn.ghost, button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 6px 12px; }
button.ghost.danger { color: var(--danger); border-color: var(--danger); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { display: inline-block; align-self: start; padding: 1px 8px; border-radius: 6px; background: #fff4d6; color: #6b4e00; font-size: 12px; }
.stars { color: #c98a00; letter-spacing: 1px; }
.img-placeholder { display: block; height: 150px; border-radius: 6px; background: repeating-linear-gradient(45deg, #f0ede5, #f0ede5 10px, #e9e5db 10px, #e9e5db 20px); }
.big-price { font-size: 24px; }
.buybox fieldset { border: 1px solid var(--border); border-radius: 8px; display: grid; gap: 8px; }
.booth-card { border-top: 4px solid var(--booth); }
.booth-card .booth-logo { width: 48px; height: 48px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; color: var(--ink); }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 20px; }
.stat.strong { border-color: var(--accent); }
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.chart { margin: 0 0 18px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.chart figcaption { font-weight: bold; margin-bottom: 6px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--chart-bar); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(15, 138, 108, .08); }
.chart .base { stroke: #b9b3a5; stroke-width: 1; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart details { margin-top: 6px; font-size: 13px; }

.shipment { border: 1px dashed var(--border); border-radius: 8px; padding: 10px; margin: 8px 0; }
.shipment-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.shipment .items { margin: 6px 0; padding-inline-start: 20px; }
.timeline { list-style: none; margin: 6px 0; padding: 0; font-size: 13px; border-inline-start: 2px solid var(--border); }
.timeline li { padding-inline-start: 10px; position: relative; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; max-width: none; }
.badge.s-placed, .badge.s-open { background: #fff4d6; color: #6b4e00; }
.badge.s-confirmed { background: #e3ecfb; color: #1f3f7a; }
.badge.s-shipped { background: #efe6fb; color: #4b2a7a; }
.badge.s-delivered, .badge.s-paid { background: #e2f3e7; color: var(--ok); }
.badge.s-cancelled { background: #f1f1ef; color: var(--muted); }

.notif-list { list-style: none; padding: 0; }
.notif-list .unread { border-inline-start: 4px solid var(--accent); }
.flash.error { background: #fbeaea; border-color: #ecc1c1; }

.dropzone { display: grid; place-items: center; gap: 8px; min-height: 160px; border: 2px dashed var(--accent); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; background: #f3faf7; }
.dropzone img { max-width: 220px; max-height: 220px; border-radius: 8px; }

@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .topsearch { order: 3; flex-basis: 100%; max-width: none; }
}

@media print {
  .topbar, .panelbar, .foot, .no-print { display: none !important; }
  body { background: #fff; }
  .stat, .table { border-color: #999; }
}

/* ---- 3D hall ---- */
.hall { position: relative; width: 100%; height: 72vh; min-height: 420px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #f3efe6; touch-action: none; }
.hall canvas { display: block; }
.buybox fieldset label { display: flex; gap: 8px; align-items: flex-start; }
.buybox fieldset input[type=radio] { margin-top: 6px; flex-shrink: 0; }
.chart svg { max-height: 280px; }
.hall-online { position: absolute; top: 10px; inset-inline-end: 10px; background: rgba(29,29,27,.72); color: #fff; padding: 5px 10px; border-radius: 8px; font-size: 13px; pointer-events: none; }

/* A long option must not widen the page on a phone. */
select { max-width: 100%; }
.filterbar label, .form label { min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr); }
.form { min-width: 0; }

/* Phase B3: theme settings and shop photos */
body.embed .topbar, body.embed .panelbar, body.embed .foot, body.embed h1 { display: none; }
body.embed main { padding: 0; max-width: none; min-height: 0; }
body.embed .hall { height: 100vh; }
.theme-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .theme-layout { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); } .theme-preview { position: sticky; top: 8px; align-self: start; } }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.color-grid input[type=color] { width: 100%; height: 44px; padding: 2px; }
.check { display: flex !important; align-items: center; gap: 8px; }
.check input { width: 22px; height: 22px; }
.theme-logo { max-width: 120px; max-height: 80px; object-fit: contain; }
.theme-sample { --ts-bg: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--ts-bg); color: var(--ts-ink); font-size: 13px; margin-bottom: 10px; }
.ts-head { background: var(--ts-dark); color: #fff; padding: 6px 10px; font-weight: bold; }
.ts-body { padding: 8px 10px; display: grid; gap: 6px; }
.ts-flash { background: var(--ts-tint); border: 1px solid var(--ts-accent); border-radius: 6px; padding: 3px 8px; }
.ts-card { background: var(--ts-card); border-radius: 6px; padding: 6px 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ts-btn { background: var(--ts-accent); color: #fff; border-radius: 6px; padding: 2px 8px; }
#theme-3d { width: 100%; height: 340px; border: 1px solid var(--border); border-radius: 10px; background: #ddd; display: block; }
.theme-views { display: flex; gap: 8px; margin: 8px 0 14px; }
.link-danger { background: none !important; color: var(--danger) !important; border: 1px solid var(--danger) !important; }
.banner-chip { padding: 2px 10px; border-radius: 6px; display: inline-block; }
.inline { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.photo-slot { display: grid; gap: 6px; min-width: 0; align-content: start; }
.photo-slot img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.photo-crop { display: grid; gap: 4px; }
.photo-crop canvas { width: 100%; height: auto; align-self: start; aspect-ratio: 3 / 2; border-radius: 8px; touch-action: none; cursor: grab; background: #ddd; }
.photo-form { max-width: none; }
.photo-rejected { color: var(--danger); }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.photo-review { display: grid; gap: 6px; padding: 10px; }
.photo-review img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.table-wrap { overflow-x: auto; }

/* Phase B4b: 2D map of hall slots. */
.slot-map { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; }
.sm-aisle { flex: none; width: 168px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 6px; }
.sm-head { font-size: 13px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-grid { display: grid; grid-template-columns: 1fr 14px 1fr; gap: 4px; }
.sm-walk { background: repeating-linear-gradient(0deg, var(--border) 0 4px, transparent 4px 8px); border-radius: 3px; }
.sm-end { margin-top: 6px; display: grid; gap: 4px; font-size: 12px; text-align: center; }
.sm-cell { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; border-radius: 7px; font-size: 11px; line-height: 1.2; text-align: center; padding: 3px; border: 1px solid var(--border); overflow: hidden; word-break: break-word; }
.sm-cell.free { background: #eef7ef; border-color: #9cc9a3; color: #1d6b3a; cursor: pointer; }
.sm-cell.free:has(input:checked) { background: #1d6b3a; color: #fff; outline: 2px solid #1d6b3a; outline-offset: 1px; }
.sm-cell.taken { background: #f1efec; color: var(--muted); }
.sm-cell.mine { background: var(--accent); border-color: var(--accent-dark); color: var(--accent-ink); font-weight: bold; }
.sm-cell.asked { background: #fff4d6; border-color: #e0c06b; color: #7a5a00; }
.sm-cell input { margin: 0; flex: none; }
.sm-legend .sm-cell { display: inline-flex; min-height: 0; padding: 1px 6px; }
.slot-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.aisle-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; align-items: end; }
.aisle-form label { font-size: 12px; }
.aisle-form input, .aisle-form select { width: 100%; }
.opt-rows { display: grid; gap: 6px; }
.opt-row { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 6px; }
.side-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.side-photos img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; vertical-align: middle; }

/* ==== Version 14: design system (font, colours from «دیزاین صفحه», real-store layout) ==================== */
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

body { font-family: var(--font, Tahoma, sans-serif); font-size: var(--fs, 15px); background: var(--page-bg, #fff); color: var(--text, #23254e); line-height: 1.75; }
h1 { font-size: 1.45em; font-weight: 700; } h2 { font-size: 1.2em; font-weight: 700; } h3 { font-weight: 700; }
a { color: var(--accent); }
.muted { color: var(--soft, #81858b); }
.page-w { max-width: var(--page, 1280px); margin-inline: auto; padding-inline: 16px; }
main.page-w { padding-top: 12px; padding-bottom: 24px; min-height: 60vh; }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; flex-shrink: 0; }
.ic.big { width: 32px; height: 32px; }
[hidden] { display: none !important; }

/* Buttons and fields */
button, .btn { border-radius: var(--r, 10px); font-weight: 500; padding: 9px 18px; transition: filter .15s, transform .1s; }
button:hover, .btn:hover { filter: brightness(.94); text-decoration: none; }
button:active, .btn:active { transform: scale(.98); }
button:disabled { opacity: .6; cursor: default; }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-dark { background: #23254e; color: #fff; }
.btn-light { background: #fff; color: var(--accent); }
button.done { background: #1b7f3b; }
input, textarea, select { border-radius: calc(var(--r, 10px) * .7); border-color: #e0e0e6; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.form { border-color: var(--border); border-radius: var(--r, 10px); }
.flash { border-radius: var(--r, 10px); border-color: transparent; background: #f2f7ff; color: #1f3f7a; }

/* Header */
.site-head { background: #fff; position: relative; z-index: 30; border-bottom: 1px solid var(--border); }
.site-head.sticky { position: sticky; top: 0; }
.head-row { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25em; color: var(--accent); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; object-fit: contain; }
.topsearch { flex: 1 1 auto; max-width: 600px; position: relative; display: flex; align-items: center; }
.topsearch > .ic { position: absolute; inset-inline-start: 12px; color: var(--soft); pointer-events: none; }
.topsearch input[type=search] { width: 100%; background: #f0f0f1; border: 1px solid transparent; border-radius: var(--r, 10px); padding: 10px 14px; padding-inline-start: 40px; }
.topsearch input[type=search]:focus { background: #fff; }
.quick { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.quick a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); padding: 8px 10px; border-radius: var(--r, 10px); position: relative; font-size: .93em; }
.quick a:hover { background: #f5f5f7; text-decoration: none; }
.q-acc { border: 1px solid var(--border); }
.q-acc span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-ic .ic { width: 24px; height: 24px; }
.quick .count, .bottomnav .count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; line-height: 18px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }
.quick .lang { font-weight: 700; color: var(--accent); }
.shopbar { display: flex; align-items: center; gap: 2px 18px; padding-bottom: 6px; font-size: .9em; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.shopbar::-webkit-scrollbar { display: none; }
.shopbar > a { color: var(--text); display: inline-flex; align-items: center; gap: 4px; padding: 6px 0; }
.shopbar > a:hover, .shopbar > a.on { color: var(--accent); text-decoration: none; }
.megamenu summary { cursor: pointer; font-weight: 700; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
.megamenu summary::-webkit-details-marker { display: none; }
.megamenu .mega { position: absolute; inset-inline-start: 16px; top: 100%; z-index: 40; background: #fff; border: 1px solid var(--border); border-radius: var(--r, 10px);
  box-shadow: 0 16px 40px rgba(20, 20, 50, .14); padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: 2px 10px; white-space: normal; }
.megamenu .mega a { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 6px 8px; border-radius: 8px; }
.megamenu .mega a:hover { background: #f5f5f7; text-decoration: none; color: var(--accent); }
.megamenu .mega img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.panelbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding-top: 6px; padding-bottom: 6px; background: #fafafb; border-bottom: 1px solid var(--border); font-size: .88em; }
.panelbar a { padding: 3px 10px; border-radius: 999px; color: var(--text); }
.panelbar a.on { background: var(--accent); color: #fff; }
.panelbar a.end { margin-inline-start: auto; color: var(--soft); }
.more-menu { position: relative; }
.more-menu summary { cursor: pointer; padding: 3px 10px; list-style: none; color: var(--accent); }
.more-menu > div { position: absolute; z-index: 45; top: 100%; inset-inline-start: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; display: grid; min-width: 200px; }
.announce { text-align: center; font-size: .88em; padding: 6px 12px; }
.announce a { color: inherit; }

/* Search suggestions */
.suggest { position: absolute; top: calc(100% + 4px); inset-inline: 0; z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: var(--r, 10px); box-shadow: 0 16px 40px rgba(20,20,50,.14); max-height: 70vh; overflow: auto; padding: 6px; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text); }
.suggest a:hover, .suggest a:focus { background: #f5f5f7; text-decoration: none; outline: none; }
.suggest img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #f7f7f8; }
.suggest .sg-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .sg-item b { color: var(--text); font-size: .9em; white-space: nowrap; }
.suggest .sg-cat { color: var(--accent); font-weight: 500; }
.suggest .sg-cat::before { content: "#"; opacity: .5; }
.suggest .sg-all { justify-content: center; color: var(--accent); border-top: 1px solid var(--border); margin-top: 4px; }
.sg-more { width: 100%; background: #f5f5f7; color: var(--text); }

/* Designer blocks: wrapper */
.blk { background: var(--blk-bg, transparent); color: var(--blk-fg, inherit); border-radius: var(--blk-r, 0); }
/* --vw is the visible width without the scrollbar (set by site.js); 100vw would include it. */
.blk.w-full { margin-inline: calc(50% - var(--vw, 100vw) / 2); padding-inline: calc(var(--vw, 100vw) / 2 - 50%); }
.blk.sh-soft { box-shadow: 0 4px 18px rgba(20,20,50,.07); }
.blk.sh-strong { box-shadow: 0 10px 34px rgba(20,20,50,.16); }
.blk[style*="--blk-bg"] { padding-inline: 16px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec-head h2 { margin: 0; font-size: 1.15em; position: relative; padding-bottom: 6px; }
.sec-head h2::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 0; width: 36px; height: 3px; border-radius: 3px; background: var(--accent); }
.sec-head a { font-size: .9em; display: inline-flex; align-items: center; gap: 2px; }
.card-sec { border: 1px solid var(--border); border-radius: calc(var(--r, 10px) * 1.4); padding: 14px; }
.a-start { text-align: start; } .a-center { text-align: center; } .a-end { text-align: end; }
@media (max-width: 760px) { .hide-m { display: none !important; } }
@media (min-width: 761px) { .hide-d { display: none !important; } }

/* Product rows and grids */
.hrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 200px); gap: 0; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.hrow > * { scroll-snap-align: start; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; border-top: 1px solid var(--border); border-inline-start: 1px solid var(--border); }
.pgrid > .card.product { border-bottom: 1px solid var(--border); border-inline-end: 1px solid var(--border); }
.card.product { border: 0; border-radius: 0; background: #fff; padding: 12px 10px; gap: 6px; transition: box-shadow .15s; content-visibility: auto; contain-intrinsic-size: 190px 330px; }
.hrow .card.product { border-inline-end: 1px solid var(--border); }
.card.product:hover { box-shadow: 0 6px 24px rgba(20,20,50,.12); position: relative; z-index: 1; text-decoration: none; }
.p-img { position: relative; display: block; aspect-ratio: 1; margin-bottom: 4px; }
.p-img img, .p-img picture { width: 100%; height: 100%; object-fit: contain; display: block; }
.card.product img { height: 100%; border-radius: 0; }
.img-placeholder { display: grid; place-items: center; width: 100%; height: 100%; background: #f5f5f7; border-radius: var(--r, 10px); color: #c8c8d0; }
.img-placeholder .ic { width: 48px; height: 48px; stroke-width: 1.2; }
.p-off { position: absolute; top: 4px; inset-inline-start: 4px; }
.card.product strong { color: var(--text); font-weight: 500; font-size: .88em; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.6em; }
.p-meta { display: flex; justify-content: space-between; gap: 6px; font-size: .78em; }
.p-meta .muted { font-size: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-rate { color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.p-rate .ic { color: #f9bc00; fill: #f9bc00; width: 14px; height: 14px; }
.p-price { display: flex; flex-direction: column; align-items: flex-end; margin-top: auto; }
.p-price s { font-size: .78em; }
.card.product .price { color: var(--text); font-size: 1.02em; font-weight: 700; }
.card.product .tag { font-size: .72em; background: #fff1f1; color: var(--accent); border-radius: 999px; padding: 1px 8px; display: inline-flex; gap: 4px; align-items: center; }
.off { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 8px; font-size: .78em; font-weight: 700; line-height: 1.8; }
.sale-line { display: flex; align-items: center; gap: 6px; }
.endless-sentinel { height: 40px; }
.endless-sentinel.loading { background: radial-gradient(circle, var(--accent) 3px, transparent 4px) center / 18px 18px no-repeat; opacity: .5; }

/* Slider */
.slider { position: relative; border-radius: calc(var(--r, 10px) * 1.4); overflow: hidden; background: #f5f5f7; }
.slider .slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slider .slides::-webkit-scrollbar { display: none; }
.slider .slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; display: block; aspect-ratio: 16 / 5; }
.slider.h-sm .slide { aspect-ratio: 16 / 4; } .slider.h-lg .slide { aspect-ratio: 16 / 6.5; }
.slider .slide img, .slider .slide picture { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-cap { position: absolute; inset-inline-start: 5%; top: 50%; transform: translateY(-50%); max-width: 46%; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: rgba(255,255,255,.92); color: var(--text); padding: 18px 22px; border-radius: var(--r, 10px); box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.slide-cap b { font-size: 1.35em; line-height: 1.5; }
.slide-cap span { color: var(--soft); }
.slide-cap .btn { color: #fff; margin-top: 4px; }
.slider .dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.slider .dots button { width: 8px; height: 8px; border-radius: 99px; padding: 0; background: rgba(255,255,255,.7); }
.slider .dots button.on { width: 22px; background: #fff; }
.sl-prev, .sl-next { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; padding: 0; background: rgba(255,255,255,.9); color: var(--text); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.sl-prev { inset-inline-start: 12px; } .sl-next { inset-inline-end: 12px; }
.sl-next .ic { transform: scaleX(-1); }
[dir=rtl] .sl-prev .ic { transform: scaleX(-1); } [dir=rtl] .sl-next .ic { transform: none; }

/* Categories */
.cats { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: thin; justify-content: start; }
@media (min-width: 1100px) { .cats { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } }
.cats a { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text); font-size: .82em; text-align: center; line-height: 1.5; }
.cats a:hover { text-decoration: none; color: var(--accent); }
.cat-img { display: block; width: 88px; height: 88px; border-radius: 50%; overflow: hidden; background: #f5f5f7; transition: transform .2s; }
.cats a:hover .cat-img { transform: translateY(-3px); }
.cat-img img, .cat-img picture { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-size: 30px; font-weight: 700; color: var(--accent); }
.cats-cards { grid-auto-columns: 150px; }
.cats-cards .cat-img { width: 100%; height: 110px; border-radius: var(--r, 10px); }

/* Offers band */
.offers { background: var(--offer-bg, var(--accent)); border-radius: calc(var(--r, 10px) * 1.4); padding: 16px; display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: center; scroll-margin-top: 140px; }
.offers-head { color: #fff; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.offers-head h2 { margin: 0; font-size: 1.35em; line-height: 1.5; }
.offers-head p { margin: 0; opacity: .9; font-size: .85em; }
.offers .hrow { gap: 4px; }
.offers .card.product { border-radius: var(--r, 10px); border: 0; }
.offer-cell { display: flex; flex-direction: column; }
.offer-cell .countdown { background: #fff; color: var(--accent); text-align: center; font-size: .8em; font-weight: 700; padding: 2px; border-top: 1px dashed var(--border); border-radius: 0 0 var(--r, 10px) var(--r, 10px); direction: ltr; margin-top: -4px; }
.countdown b { direction: ltr; unicode-bidi: isolate; }
p.countdown { color: var(--accent); font-weight: 700; }

/* Banners, image, text, video, columns */
.banners { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 12px; }
.banners > * { display: block; aspect-ratio: var(--ar, 2/1); overflow: hidden; border-radius: calc(var(--r, 10px) * 1.4); }
.banners img, .banners picture { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.banners a:hover img { transform: scale(1.03); }
.one-img img, .one-img picture { width: 100%; display: block; border-radius: calc(var(--r, 10px) * 1.4); }
.one-img.fixed { aspect-ratio: var(--ar); overflow: hidden; border-radius: calc(var(--r, 10px) * 1.4); }
.one-img.fixed img { height: 100%; object-fit: cover; }
.rich h2 { margin-top: 0; } .rich.t-sm { font-size: .9em; } .rich.t-lg { font-size: 1.15em; } .rich p { margin: 0 0 .8em; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: calc(var(--r, 10px) * 1.4); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cols { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: var(--gap, 16px); }
.divider { border: 0; margin: 4px 0; }
.main-title { margin: 8px 0 12px; }

/* Vendors, quotes, trust, faq, contact, countdown, big search */
.vendors { gap: 10px; grid-auto-columns: 150px; }
.vcard { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 8px; border: 1px solid var(--border); border-radius: var(--r, 10px); color: var(--text); font-size: .88em; }
.vcard:hover { border-color: var(--accent); text-decoration: none; }
.v-logo, .vcard picture { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.v-fallback { display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 700; }
.vcard .muted { font-size: .85em; }
.quotes { gap: 12px; grid-auto-columns: minmax(240px, 300px); }
.quote { margin: 0; border: 1px solid var(--border); border-radius: var(--r, 10px); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.quote blockquote { margin: 0; flex: 1; }
.quote figcaption { color: var(--soft); font-size: .88em; }
.quote .stars { color: #f9bc00; }
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 18px 0; }
.trust > div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 0 12px; }
.trust .ic { color: var(--accent); stroke-width: 1.5; }
.trust small { color: var(--soft); }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details > div { color: var(--soft); padding-top: 8px; }
.contact-ways { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.contact-form { max-width: 560px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cd-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; background: #23254e; color: #fff; border-radius: calc(var(--r, 10px) * 1.4); padding: 16px; }
.countdown.big b { font-size: 1.5em; letter-spacing: 1px; }
.search-band { text-align: center; }
.big-search { display: flex; max-width: 640px; margin: 0 auto; position: relative; }
.big-search input { flex: 1; padding: 14px 18px; border-radius: var(--r, 10px) 0 0 var(--r, 10px); }
[dir=rtl] .big-search input { border-radius: 0 var(--r, 10px) var(--r, 10px) 0; }
.big-search button { border-radius: 0; }

/* Wheel banner */
.wheel-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; background: linear-gradient(135deg, #23254e, #3b3f7a); color: #fff; border-radius: calc(var(--r, 10px) * 1.4); padding: 14px 18px; }
.wheel-banner:hover { text-decoration: none; }
.wheel-banner .btn { white-space: nowrap; }
.wheel-mini { width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; background: conic-gradient(var(--accent) 0 25%, #fff 0 50%, var(--accent) 0 75%, #f9bc00 0); animation: wheelspin 8s linear infinite; }
@keyframes wheelspin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .wheel-mini { animation: none; } }

/* Catalog list page */
.list-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.list-head h1 { margin: 6px 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; scrollbar-width: thin; }
.chips a { white-space: nowrap; border-color: var(--border); background: #fff; }
.filters-box { margin: 6px 0; }
.filters-box summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.filterbar { border-radius: var(--r, 10px); border-color: var(--border); margin-top: 8px; }
.sortbar { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: .88em; border-bottom: 1px solid var(--border); padding: 6px 0; margin-bottom: 8px; }
.sortbar span { color: var(--soft); }
.sortbar a { color: var(--soft); padding: 4px 0; }
.sortbar a.on { color: var(--accent); font-weight: 700; }
.empty-state { text-align: center; color: var(--soft); padding: 40px 0; }
.pager { justify-content: center; }

/* Product page */
.product-page { gap: 32px; }
.product-page picture.big, .product-page img.big { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: var(--r, 10px); background: #fff; border: 1px solid var(--border); }
.big-price { font-size: 1.6em; color: var(--text); }

/* Footer and phone bar */
.foot { background: #fafafb; border-top: 1px solid var(--border); margin-top: 32px; padding: 28px 0 90px; color: var(--soft); font-size: .9em; text-align: start; }
.foot-cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 20px; }
.foot-cols > div { display: flex; flex-direction: column; gap: 6px; }
.foot-cols strong { color: var(--text); font-size: 1.05em; margin-bottom: 4px; }
.foot-cols a { color: var(--soft); }
.foot-cols a:hover { color: var(--accent); }
.foot-about p { margin: 0; }
.foot-copy { text-align: center; margin: 24px 0 0; font-size: .85em; }
@media (min-width: 761px) { .foot { padding-bottom: 28px; } }
.bottomnav { display: none; }
@media (max-width: 760px) {
  .bottomnav { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 40; background: #fff; border-top: 1px solid var(--border);
    justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--soft); position: relative; min-width: 58px; }
  .bottomnav a .ic { width: 24px; height: 24px; }
  .bottomnav a.on { color: var(--accent); }
  .bottomnav .count { top: -4px; inset-inline-end: 8px; }
  .head-row { flex-wrap: wrap; gap: 8px 12px; }
  .topsearch { order: 3; flex-basis: 100%; max-width: none; }
  .quick .q-acc, .quick .q-cart { display: none; }
  .megamenu .mega { position: fixed; inset-inline: 8px; top: auto; grid-template-columns: 1fr 1fr; max-height: 60vh; overflow: auto; }
  .offers { grid-template-columns: 1fr; }
  .offers-head { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .slider .slide, .slider.h-sm .slide, .slider.h-lg .slide { aspect-ratio: 16 / 8; }
  .slide-cap { max-width: 70%; padding: 10px 14px; gap: 2px; }
  .slide-cap b { font-size: 1em; }
  .slide-cap span:not(.btn) { display: none; }
  .sl-prev, .sl-next { display: none; }
  .banners { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-about { grid-column: 1 / -1; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wheel-banner { grid-template-columns: auto 1fr; }
  .wheel-banner .btn { grid-column: 1 / -1; text-align: center; }
  .card-sec { padding: 10px; }
}
body.embed .site-head, body.embed .panelbar, body.embed .bottomnav, body.embed .announce { display: none; }
@media print { .site-head, .panelbar, .bottomnav, .foot, .announce { display: none !important; } }

/* Card style chosen in the designer */
body.card-border .card.product { border: 1px solid var(--border); border-radius: var(--r, 10px); margin: 4px; }
body.card-border .pgrid, body.card-border .pgrid > .card.product { border-top: 0; border-inline-start: 0; }
body.card-shadow .card.product { box-shadow: 0 2px 12px rgba(20,20,50,.08); border-radius: var(--r, 10px); margin: 6px; border: 0; }
body.card-shadow .pgrid, body.card-shadow .pgrid > .card.product { border-top: 0; border-inline-start: 0; border-bottom: 0; border-inline-end: 0; }

/* Toast */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translate(-50%, 20px); background: #23254e; color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; font-size: .9em; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #b3261e; }

/* Wheel page, coupons, admin helpers (from version 13) */
.wheel-page { max-width: 720px; margin: 0 auto; }
.wheel-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.wheel-stage { position: relative; width: min(86vw, 420px); }
.wheel-stage canvas { width: 100%; height: auto; display: block; border-radius: 50%; box-shadow: 0 8px 26px rgba(0,0,0,.18); }
.wheel-pin { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; z-index: 2; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #23254e; }
.wheel-btn { font-size: 1.1em; padding: 10px 34px; border-radius: 999px; }
.wheel-pick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wheel-pick .chip { background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.wheel-pick .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wheel-msg { text-align: center; min-height: 1.7em; font-size: 1.05em; margin: 0; }
.wheel-code { display: inline-block; direction: ltr; font-family: Consolas, monospace; background: #fff1f1; color: var(--accent-dark); border: 1px dashed var(--accent); border-radius: 8px; padding: 2px 10px; margin-top: 4px; letter-spacing: 1px; }
.coupons .coupon { display: flex; flex-direction: column; gap: 4px; border-inline-start: 5px solid var(--accent); }
.discount { color: #1b7f3b; } .warn { color: #9a5b00; }
.help, .help-box { color: var(--soft); font-size: .9em; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: middle; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.table-wrap { overflow-x: auto; }
.hm-wheel-overlay { position: absolute; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 12px; }
.hm-wheel-overlay .wheel-panel { background: #fff; border-radius: 18px; max-width: 460px; width: 100%; max-height: 96%; overflow: auto; position: relative; }
.hm-wheel-overlay .close { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 3; border-radius: 50%; width: 36px; height: 36px; padding: 0; }
.sec-ok { border-inline-start: 6px solid #1b7f3b; }
.sec-bad { border-inline-start: 6px solid #c62828; background: #fff5f5; }
.sec-files { direction: ltr; text-align: left; font-family: Consolas, monospace; font-size: 13px; max-height: 320px; overflow: auto; }
.cat-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cat-admin .card { align-items: center; text-align: center; }
.cat-admin .form { padding: 8px; border: 0; }
.vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.vital-card { border: 1px solid var(--border); border-radius: var(--r, 10px); padding: 12px 16px; }
.vital-card p { margin: 4px 0; padding: 4px 8px; border-radius: 6px; }
.g-good { background: #e8f6ec; } .g-mid { background: #fff6e0; } .g-bad { background: #fde8e8; } .g-na { background: #f5f5f7; }
code.sql { font-size: 12px; direction: ltr; display: inline-block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==== Page designer (admin) ==== */
body:has(.designer) main.page-w { max-width: none; padding: 0; }
body:has(.designer) .foot, body:has(.designer) .bottomnav { display: none; }
.designer { display: flex; flex-direction: column; height: calc(100vh - 110px); min-height: 560px; }
.dz-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fff; }
.dz-top select { min-width: 200px; }
.dz-pages { display: inline-flex; align-items: center; gap: 6px; }
.dz-sep { width: 1px; height: 24px; background: var(--border); }
.dz-grow { flex: 1; }
.dz-status { color: var(--soft); font-size: .85em; }
.icon-btn { padding: 6px 8px; }
.icon-btn.on { background: #f0f0f6; color: var(--text); }
.designer button.ghost, .designer .btn.ghost { color: var(--text); border: 1px solid var(--border); padding: 6px 10px; }
.designer button.ghost.danger { color: #b3261e; }
.dz-body { flex: 1; display: grid; grid-template-columns: 360px 1fr; min-height: 0; }
.dz-side { border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.dz-tabs { display: flex; border-bottom: 1px solid var(--border); }
.dz-tabs button { flex: 1; background: none; color: var(--soft); border-radius: 0; border-bottom: 2px solid transparent; padding: 10px 4px; font-size: .88em; }
.dz-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.dz-panel { overflow: auto; padding: 12px; flex: 1; }
.dz-tree, .dz-col { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dz-item { border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.dz-item.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.dz-item.off { opacity: .5; }
.dz-item.over { border-style: dashed; border-color: var(--accent); }
.dz-item.dragging { opacity: .4; }
.dz-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; }
.dz-drag { cursor: grab; color: #b5b5c0; display: inline-flex; }
.dz-name { flex: 1; background: none; color: var(--text); padding: 6px 4px; display: flex; align-items: center; gap: 6px; text-align: start; min-width: 0; }
.dz-name b { font-weight: 500; white-space: nowrap; }
.dz-name small { color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-acts { display: inline-flex; gap: 2px; }
.dz-acts button { background: none; color: var(--soft); padding: 4px; }
.dz-acts button:hover { color: var(--text); background: #f5f5f7; }
.dz-acts button.danger:hover { color: #b3261e; }
.dz-cols { display: grid; gap: 8px; padding: 0 8px 8px; }
.dz-empty { color: var(--soft); font-size: .85em; padding: 6px; border: 1px dashed var(--border); border-radius: 8px; text-align: center; }
.dz-addin { width: 100%; margin-top: 4px; font-size: .85em; }
.dz-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dz-palette button { background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; }
.dz-palette button:hover { border-color: var(--accent); filter: none; }
.dz-palette b { font-weight: 500; }
.dz-palette small { color: var(--soft); font-size: .75em; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#dz-add h3 { font-size: .9em; color: var(--soft); margin: 14px 0 6px; }
.dz-field { display: grid; gap: 4px; margin-bottom: 10px; font-size: .88em; }
.dz-field > span { color: var(--soft); }
.dz-field input[type=text], .dz-field input[type=number], .dz-field select, .dz-field textarea, .dz-field input[type=datetime-local] { width: 100%; }
.dz-color { display: flex; gap: 6px; align-items: center; }
.dz-color input { width: 56px; height: 34px; padding: 2px; }
.dz-sec { border-top: 1px solid var(--border); padding: 8px 0; }
.dz-sec > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.dz-back { margin-bottom: 8px; }
.dz-back .ic { transform: scaleX(-1); }
.dz-thumb img { max-width: 100%; max-height: 120px; border-radius: 8px; border: 1px solid var(--border); }
.dz-imgbtns { display: flex; flex-wrap: wrap; gap: 4px; }
.dz-items { border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin-bottom: 10px; display: grid; gap: 6px; }
.dz-items-title { font-weight: 500; font-size: .88em; }
.dz-item-box { border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; }
.dz-item-box summary { cursor: pointer; display: flex; align-items: center; gap: 4px; font-size: .85em; }
.dz-item-box summary small { flex: 1; color: var(--soft); }
.dz-stage { background: #eceef3; display: grid; place-items: start center; overflow: auto; padding: 16px; }
.dz-frame-wrap { width: 100%; height: 100%; background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,.08); transition: width .25s; }
.dz-frame-wrap.mobile { width: 390px; height: 100%; border-radius: 24px; overflow: hidden; border: 8px solid #23254e; }
.dz-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.dz-demo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 640px; }
.dz-demo button { padding: 0; background: none; border: 2px solid transparent; border-radius: 8px; overflow: hidden; }
.dz-demo button:hover { border-color: var(--accent); }
.dz-demo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.dz-versions { list-style: none; padding: 0; display: grid; gap: 6px; }
.dz-msg { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.dz-msg.done { opacity: .55; }
#dz-dialog { border: 0; border-radius: 14px; padding: 20px; max-width: min(92vw, 700px); }
#dz-dialog::backdrop { background: rgba(20,20,50,.45); }
#dz-dialog menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 12px 0 0; }
@media (max-width: 900px) { .dz-body { grid-template-columns: 1fr; } .dz-stage { min-height: 70vh; } .designer { height: auto; } }

/* Inside the designer's preview */
body.design-preview [data-blk] { outline: 1px dashed transparent; outline-offset: -1px; cursor: pointer; transition: outline-color .15s; }
body.design-preview [data-blk]:hover { outline-color: color-mix(in srgb, var(--accent) 60%, transparent); }
body.design-preview .dz-focus { outline: 2px solid var(--accent) !important; }

/* Full width (version 14.1): the page uses the whole screen; full-width banners go edge to edge. */
html, body { overflow-x: clip; }
@media (min-width: 761px) { .page-w { padding-inline: 24px; } }
.blk-slider.w-full, .blk-banners.w-full, .blk-image.w-full { padding-inline: 0; }
.blk-slider.w-full .slider, .blk-banners.w-full .banners > *, .blk-image.w-full .one-img img { border-radius: 0; }
.blk-slider.w-full .slide-cap { inset-inline-start: max(5%, 24px); }
@media (min-width: 1600px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }

/* Version 15: panel home, users, site settings */
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.panel-tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: var(--r, 10px); color: var(--text); background: #fff; transition: box-shadow .15s, border-color .15s; }
.panel-tile:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(20,20,50,.08); text-decoration: none; }
.panel-tile .ic { color: var(--accent); }
.panel-tile small { color: var(--soft); line-height: 1.6; }
.panel-tile .count { position: absolute; top: 12px; inset-inline-end: 12px; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 9px; font-size: .85em; }
.panel-alert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-inline-start: 6px solid #e0a100; background: #fff8e6; }
.panel-alert .btn { margin-inline-start: auto; }
.badge.role-admin { background: #23254e; color: #fff; } .badge.role-staff { background: #e3ecfb; color: #1f3f7a; }
.badge.role-vendor { background: #fff1f1; color: var(--accent); } .badge.role-buyer { background: #f0f0f3; color: var(--text); }
.danger-text { color: #b3261e; } tr.row-off td { opacity: .55; }
.perms { border: 1px solid var(--border); border-radius: var(--r, 10px); padding: 10px 12px; display: grid; gap: 4px; }
.copy-row { display: flex; gap: 8px; margin-bottom: 10px; } .copy-row input { flex: 1; font-family: Consolas, monospace; }
a.stat { color: var(--text); } a.stat:hover { text-decoration: none; border-color: var(--accent); }
