/* ================================
   Habiba Mousa Couture — Design Tokens
   Direction: Arabic-inspired luxury (khaleeji)
   Palette: pomegranate maroon, aubergine-black, antique gold, jewel turquoise, warm parchment
   Type: El Messiri (display, Arabic/Latin geometric serif) + Jost (body/utility)
   Signature: pointed-arch (iwan) silhouettes + woven "sadu" diamond dividers + faint mashrabiya trellis texture
   ================================ */

:root {
  --ink: #1c1013;              /* aubergine-black — dark decorative surfaces (hero/footer/sidebar), unchanged by theme */
  --emerald: #6e1f2f;           /* pomegranate maroon (primary jewel tone) */
  --emerald-deep: #4a121f;      /* deeper maroon */
  --gold: #c9973f;
  --gold-soft: #e3c179;
  --ivory: #f7efe0;             /* warm parchment — light text on dark surfaces, unchanged by theme */
  --rose: #b97b6c;              /* terracotta rose */
  --turquoise: #1f6e6a;         /* secondary jewel accent, used sparingly */
  --charcoal: #2c211f;          /* primary body text — flips in dark mode */
  --line: rgba(201, 151, 63, 0.4);

  /* Theme-aware page-chrome tokens (light values here; dark values in the [data-theme="dark"] block below) */
  --heading: #1c1013;
  --page-bg: #f7efe0;
  --header-bg: rgba(247, 239, 224, 0.92);
  --surface: #ffffff;
  --surface-muted: #f3ece0;
  --text-muted: #5a4a45;
  --text-faint: #8a7a72;
  --border-soft: #eee0c9;
  --input-border: #d8c9a8;
  --row-hover: #fbf6ea;
  --glass-surface: rgba(255, 255, 255, 0.68);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-sidebar: rgba(28, 16, 19, 0.82);
  --emerald-text: var(--emerald); /* dark maroon reads fine as text on light surfaces */

  --font-display: "El Messiri", "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Jost", "Helvetica Neue", sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
}

