/* ==========================================================================
   Laayoune Deals — mobile-first, RTL stylesheet
   Logical properties (inline-start/end) keep the layout correct in RTL.
   ========================================================================== */

/* ---------- Fonts (self-hosted, subset by unicode-range) ---------- */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/cairo/cairo-arabic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/cairo/cairo-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/fonts/poppins/poppins-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --navy: #1E2A3A;          /* primary — from the logo */
  --navy-2: #2C3E57;
  --navy-50: #EEF2F7;
  --brand: #EE7A22;         /* brand orange — from the logo */
  --brand-600: #D9620F;
  --brand-50: #FFF4EA;
  --brand-ink: #B4530A;
  --cta: #10B981;           /* call-to-action & WhatsApp */
  --cta-600: #059669;
  --cta-50: #ECFDF5;
  --danger: #DC2626;
  --danger-50: #FEF2F2;
  --warn: #B45309;
  --warn-50: #FFFBEB;
  --info: #0E7490;          /* "مستعمل كالجديد" */
  --info-50: #ECFEFF;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .05), 0 1px 3px rgb(15 23 42 / .06);
  --shadow-md: 0 8px 24px rgb(15 23 42 / .08), 0 2px 6px rgb(15 23 42 / .05);
  --shadow-lg: 0 18px 48px rgb(15 23 42 / .16);
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --header-h: 112px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.35; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgb(238 122 34 / .55); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1232px; margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important;
  white-space: nowrap !important; border: 0 !important;
}
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100;
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }

.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding-inline: 18px;
  border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .65; pointer-events: none; }
