/* ============================================================
   MARBELLA LAND — style.css
   All color/font tokens come from brand.js via CSS variables
   set in script.js. Edit brand.js, not this file.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Cairo:wght@400;600;700&family=Jost:wght@300;400;500;600&display=swap');

/* ── CSS Variables (overridden at runtime from brand.js) ── */
:root {
  --bg:           #0A0A0A;
  --bg-card:      #141414;
  --bg-card-hover:#1C1A16;
  --surface:      #1A1711;
  --border:       #3A2E1E;
  --border-gold:  #8B6914;
  --gold:         #C9A255;
  --gold-light:   #E4C47A;
  --gold-dim:     #7A6030;
  --text:         #F0E6D0;
  --text-muted:   #8A7A60;
  --text-dark:    #3A3020;
  --overlay:      rgba(0,0,0,0.55);

  --font-display: 'Cormorant Garamond', serif;
  --font-ar:      'Cairo', sans-serif;
  --font-body:    'Jost', sans-serif;

  --radius-card:  14px;
  --radius-btn:   50px;
  --transition:   0.28s ease;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body[dir="rtl"] { font-family: var(--font-ar); }

img { display: block; width: 100%; }
a   { text-decoration: none; color: inherit; }

/* ── ═══════════════════════════════════════════════════ ── */
/*    HERO HEADER (index only)                              */
/* ── ═══════════════════════════════════════════════════ ── */

.hero-header {
  position: relative;
  min-height: 52vw;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 36px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #1A1208;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

/* Vignette bottom fade */
.hero-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
}

/* Lang row pinned top-left */
.hero-lang-row {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
}
[dir="rtl"] .hero-lang-row { left: auto; right: 16px; }

/* ── Monogram logo ──────────────────────────────────── */
.hero-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 0 24px;
}

.monogram-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Outer orbit ring */
.monogram-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--gold-dim);
}

/* Inner glow */
.monogram-wrap::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0.4;
}

.monogram-letter {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  text-shadow:
    0 0 20px rgba(201,162,85,0.5),
    0 2px 4px rgba(0,0,0,0.8);
  position: relative;
  z-index: 1;
}

.logo-img-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 0 24px rgba(201,162,85,0.25);
}

.logo-img-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  line-height: 1;
}

[dir="rtl"] .brand-name { font-family: var(--font-ar); }

.brand-tagline {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 300;
  opacity: 0.8;
  max-width: 280px;
  line-height: 1.6;
  letter-spacing: 0.3px;
}

[dir="rtl"] .brand-tagline { font-family: var(--font-ar); font-size: 0.82rem; }

/* Decorative gold rule under brand name */
.brand-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 0.65rem;
  opacity: 0.7;
  letter-spacing: 1px;
}
.brand-rule::before,
.brand-rule::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

/* ── ═══════════════════════════════════════════════════ ── */
/*    INNER HEADER (category pages)                         */
/* ── ═══════════════════════════════════════════════════ ── */

.inner-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-gold);
  padding: 14px 16px 18px;
}

.inner-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-btn);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 16px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: 0.3px;
}
.back-btn:hover { background: rgba(201,162,85,0.08); }
[dir="rtl"] .back-btn svg { transform: scaleX(-1); }

.page-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}
[dir="rtl"] .page-title { font-family: var(--font-ar); font-size: 1.4rem; }

.page-brand {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── ═══════════════════════════════════════════════════ ── */
/*    LANGUAGE SWITCHER                                     */
/* ── ═══════════════════════════════════════════════════ ── */

.lang-switcher {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 3px;
}

.lang-btn {
  border: none;
  border-radius: var(--radius-btn);
  padding: 5px 13px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.lang-btn.active {
  background: var(--gold);
  color: var(--text-dark);
  font-weight: 600;
}
.lang-btn:hover:not(.active) { color: var(--gold); }

/* ── ═══════════════════════════════════════════════════ ── */
/*    MAIN LAYOUT                                           */
/* ── ═══════════════════════════════════════════════════ ── */

.main {
  padding: 20px 14px 48px;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Gold ornament divider ──────────────────────────── */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--gold-dim);
  font-size: 0.7rem;
  letter-spacing: 1px;
}
.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-gold));
}
.ornament::after {
  background: linear-gradient(to left, transparent, var(--border-gold));
}

/* ── ═══════════════════════════════════════════════════ ── */
/*    CATEGORY GRID (index page)                           */
/* ── ═══════════════════════════════════════════════════ ── */

.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* Override 2-col for smaller screens */
@media (max-width: 359px) {
  .categories-grid { grid-template-columns: 1fr 1fr; }
}

.cat-card {
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: block;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-dim);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,162,85,0.15);
}

.cat-img-wrap {
  height: 120px;
  overflow: hidden;
  position: relative;
}

/* subtle darken overlay on image */
.cat-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.6) 100%);
}

.cat-img-wrap img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.cat-card:hover .cat-img-wrap img { transform: scale(1.06); }

.cat-img-placeholder {
  height: 120px;
  background: linear-gradient(135deg, #1A1208, #2A1E0A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.cat-footer {
  padding: 9px 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.cat-name {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  flex: 1;
  text-align: right;
}
[dir="ltr"] .cat-name { text-align: left; }
[dir="rtl"] .cat-name { text-align: right; }

.cat-icon-emoji {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.cat-arrow {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  transition: background var(--transition), border-color var(--transition);
}
.cat-card:hover .cat-arrow {
  background: var(--gold);
  color: var(--text-dark);
  border-color: var(--gold);
}

/* ── ═══════════════════════════════════════════════════ ── */
/*    PRODUCT GRID (category pages)                        */
/* ── ═══════════════════════════════════════════════════ ── */

.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 359px) {
  .products-grid { grid-template-columns: 1fr; }
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-dim);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

.product-img-wrap {
  height: 140px;
  overflow: hidden;
  position: relative;
  background: #1A1208;
}
.product-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.06); }

.product-img-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
}

.product-body {
  padding: 11px 12px 13px;
}

.product-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.product-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-btn);
  letter-spacing: 0.5px;
}

/* ── Empty state ────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.empty-state svg { margin: 0 auto 16px; opacity: 0.25; }

/* ── ═══════════════════════════════════════════════════ ── */
/*    FOOTER                                               */
/* ── ═══════════════════════════════════════════════════ ── */

.footer {
  text-align: center;
  padding: 20px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  letter-spacing: 1.5px;
}

.footer-brand {
  color: var(--gold-dim);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 2px;
  display: inline-block;
  margin: 0 8px;
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 3px; }

/* ── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}