:root[data-theme="dark"] {
  --charcoal: #ece4d8;
  --heading: #f3ece0;
  --page-bg: #1a1113;
  --header-bg: rgba(26, 17, 19, 0.88);
  --surface: #241a1c;
  --surface-muted: #2c2224;
  --text-muted: #c9bdb0;
  --text-faint: #9c8f86;
  --border-soft: rgba(201, 151, 63, 0.22);
  --input-border: rgba(201, 151, 63, 0.32);
  --row-hover: rgba(201, 151, 63, 0.07);
  --glass-surface: rgba(36, 26, 28, 0.6);
  --glass-border: rgba(201, 151, 63, 0.22);
  --glass-sidebar: rgba(20, 13, 15, 0.75);
  --emerald-text: var(--rose); /* dark maroon is unreadable on dark surfaces — use the brighter rose instead */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--page-bg);
  background-image:
    repeating-linear-gradient(45deg, rgba(201,151,63,0.055) 0, rgba(201,151,63,0.055) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(-45deg, rgba(201,151,63,0.055) 0, rgba(201,151,63,0.055) 1px, transparent 1px, transparent 42px);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Utility ---------- */

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.eyebrow::before {
  content: "◆ ";
  font-size: 9px;
  vertical-align: middle;
  color: var(--turquoise);
}

/* Signature divider: woven "sadu" diamond trim, replaces a plain dashed rule */
.stitch-line {
  border: none;
  height: 1px;
  margin: var(--space-4) 0;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  opacity: 0.5;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

a { color: inherit; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.brand {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--heading);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo { height: 36px; width: auto; display: block; border-radius: 50%; }

.brand em {
  font-style: normal;
  color: var(--emerald-text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-wrap: nowrap;
}

.nav-links a { white-space: nowrap; }

.lang-toggle {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.lang-toggle button {
  border: none;
  background: transparent;
  color: var(--charcoal);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  cursor: pointer;
}
.lang-toggle button.active {
  background: var(--ink);
  color: var(--gold-soft);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  font-size: 14px;
  padding: 0;
}

.nav-links a { text-decoration: none; color: var(--charcoal); position: relative; }
.nav-links a:hover { color: var(--emerald-text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */

.hero {
  background: var(--ink);
  color: var(--ivory);
  padding: var(--space-6) 0 var(--space-5);
  position: relative;
  overflow: hidden;
}

.hero::after {
  /* faint radial glow, jewel-toned */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 15%, rgba(201,151,63,0.18), transparent 55%),
    radial-gradient(ellipse at 8% 95%, rgba(110,31,47,0.5), transparent 55%);
  pointer-events: none;
}

.hero::before {
  /* pointed-arch (iwan) silhouette, the signature shape, echoed top-right —
     filled with a faint mashrabiya-style lattice so the arch doesn't read as empty space */
  content: "";
  position: absolute;
  top: -120px;
  right: -60px;
  width: 340px;
  height: 460px;
  background:
    linear-gradient(180deg, rgba(201,151,63,0.14), rgba(201,151,63,0.03)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 0L56 28L28 56L0 28Z' fill='none' stroke='rgba(201,151,63,0.3)' stroke-width='1'/%3E%3Ccircle cx='28' cy='28' r='3' fill='rgba(201,151,63,0.25)'/%3E%3C/svg%3E");
  background-size: cover, 56px 56px;
  border: 1px solid rgba(201,151,63,0.3);
  border-radius: 170px 170px 0 0;
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: var(--space-5);
  align-items: end;
  position: relative;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.08;
  margin: var(--space-2) 0 var(--space-3);
  font-weight: 500;
}

.hero-title em { color: var(--gold-soft); font-style: normal; }

.hero-sub {
  font-size: 17px;
  color: rgba(247,239,224,0.78);
  max-width: 46ch;
  margin-bottom: var(--space-4);
}

/* spec-card styled as a majlis niche: arched top, gold trim, small diamond dividers */
.spec-card {
  border: 1px solid var(--line);
  border-radius: 90px 90px 4px 4px;
  padding: var(--space-4) var(--space-3) var(--space-3);
  font-size: 13px;
  color: rgba(247,239,224,0.85);
  position: relative;
}
.spec-card::before {
  content: "✦";
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 14px;
}

.spec-card dt {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-soft);
  font-size: 11px;
  margin-top: var(--space-2);
}
.spec-card dt:first-child { margin-top: 0; }
.spec-card dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 18px; }

.how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  counter-reset: how-step-counter;
}
.how-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft, var(--line));
  border-radius: 12px;
  padding: var(--space-4) var(--space-3) var(--space-3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  counter-increment: how-step-counter;
}
.how-step:hover { transform: translateY(-4px); box-shadow: 0 18px 34px -22px rgba(28,16,19,0.4); }
.how-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--ink));
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: var(--space-2);
}
.how-step-num::before { content: counter(how-step-counter); }
.how-step h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--heading);
}
.how-step p { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }

/* Connecting line between steps on wide screens, giving the row a "journey" feel */
@media (min-width: 860px) {
  .how-steps { position: relative; }
  .how-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 34px;
    inset-inline-end: calc(-1 * var(--space-3) / 2 - 1px);
    width: var(--space-3);
    height: 1px;
    background: var(--line);
  }
}
@media (max-width: 700px) {
  .how-steps { grid-template-columns: 1fr; }
}

.btn {
  display: inline-block;
  padding: 14px 30px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--ivory);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, clip-path 0.2s ease;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn:hover { background: var(--gold); color: var(--heading); }

.btn-solid {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--ivory);
}
.btn-solid:hover { background: var(--emerald-deep); border-color: var(--emerald-deep); color: var(--ivory); }

.btn:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Gallery ---------- */

.gallery-section { padding: var(--space-6) 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.section-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  margin: 4px 0 0;
  color: var(--heading);
}

.filter-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 11px 36px 11px 18px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c9973f' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}
[dir="rtl"] .filter-select {
  padding: 11px 18px 11px 36px;
  background-position: left 16px center;
}
.filter-select:focus { outline: none; border-color: var(--gold); }
.filter-select:hover { border-color: var(--gold); }

.filter-chip {
  border: 1px solid var(--line);
  background: transparent;
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--charcoal);
  text-transform: uppercase;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.filter-chip.active { background: var(--ink); color: var(--gold-soft); border-color: var(--ink); }