.btn-cta, .btn-wa { background: var(--cta); color: #fff; box-shadow: 0 2px 8px rgb(16 185 129 / .28); }
.btn-cta:hover, .btn-wa:hover { background: var(--cta-600); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #FECACA; }
.btn-danger:hover { background: var(--danger-50); }
.btn-lg { height: 54px; font-size: 17px; border-radius: 14px; }
.btn-sm { height: 36px; padding-inline: 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-wa .i { width: 20px; height: 20px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; border: 0; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / .94);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid; align-items: center;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand cta" "search search";
  gap: 10px 12px; padding-block: 10px;
}
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.brand-icon { width: 36px; height: 31px; flex: none; }
.brand-text {
  font-family: 'Poppins', var(--font); font-weight: 700; font-size: 21px;
  letter-spacing: -.6px; color: var(--navy); white-space: nowrap; line-height: 1;
}
.brand-text b { font-weight: 700; }
.brand-text i { font-style: normal; color: var(--brand); }
.header-cta { grid-area: cta; height: 42px; padding-inline: 14px; }
.search { grid-area: search; position: relative; display: flex; }
.search input {
  width: 100%; height: 44px;
  padding-inline: 16px 48px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 15px;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.search input::placeholder { color: #94A3B8; }
.search input:focus { outline: none; background: #fff; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-50); }
.search button {
  position: absolute; inset-inline-end: 4px; top: 4px;
  width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: var(--navy); color: #fff; display: grid; place-items: center;
}
.search input::-webkit-search-cancel-button { display: none; }

@media (min-width: 900px) {
  .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search cta"; gap: 24px; padding-block: 14px; }
  .search { max-width: 620px; justify-self: center; width: 100%; }
  .brand-icon { width: 42px; height: 36px; }
  .brand-text { font-size: 24px; }
}

/* ---------- Hero ---------- */
.hero { margin-top: 16px; }
.hero-card {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 168px; border-radius: var(--radius-lg);
  background: var(--navy);
  display: flex; align-items: center;
}
.hero-card img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 55%; z-index: -2;
}
.hero-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(270deg, rgb(15 23 42 / .86) 0%, rgb(15 23 42 / .55) 50%, rgb(15 23 42 / .08) 100%);
}
.hero-text { padding: 20px; max-width: 560px; color: #fff; }
.hero h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.hero h1 span { color: #FFB067; }
.hero p { font-size: 14px; color: rgb(255 255 255 / .9); max-width: 34ch; }
@media (min-width: 768px) {
  .hero-card { min-height: 250px; }
  .hero-text { padding: 36px 44px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 17px; max-width: 42ch; }
}

/* ---------- Category chips ---------- */
.listings { margin-top: 18px; }
.cats {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding-block: 2px 4px; margin-inline: -16px; padding-inline: 16px;
  scroll-snap-type: x proximity;
}
.cats::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding-inline: 8px 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; font-size: 14px; color: var(--text); scroll-snap-align: start;
  transition: border-color .15s, background-color .15s, color .15s;
}
.cat-chip.sk { width: 120px; border: 0; }
.cat-chip:hover { border-color: var(--border-strong); }
.cat-chip .cat-ico {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-ink);
}
.cat-chip .cat-ico .i { width: 16px; height: 16px; }
.cat-chip .cat-count { color: var(--muted); font-weight: 500; font-size: 12px; }
.cat-chip[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-chip[aria-current="true"] .cat-ico { background: rgb(255 255 255 / .14); color: #FFB067; }
.cat-chip[aria-current="true"] .cat-count { color: rgb(255 255 255 / .7); }
@media (min-width: 900px) { .cats { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; } }

/* ---------- Filter bar ---------- */
.filters {
  display: flex; gap: 8px; margin-top: 10px;
  overflow-x: auto; scrollbar-width: none;
  margin-inline: -16px; padding: 2px 16px 6px;
}
.filters::-webkit-scrollbar { display: none; }
.pill {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding-inline: 12px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--text);
  transition: border-color .15s, background-color .15s;
}
.pill > .i { color: var(--muted); width: 16px; height: 16px; }
.pill select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  font-weight: 600; font-size: 14px; height: 100%;
  padding-inline: 0 18px; cursor: pointer; max-width: 170px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 0 center;
}
.pill select:focus { outline: none; }
.pill:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-50); }
.pill.is-active { border-color: var(--brand); background: var(--brand-50); }
.pill.is-active > .i { color: var(--brand-ink); }
.pill-reset { border-style: dashed; color: var(--muted); }
.pill-reset:hover { color: var(--danger); border-color: #FECACA; }

.pill-pop { padding: 0; }
.pill-pop > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
  height: 100%; padding-inline: 12px; cursor: pointer; white-space: nowrap;
}
.pill-pop > summary::-webkit-details-marker { display: none; }
.pill-pop > summary > .i { color: var(--muted); width: 16px; height: 16px; }
.pill-pop.is-active > summary > .i:first-child { color: var(--brand-ink); }
.pill-pop .i-chev { width: 12px; height: 12px; stroke-width: 2.5; }
.pop-panel {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 80;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); cursor: default;
  animation: sheet-up .2s ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.sheet-backdrop { position: fixed; inset: 0; z-index: 79; background: rgb(15 23 42 / .45); }
.pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-inputs label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.price-inputs input, .field input, .field select, .field textarea, .tax-add input, .tax-add select {
  width: 100%; height: 46px; padding-inline: 14px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: #fff; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.price-inputs input:focus, .field input:focus, .field select:focus, .field textarea:focus, .tax-add input:focus, .tax-add select:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-50);
}
.price-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.price-presets button {
  height: 34px; padding-inline: 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; font-weight: 600;
}
.price-presets button:hover { border-color: var(--brand); color: var(--brand-ink); }
.pop-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 16px; }