.filter-chip.filter-chip-sale {
  margin-inline-start: auto;
  border-color: #b8283a;
  color: #b8283a;
  font-weight: 700;
  border-radius: 22px;
  clip-path: none;
  min-height: 44px;
  padding: 11px 20px;
}
.filter-chip.filter-chip-sale.active { background: linear-gradient(135deg, #e2483e, #b8283a); color: #fff; border-color: #b8283a; }

/* Leaflet's own CSS puts its zoom controls/panes at z-index up to 1000, and since
   .leaflet-container is position:relative with no z-index of its own, that value
   escapes into the page's stacking context instead of staying scoped to the map —
   letting the map float above modals (z-index 100). Giving the container an explicit
   z-index establishes its own stacking context so Leaflet's internals stay contained. */
#locationMap {
  height: 240px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-top: 8px;
  position: relative;
  z-index: 0;
}

#shopLocationMap {
  height: 280px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-top: 20px;
  position: relative;
  z-index: 0;
}

.toast-container {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 12px 30px -10px rgba(28,16,19,0.4);
  font-size: 13.5px;
  color: var(--text-muted);
  animation: toast-in 0.25s ease;
}
.toast.toast-error { border-color: #b8283a; color: #b8283a; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Success confirmation ---------- */

.success-modal { text-align: center; max-width: 360px; }
.success-modal h3 { font-family: var(--font-display); font-size: 22px; margin: 4px 0 6px; color: var(--heading); }
.success-modal p { color: var(--text-muted); margin: 0 0 20px; }
.success-check { width: 76px; height: 76px; margin: 0 auto 12px; display: block; }
.success-check-circle {
  stroke: var(--emerald-text);
  stroke-width: 2;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: success-circle 0.5s ease forwards;
}
.success-check-mark {
  stroke: var(--emerald-text);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: success-mark 0.35s 0.45s ease forwards;
}
@keyframes success-circle { to { stroke-dashoffset: 0; } }
@keyframes success-mark { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .success-check-circle, .success-check-mark { animation: none; stroke-dashoffset: 0; }
}

.my-account-form h4 { font-family: var(--font-display); font-size: 16px; margin: 0 0 4px; }
.my-account-divider { border: none; border-top: 1px solid var(--border-soft); margin: 20px 0; }
.my-requests-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 16px 0 8px;
}
.my-requests-group-title:first-child { margin-top: 0; }
.my-requests-more-btn { display: block; margin: 10px 0 4px; font-size: 13px; }

/* ---------- Floating actions ---------- */

.floating-actions {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 150;
}
.floating-whatsapp {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transition: transform 0.2s ease;
}
.floating-whatsapp:hover { transform: scale(1.08); }
.floating-whatsapp svg { width: 28px; height: 28px; fill: #fff; }
.scroll-jump-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold-soft);
  border: 1px solid var(--gold);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.scroll-jump-btn:hover { transform: translateY(-2px); }
@media (max-width: 700px) {
  .floating-actions { bottom: 16px; inset-inline-end: 14px; }
  .floating-whatsapp { width: 48px; height: 48px; }
  .floating-whatsapp svg { width: 24px; height: 24px; }
  .scroll-jump-btn { width: 38px; height: 38px; }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .hero .container { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

.piece-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 10px -6px rgba(28,16,19,0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.5s ease;
}
.piece-card.reveal-hidden, .how-step.reveal-hidden { opacity: 0; transform: translateY(18px); }
.piece-card.reveal-visible, .how-step.reveal-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .piece-card.reveal-hidden, .how-step.reveal-hidden { opacity: 1; transform: none; }
}
.piece-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(28,16,19,0.4); }

.piece-media {
  aspect-ratio: 3/4;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 15px;
  overflow: hidden;
  position: relative;
}
.piece-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}
.piece-card:hover .piece-media img { transform: scale(1.04); }