@media (min-width: 640px) {
  .filters { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .pop-panel {
    position: absolute; inset-inline: auto; inset-inline-start: 0; bottom: auto; top: calc(100% + 8px);
    width: 340px; border-radius: 16px; border: 1px solid var(--border); animation: none;
  }
  .sheet-backdrop { display: none !important; }
}

/* ---------- Results ---------- */
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.results-head h2 { font-size: 18px; font-weight: 800; color: var(--navy); }
.results-count { color: var(--muted); font-size: 14px; white-space: nowrap; }

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

.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:not(.sk-card):hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card.is-featured { border-color: #F6C79C; box-shadow: 0 0 0 1px #F6C79C, var(--shadow-sm); }
.card-link { display: flex; flex-direction: column; flex: 1; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-media img { transform: scale(1.03); }
.badge {
  position: absolute; top: 8px; z-index: 1;
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding-inline: 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1;
}
.badge .i { width: 12px; height: 12px; }
.badge-featured { inset-inline-start: 8px; background: linear-gradient(180deg, #F58A2E, #DF6514); color: #fff; box-shadow: 0 2px 6px rgb(226 96 26 / .35); }
.badge-featured .i { fill: currentColor; stroke: none; }
.badge-cond { inset-inline-end: 8px; background: rgb(255 255 255 / .94); color: var(--text); box-shadow: var(--shadow-sm); }
.badge-cond.is-new { color: var(--cta-600); }
.badge-cond.is-like-new { color: var(--info); }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 10px; flex: 1; }
.card-title {
  font-size: 14px; font-weight: 600; line-height: 1.55; min-height: 3.1em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-price { font-size: 17px; font-weight: 800; color: var(--navy); }
.card-price small { font-size: 13px; font-weight: 700; color: var(--muted); }
.card-price.is-ask { font-size: 14px; color: var(--brand-ink); }
.card-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); font-size: 12px; margin-top: auto; }
.card-meta span { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.card-meta .i { width: 13px; height: 13px; }
.card-meta .card-loc { max-width: 100%; }
.card-meta .card-loc > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-wa { margin: 0 10px 10px; height: 38px; font-size: 13px; padding-inline: 8px; border-radius: 10px; gap: 6px; }
.card-wa .i { width: 17px; height: 17px; }
@media (min-width: 640px) {
  .card-body { padding: 12px 14px; }
  .card-title { font-size: 15px; }
  .card-price { font-size: 18px; }
  .card-wa { margin: 0 14px 14px; height: 40px; font-size: 14px; }
}

/* ---------- Skeletons (speed rule #5) ---------- */
.sk {
  background: #E9EEF4; border-radius: 8px;
  animation: sk-pulse 1.3s ease-in-out infinite;
}
@keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.sk-card .card-media.sk { border-radius: 0; }
.sk-line { height: 13px; margin-block: 5px; width: 100%; }
.sk-sm { height: 10px; }
.sk-price { height: 18px; width: 45%; margin-top: 8px; }
.sk-title { height: 20px; }
.sk-bigprice { height: 34px; margin-block: 14px; }
.sk-btn { height: 38px; margin: 0 10px 10px; border-radius: 10px; }
.sk-btn-lg { height: 54px; margin: 16px 0 0; border-radius: 14px; }
.sk-crumb { display: inline-block; width: 90px; height: 12px; margin: 0; }
.sk-kpi { display: inline-block; width: 56px; height: 26px; vertical-align: middle; }
.w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-50 { width: 50%; }
.w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; }

/* ---------- Empty / error states ---------- */
.empty {
  grid-column: 1 / -1; text-align: center;
  padding: 40px 20px; background: var(--surface);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty-icon {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand-ink); margin-bottom: 12px;
}
.empty-icon .i { width: 30px; height: 30px; }
.empty h3, .empty-page h1 { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.empty p, .empty-page p { color: var(--muted); margin-bottom: 16px; }
.empty .success-actions { justify-content: center; }
.empty-page { text-align: center; padding: 40px 20px; margin-block: 32px; }

/* ---------- Pager ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin: 24px 0 8px; }
.pager:empty { display: none; }
.pg {
  min-width: 42px; height: 42px; padding-inline: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 700; font-size: 14px;
}
.pg:hover { border-color: var(--navy); }
.pg[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.pg[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.pg-gap { color: var(--muted); padding-inline: 4px; }

/* ---------- How it works / safety ---------- */
.how { margin-block: 36px 8px; }
.how-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .how-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .how-grid { grid-template-columns: repeat(4, 1fr); } }
.how-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.how-item h3 { font-size: 15px; font-weight: 800; color: var(--navy); margin-bottom: 2px; }
.how-item p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.how-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--cta-50); color: var(--cta-600);
}
.how-safety .how-icon { background: var(--brand-50); color: var(--brand-ink); }

/* ---------- Panels & forms ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
@media (min-width: 640px) { .panel { padding: 20px; } }

.post-head { margin: 24px 0 16px; }
.post-head h1 { font-size: 24px; font-weight: 800; color: var(--navy); }
.post-head p { color: var(--muted); margin-top: 4px; }
.form { display: grid; gap: 18px; margin-bottom: 32px; }
.row-2 { display: grid; gap: 18px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > label, .field > legend, .field > .label { font-weight: 700; font-size: 14px; padding: 0; }
.field em { color: var(--danger); font-style: normal; }
.field textarea { height: auto; padding-block: 12px; resize: vertical; min-height: 130px; line-height: 1.7; }
.field select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 14px center; }
.field .hint { color: var(--muted); font-size: 12px; }
.field .err { color: var(--danger); font-size: 13px; font-weight: 600; }
.field .err:empty { display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field.has-error .seg label span { border-color: #FECACA; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; font-size: 14px; }
.input-suffix input { padding-inline-end: 60px; text-align: right; }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.field-reveal:not([hidden]) { animation: reveal .2s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: grid; place-items: center; height: 46px; border-radius: 12px; padding-inline: 6px;
  border: 1px solid var(--border-strong); font-weight: 700; cursor: pointer; text-align: center; line-height: 1.3;
  transition: background-color .15s, border-color .15s, color .15s;
}
.seg input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgb(238 122 34 / .45); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 12px; color: var(--muted); text-align: center; }
.form-alert {
  display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--danger-50); color: #991B1B; border: 1px solid #FECACA; font-weight: 600; font-size: 14px;
}

/* Uploader */
.uploader { display: grid; gap: 10px; }
.drop {
  display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 16px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-50); }