.piece-body { padding: var(--space-3) var(--space-2) var(--space-3); }
.piece-eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.piece-name { font-family: var(--font-display); font-size: 20px; margin: 6px 0 8px; line-height: 1.25; }
.piece-desc { font-size: 13.5px; color: var(--text-muted); margin: 0 0 10px; }
.piece-price { font-size: 14px; color: var(--emerald-text); font-weight: 600; }
.piece-price-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 8px; }
.piece-price-original { font-size: 12.5px; color: var(--text-faint); text-decoration: line-through; white-space: nowrap; }
.piece-price-sale { font-size: 17px; color: var(--emerald-text); font-weight: 700; white-space: nowrap; }
.piece-price-off {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ivory);
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.sale-badge {
  position: absolute;
  top: 12px;
  left: -6px;
  background: linear-gradient(135deg, #e2483e, #b8283a);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px 5px 18px;
  z-index: 2;
  box-shadow: 0 3px 10px -2px rgba(0,0,0,0.45);
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%);
  animation: sale-pulse 2.2s ease-in-out infinite;
}
@keyframes sale-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.piece-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}
.piece-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(28,16,19,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}
.piece-action-btn:hover { background: rgba(28,16,19,0.75); transform: scale(1.08); }
.piece-action-btn svg { width: 16px; height: 16px; fill: var(--ivory); }
.piece-like-btn.liked svg { fill: #e2483e; }
.piece-collection-tag { color: var(--text-faint); text-transform: none; letter-spacing: 0; font-size: 11px; }

.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-3);
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 20px;
}
.empty-state #clearFiltersBtn { font-family: var(--font-body); font-size: 14px; margin-top: 10px; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 16, 19, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-2);
}
.modal-backdrop.open { display: flex; }

.modal.modal-wide { max-width: 680px; }

.request-thumb {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  display: block;
}
.request-thumb-empty {
  background: var(--surface);
  border: 1px dashed var(--glass-border);
}
@media (max-width: 700px) {
  .request-thumb, .request-thumb-empty {
    width: 56px;
    height: 74px;
  }
}

.modal {
  background: var(--glass-surface);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-4);
  position: relative;
  border-top: 3px solid var(--gold);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.modal::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: none;
  border: none;
  font-size: 22px;
  color: var(--charcoal);
  line-height: 1;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 30px;
  margin: 0 0 4px;
}

.modal .modal-piece-name { color: var(--emerald-text); font-family: var(--font-display); font-size: 20px; margin-bottom: var(--space-3); }

.field { margin-bottom: var(--space-2); }
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--input-border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--charcoal);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 90px; }

.form-note { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; margin-bottom: var(--space-2); line-height: 1.5; }
.field-hint { font-size: 11px; font-weight: 400; color: var(--text-faint); text-transform: none; letter-spacing: 0; }

.submit-row { margin-top: var(--space-3); }