.drop .i { width: 30px; height: 30px; color: var(--brand); }
.drop small { color: var(--muted); font-size: 12px; }
.uploader input:focus-visible + .previews, .uploader:focus-within .drop { border-color: var(--navy); }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.previews:empty { display: none; }
.preview { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview .cover-tag {
  position: absolute; bottom: 6px; inset-inline-start: 6px;
  background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; padding: 0 8px; border-radius: 999px;
}
.preview .rm {
  position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgb(15 23 42 / .72); color: #fff; display: grid; place-items: center;
}
.preview .rm .i { width: 14px; height: 14px; }
.preview.is-busy::after { content: ""; position: absolute; inset: 0; background: rgb(255 255 255 / .6); }
.preview .size { position: absolute; bottom: 6px; inset-inline-end: 6px; font-size: 10px; background: rgb(255 255 255 / .9); padding: 0 6px; border-radius: 999px; direction: ltr; }

.success { text-align: center; padding: 32px 20px; margin-block: 24px 40px; }
.success-icon {
  display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: var(--cta-50); color: var(--cta-600); margin-bottom: 14px;
}
.success-icon .i { width: 36px; height: 36px; stroke-width: 2.5; }
.success h2 { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.success p { color: var(--muted); margin-bottom: 6px; }
.success-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- Ad details ---------- */
.ad-page { padding-bottom: 96px; }
@media (min-width: 900px) { .ad-page { padding-bottom: 24px; } }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 16px 0 12px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--navy); text-decoration: underline; }
.crumbs .i { width: 14px; height: 14px; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

.ad-layout { display: grid; gap: 14px; grid-template-areas: "gallery" "side" "desc"; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .ad-layout { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "gallery side" "desc side"; gap: 20px; align-items: start; }
  .ad-side { position: sticky; top: calc(var(--header-h) - 24px); }
}
.ad-gallery-wrap { grid-area: gallery; min-width: 0; }
.ad-side { grid-area: side; display: grid; gap: 14px; }
.ad-desc { grid-area: desc; }

.gallery-main { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; }
.slide img { width: 100%; height: 100%; object-fit: contain; }
.gallery-count {
  position: absolute; bottom: 10px; inset-inline-start: 10px;
  background: rgb(15 23 42 / .7); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; direction: ltr;
}
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgb(255 255 255 / .92); box-shadow: var(--shadow-md); display: none; place-items: center; color: var(--navy);
}
.gallery-nav.prev { inset-inline-start: 10px; }
.gallery-nav.next { inset-inline-end: 10px; }
@media (hover: hover) and (min-width: 640px) { .gallery-main:hover .gallery-nav { display: grid; } }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.thumb {
  flex: none; width: 76px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; padding: 0;
  border: 2px solid transparent; background: var(--surface-2); opacity: .75; transition: opacity .15s, border-color .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--brand); opacity: 1; }
.thumb:hover { opacity: 1; }

.ad-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding-inline: 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text);
}
.tag .i { width: 13px; height: 13px; }
.tag-featured { background: var(--brand-50); color: var(--brand-ink); }
.tag-featured .i { fill: currentColor; stroke: none; }
.tag-new { background: var(--cta-50); color: var(--cta-600); }
.tag-like-new { background: var(--info-50); color: var(--info); }
.tag-status { background: var(--warn-50); color: var(--warn); }
.tag-sold { background: var(--text); color: #fff; }
.sold-note {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 14px;
  border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 700; text-align: center;
}
.sold-note .i { color: var(--cta-600); flex: none; }
.ad-layout.is-sold .gallery-main img { filter: grayscale(.6); }
.mobile-bar .mb-sold { flex: none; padding: 10px 16px; border-radius: 12px; background: var(--text); color: #fff; font-weight: 800; }
.ad-title { font-size: 21px; font-weight: 800; color: var(--text); }
.ad-price { font-size: 30px; font-weight: 800; color: var(--navy); margin: 8px 0 4px; line-height: 1.3; }
.ad-price small { font-size: 17px; color: var(--muted); }
.ad-price.is-ask { font-size: 20px; color: var(--brand-ink); }
.ad-meta-row { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.ad-meta-row span { display: inline-flex; align-items: center; gap: 4px; }
.ad-meta-row .i { width: 15px; height: 15px; }
.ad-actions { display: grid; gap: 10px; }

.seller { display: flex; align-items: center; gap: 12px; }
.avatar {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #FF9A2E, #E2601A); color: #fff; font-weight: 800; font-size: 20px;
}
.seller strong { display: block; font-size: 15px; }
.seller span { color: var(--muted); font-size: 13px; }
.side-h { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.side-h .i { color: var(--brand); }
.loc-place { font-weight: 700; }
.loc-note { margin-top: 4px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.loc-hint { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.tips ul { margin: 0; padding-inline-start: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.tips li::marker { color: var(--brand); }

.ad-desc h2 { font-size: 17px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.ad-desc .desc-text { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.9; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
@media (min-width: 640px) { .specs { grid-template-columns: repeat(4, 1fr); } }
.specs div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.specs dt { font-size: 12px; color: var(--muted); }
.specs dd { margin: 0; font-weight: 700; font-size: 14px; }

.similar { margin-top: 32px; }
.similar h2 { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 12px; }

.mobile-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgb(255 255 255 / .97); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgb(15 23 42 / .08);
}
.mobile-bar .mb-price { flex: 1; min-width: 0; font-weight: 800; color: var(--navy); font-size: 17px; line-height: 1.2; }
.mobile-bar .mb-price small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar .btn { height: 48px; flex: none; }
@media (min-width: 900px) { .mobile-bar { display: none !important; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; background: var(--navy); color: rgb(255 255 255 / .78); }
.footer-inner { display: grid; gap: 20px; padding-block: 28px 18px; }
@media (min-width: 768px) { .footer-inner { grid-template-columns: 1.5fr 1fr 1.3fr; align-items: start; gap: 32px; } }
.footer-about p { margin-top: 10px; font-size: 14px; max-width: 52ch; }
.site-footer .brand-text { color: #fff; }
.footer-h { font-size: 15px; font-weight: 800; color: #fff; }
.footer-links { display: grid; gap: 8px; align-content: start; font-weight: 600; font-size: 14px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-support { display: grid; gap: 10px; align-content: start; }
.footer-support p { font-size: 14px; }
.support-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); color: #fff;
  transition: background-color .15s, border-color .15s;
}
.support-link:hover { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .22); }
.support-link:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.support-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.support-ico .i { width: 20px; height: 20px; }
.support-ico.is-wa { background: #25D366; }
.support-ico.is-ig { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); }
.support-text { display: grid; line-height: 1.4; text-align: right; }
.support-text strong { font-size: 14px; }
.support-text bdi { font-size: 14px; color: rgb(255 255 255 / .82); letter-spacing: .02em; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 14px 22px; border-top: 1px solid rgb(255 255 255 / .1); font-size: 13px; }
.page-ad .site-footer { margin-bottom: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; z-index: 100;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #991B1B; }
.page-ad .toast { bottom: 92px; }

/* ---------- Admin login ---------- */
.page-login { background: radial-gradient(circle at 70% 10%, #FFF1E2 0, transparent 45%), var(--bg); }
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 400px; display: grid; gap: 16px; padding: 28px 22px; }
.login-card .brand { justify-self: center; }
.login-card h1 { text-align: center; font-size: 20px; font-weight: 800; color: var(--navy); }
.login-card > .muted { text-align: center; margin-top: -10px; font-size: 14px; }
.back-link { justify-self: center; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--navy); }

/* ---------- Admin dashboard ---------- */
.admin-header-inner { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.admin-badge { background: var(--navy-50); color: var(--navy); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.admin-nav { margin-inline-start: auto; display: flex; gap: 8px; }
@media (max-width: 560px) {
  .admin-badge, .admin-nav .btn span { display: none; }
  .admin-nav .btn { width: 40px; padding: 0; }
  .admin-header .brand-text { font-size: 18px; }
}
.admin-main { padding-block: 20px 40px; }
.admin-title { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.kpi {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.kpi-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); }
.kpi-warn .kpi-icon { background: var(--warn-50); color: var(--warn); }
.kpi-ok .kpi-icon { background: var(--cta-50); color: var(--cta-600); }
.kpi-star .kpi-icon { background: var(--brand-50); color: var(--brand-ink); }
.kpi-label { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-value { display: block; font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--text); }

.tabs { display: flex; gap: 4px; margin: 22px 0 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding-inline: 14px; border: 0; background: none;
  font-weight: 700; font-size: 14px; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--brand); }
.tab-count { background: var(--warn-50); color: var(--warn); font-size: 12px; min-width: 22px; height: 22px; padding-inline: 6px; border-radius: 999px; display: inline-grid; place-items: center; }
.tab-count:empty { display: none; }

.admin-panel { padding: 0; overflow: hidden; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.admin-toolbar h2 { font-size: 16px; font-weight: 800; color: var(--navy); }
.admin-search { position: relative; flex: 1; max-width: 320px; min-width: 200px; }
.admin-search .i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.admin-search input { width: 100%; height: 40px; padding-inline: 38px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.admin-search input:focus { outline: none; border-color: var(--navy); background: #fff; }

.mod-row { display: grid; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.mod-row:last-child { border-bottom: 0; }
.mod-row.is-leaving { opacity: 0; transform: translateX(-12px); transition: opacity .25s, transform .25s; }
.mod-main { display: flex; gap: 12px; min-width: 0; }
.mod-thumb { flex: none; width: 96px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); position: relative; }
.mod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mod-thumb .img-count { position: absolute; bottom: 4px; inset-inline-start: 4px; background: rgb(15 23 42 / .72); color: #fff; font-size: 11px; padding: 0 6px; border-radius: 999px; }
.mod-info { min-width: 0; flex: 1; }
.mod-title { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mod-title a:hover { color: var(--brand-ink); text-decoration: underline; }
.mod-excerpt { color: var(--muted); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mod-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.mod-meta span { display: inline-flex; align-items: center; gap: 3px; }
.mod-meta .i { width: 13px; height: 13px; }
.mod-meta .mod-price { color: var(--navy); font-weight: 800; font-size: 13px; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-actions .btn { height: 36px; padding-inline: 12px; font-size: 13px; border-radius: 10px; }
.btn-star.is-on { background: var(--brand-50); border-color: #F6C79C; color: var(--brand-ink); }
.btn-star.is-on .i { fill: currentColor; }
@media (min-width: 900px) {
  .mod-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .mod-actions { justify-content: flex-end; max-width: 380px; }
}
.mod-empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.mod-empty .empty-icon { background: var(--cta-50); color: var(--cta-600); }
.mod-empty strong { display: block; color: var(--navy); font-size: 16px; }
.admin-panel .pager { padding-bottom: 16px; margin-top: 16px; }

.taxonomy { display: grid; gap: 16px; }
.taxonomy { max-width: 760px; }
.tax-panel h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 12px; }
.tax-panel h2 .i { color: var(--brand); }
.tax-add { display: flex; gap: 8px; margin-bottom: 12px; }
.tax-add input { flex: 1; min-width: 0; height: 42px; }
.tax-add select { width: auto; height: 42px; padding-inline: 10px; }
.tax-add .btn { height: 42px; }
.tax-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tax-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; }
.tax-item .tax-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-ink); flex: none; }
.tax-item .tax-ico .i { width: 16px; height: 16px; }
.tax-name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tax-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tax-item .icon-btn.danger:hover { color: var(--danger); background: var(--danger-50); }
.tax-item .icon-btn.is-locked { opacity: .45; cursor: default; }
.tax-item .icon-btn.is-locked:hover { background: transparent; color: var(--muted); }
.tax-name small { font-weight: 600; font-size: 12px; }
.tax-note { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* Phones zoom into inputs smaller than 16px on focus (iOS Safari). Keep form text at 16px there. */
@media (max-width: 899px) {
  input, select, textarea, .pill select, .search input, .price-inputs input, .admin-search input { font-size: 16px !important; }
}

/* ---------- Print & motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}