.form-status {
  margin-top: var(--space-2);
  font-size: 13.5px;
  padding: 10px 12px;
  display: none;
}
.form-status.success { display: block; background: rgba(46,125,79,0.14); color: #3a9463; font-weight: 600; animation: form-status-in 0.3s ease; }
.form-status.error { display: block; background: rgba(224,82,82,0.14); color: #e05252; font-weight: 600; animation: form-status-in 0.3s ease; }
@keyframes form-status-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(247,239,224,0.65);
  padding: var(--space-4) 0;
  text-align: center;
  font-size: 13px;
}
.site-footer a { color: var(--gold-soft); text-decoration: none; }

/* ---------- Admin ---------- */

.admin-body {
  background-color: var(--surface-muted);
  background-image:
    repeating-linear-gradient(45deg, rgba(201,151,63,0.05) 0, rgba(201,151,63,0.05) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(-45deg, rgba(201,151,63,0.05) 0, rgba(201,151,63,0.05) 1px, transparent 1px, transparent 42px);
}

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 220px;
  background: var(--glass-sidebar);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  color: var(--ivory);
  padding: var(--space-3) var(--space-2);
  flex-shrink: 0;
  border-right: 1px solid rgba(201,151,63,0.25);
}

.admin-sidebar .brand { color: var(--ivory); font-size: 20px; }
.admin-sidebar .brand em { color: var(--gold-soft); }

.admin-nav {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-nav button {
  text-align: left;
  background: none;
  border: none;
  color: rgba(247,239,224,0.7);
  padding: 10px 12px;
  font-size: 14px;
  letter-spacing: 0.03em;
}
.admin-nav button.active { background: rgba(201,151,63,0.16); color: var(--gold-soft); }
.admin-nav button:hover { color: var(--ivory); }

.admin-main { flex: 1; padding: var(--space-4); max-width: 1100px; }

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.admin-topbar h1 { font-family: var(--font-display); font-size: 30px; margin: 0; color: var(--heading); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.stat-tile { text-align: center; padding: var(--space-3) var(--space-2); }
.stat-number { font-family: var(--font-display); font-size: 40px; margin: 0; color: var(--emerald-text); }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin: 6px 0 0; }
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.whoami { font-size: 13px; color: var(--text-faint); }

/* ---------- Activity Log ---------- */

.activity-filters {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: var(--space-2);
}
.activity-filters .field { max-width: 200px; margin-bottom: 0; }

.activity-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.activity-row:last-child { border-bottom: none; }
.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.activity-thumb {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-action { font-weight: 600; color: var(--heading); font-size: 14px; }
.activity-target { font-size: 13.5px; color: var(--text-muted); margin-top: 1px; }
.activity-meta { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.activity-row-actions { display: flex; gap: 10px; flex-shrink: 0; }
@media (max-width: 700px) {
  .activity-row { flex-wrap: wrap; }
  .activity-body { flex-basis: 100%; order: 3; }
}

.status-pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
}
.status-new { background: #ece0f2; color: #6a3f8f; }
.status-contacted { background: #fbe8c9; color: #a5680f; }
.status-confirmed { background: #e2ece2; color: var(--emerald-deep); }
.status-in_progress { background: #d8ece9; color: var(--turquoise); }
.status-delivered { background: #e6e0d8; color: #665a52; }
.status-cancelled { background: #f6dcdc; color: #a13a3a; }

table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; color: var(--charcoal); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 600; }
tr:hover td { background: var(--row-hover); }

select.status-select {
  padding: 6px 8px;
  border: 1px solid var(--input-border);
  font-size: 13px;
  background: var(--surface);
  color: var(--charcoal);
}

.admin-card {
  background: var(--glass-surface);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-border);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.settings-section summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--heading);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.settings-section summary::-webkit-details-marker { display: none; }
.settings-section summary::after {
  content: "▾";
  color: var(--gold);
  font-size: 14px;
  transition: transform 0.2s ease;
  margin-inline-start: 12px;
}
.settings-section[open] summary::after { transform: rotate(180deg); }
.settings-section summary:hover { color: var(--gold); }
.settings-section > .product-form-grid,
.settings-section > .field,
.settings-section > p.form-note {
  margin-top: var(--space-3);
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  height: 320px;
  background: radial-gradient(ellipse at center, rgba(201,151,63,0.18), transparent 70%);
  pointer-events: none;
}
.login-card {
  background: var(--glass-surface);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  padding: var(--space-4);
  width: 100%;
  max-width: 380px;
  border-top: 3px solid var(--gold);
  position: relative;
}
.login-card h2 { font-family: var(--font-display); font-size: 28px; margin-top: 0; color: var(--heading); }

.btn-block { width: 100%; text-align: center; margin-top: var(--space-2); }

.product-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
@media (max-width: 700px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .product-form-grid { grid-template-columns: 1fr; }

  /* Responsive tables: each row becomes a stacked card instead of a wide
     scrolling table, so nothing needs horizontal scrolling on a phone. */
  .admin-card table, .admin-card thead, .admin-card tbody, .admin-card th, .admin-card td, .admin-card tr {
    display: block;
  }
  .admin-card thead { position: absolute; top: -9999px; left: -9999px; }
  .admin-card table { width: 100%; }
  .admin-card tr {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    margin-bottom: var(--space-2);
    padding: 8px 12px;
  }
  .admin-card td {
    border-bottom: 1px solid var(--border-soft);
    padding: 10px 0;
    text-align: right;
  }
  .admin-card td:last-child { border-bottom: none; }
  .admin-card td[data-label]::before {
    content: attr(data-label);
    float: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-right: 12px;
  }
}

.icon-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--emerald-text);
  text-decoration: underline;
  padding: 0;
  margin-right: 10px;
}
.icon-btn.danger { color: #a13a3a; }

.quick-sale-btn, #clearSaleBtn {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 10px;
  margin-right: 0;
  font-weight: 600;
}
.quick-sale-btn:hover { background: var(--surface-muted); }
#clearSaleBtn.icon-btn.danger { border-color: rgba(161,58,58,0.4); }

/* ---------- Mobile nav toggle ---------- */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--heading);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--charcoal);
  cursor: pointer;
}
.btn-link:hover { color: var(--emerald-text); }

.account-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.account-signed-in { display: inline-flex; align-items: center; gap: var(--space-2); }

@media (max-width: 1200px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 45;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px -12px rgba(28,16,19,0.35);
    padding: var(--space-2) var(--space-3) var(--space-3);
    display: none;
  }
  .nav-links.open { display: flex; }
  .account-nav, .account-signed-in { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- Product detail (modal) ---------- */

.detail-carousel {
  position: relative;
  aspect-ratio: 3/4;
  margin: 0 0 var(--space-3);
  background: var(--surface-muted);
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.detail-carousel-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 16px;
  cursor: zoom-in;
}
.detail-carousel-image img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(28,16,19,0.6);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.detail-carousel:hover .zoom-hint { opacity: 1; }

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(28,16,19,0.55);
  color: var(--ivory);
  font-size: 20px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(247,239,224,0.5);
}
.carousel-dot.active { background: var(--gold); }

/* ---------- Image lightbox ---------- */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,6,7,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-3);
}
.lightbox-backdrop.open { display: flex; }
.lightbox-backdrop img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.lightbox-backdrop .modal-close { color: var(--ivory); }

.detail-description { font-size: 14.5px; color: var(--text-muted); margin: 10px 0 0; }

.back-link {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: var(--space-2);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--emerald-text);
  cursor: pointer;
}

/* ---------- Account modal ---------- */

.account-tabs {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.account-tab {
  background: none;
  border: none;
  padding: 8px 0 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  cursor: pointer;
  position: relative;
}
.account-tab.active { color: var(--emerald-text); }
.account-tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--gold);
}

.password-input-wrap { position: relative; }
.password-input-wrap input { padding-inline-end: 42px; }
.password-toggle-btn {
  position: absolute;
  top: 50%;
  inset-inline-end: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--text-faint);
  padding: 6px;
}
.password-toggle-btn:hover { color: var(--gold); }

.remember-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-2);
}
.remember-field input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--gold); }
.remember-field label {
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  display: inline;
  cursor: pointer;
}

.google-signin-btn {
  display: block;
  width: 100%;
  text-align: center;
  border: 1px solid var(--input-border);
  background: var(--surface);
  color: var(--charcoal);
  padding: 11px 12px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: none;
  clip-path: none;
  margin-bottom: var(--space-2);
}
.google-signin-btn:hover { background: var(--surface-muted); color: var(--charcoal); }

.account-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 var(--space-2);
}

/* ---------- My Requests ---------- */

.my-request-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.my-request-meta { display: flex; align-items: center; gap: 12px; }
.my-request-thumb, .my-request-thumb-empty {
  width: 44px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.my-request-thumb-empty { background: var(--surface-muted); border-style: dashed; }
.my-request-piece { font-family: var(--font-display); font-size: 16px; }
.my-request-date { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }

@media (max-width: 480px) {
  .my-request-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas: "thumb piece" "thumb meta";
    row-gap: 6px;
  }
  .my-request-thumb, .my-request-thumb-empty { grid-area: thumb; width: 40px; height: 53px; }
  .my-request-piece { grid-area: piece; }
  .my-request-meta { grid-area: meta; display: flex; align-items: center; gap: 10px; }
}

/* ---------- Footer links ---------- */

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* ---------- Static content pages (about / faq / contact / terms) ---------- */

.page-hero {
  padding: var(--space-5) 0 var(--space-3);
}
.page-intro { font-size: 16px; max-width: 60ch; color: var(--text-muted); }

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.value-card {
  border: 1px solid var(--line);
  padding: var(--space-3);
  background: var(--surface);
}
.value-card h3 { font-family: var(--font-display); font-size: 19px; margin: 0 0 8px; color: var(--heading); }
.value-card p { font-size: 13.5px; color: var(--text-muted); margin: 0; }

.faq-list { max-width: 70ch; }
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: var(--space-2) 0;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--heading);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+ "; color: var(--gold); }
.faq-item[open] summary::before { content: "− "; }
.faq-item p { font-size: 14.5px; color: var(--text-muted); margin: 10px 0 0; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  max-width: 70ch;
  margin-top: var(--space-3);
}
.contact-item dt {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-size: 11px;
}
.contact-item dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 17px;
}
.contact-item dd a { color: var(--gold); text-decoration: none; font-weight: 600; }
.contact-item dd a:hover { text-decoration: underline; }

.policy-section { max-width: 70ch; margin-bottom: var(--space-4); }
.policy-section h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; color: var(--heading); }
.policy-section p { font-size: 14.5px; color: var(--text-muted); }

@media (max-width: 700px) {
  .value-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
