/* Fara7i — Editorial Blush & Brushed Brass Theme */
:root {
  --bg-page: #FAF6F3;           /* Warm alabaster cream */
  --bg-surface: #FFFFFF;        /* Crisp pure white */
  --bg-surface-soft: #FFF9F7;   /* Subtle porcelain blush */
  
  --ink: #26211E;               /* Deep espresso ink */
  --ink-soft: #7D736C;          /* Warm stone gray */
  --ink-muted: #A3978E;         /* Pale caption tone */

  --brass: #C29B63;             /* Warm brushed brass */
  --brass-dark: #A8814B;        /* Burnished gold on hover */
  --brass-light: #EADBC8;       /* Subtle metallic outline */
  --brass-soft: #F5EFEB;        /* Soft pill background */

  --border-subtle: #E8DED6;     /* Whispering rose-taupe border */
  --shadow: 0 8px 24px rgba(38, 33, 30, 0.06);
  --shadow-hover: 0 14px 34px rgba(38, 33, 30, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }

/* ---------- Home / Browse: see-all link ---------- */
.see-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px auto 26px;
  padding: 10px 22px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #8a6d2f;
  text-decoration: none;
  border: 1px solid #d9c48a;
  border-radius: 999px;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(2px);
  transition: background .2s, color .2s, border-color .2s;
}
.see-all:hover { background: #c8a45a; color: #fff; border-color: #c8a45a; }
.see-all[hidden] { display: none; }

/* ---------- Browse page ---------- */
.hero--compact {
  padding: 28px 0 22px;
}
.hero-back {
  display: inline-block;
  margin-bottom: 10px;
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a6d2f;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.hero-back:hover { border-color: #c8a45a; }
.results-count {
  text-align: center;
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: rgba(38,33,30,0.55);
  margin: -14px 0 18px;
}
.results-count[hidden] { display: none; }

body {
  margin: 0;
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  background: var(--bg-page);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-page) 100%);
  color: var(--ink);
  padding: 64px 24px 44px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.hero .logo {
  margin: 0;
  color: var(--ink);
}

.hero .logo-img {
  display: block;
  height: 300px;
  width: auto;
  max-width: 90%;
  max-height: 32vh;
  margin: 0 auto;
}

.hero .tagline {
  margin: 10px 0 28px;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-soft);
  opacity: 0.95;
}

/* ---------- Vendor studio CTA (above the fold) ---------- */
.studio-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 26px;
  padding: 13px 30px;
  background: var(--brass);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(194, 155, 99, 0.28);
  transition: background-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.studio-cta:hover {
  background: var(--brass-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(194, 155, 99, 0.34);
}

.studio-cta:active {
  transform: translateY(0);
}

/* keep the CTA centred in RTL layouts */
[dir="rtl"] .studio-cta {
  margin: 0 auto 26px;
}

.search-wrap {
  max-width: 520px;
  margin: 0 auto 28px;
}

.search-wrap input {
  width: 100%;
  padding: 14px 22px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface);
  font-size: 1rem;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  box-shadow: 0 4px 15px rgba(38, 33, 30, 0.04);
  transition: all 0.25s ease;
}

.search-wrap input:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(194, 155, 99, 0.2);
}

/* ---------- Category pills ---------- */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Sub-category row (second tier) — slightly smaller, sits under the primary row. */
.pills.pills-sub {
  margin-top: 10px;
  gap: 8px;
}
.pill.pill-sub {
  padding: 6px 16px;
  font-size: 0.82rem;
}

.pill {
  padding: 8px 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  border-color: var(--brass);
  color: var(--ink);
  background: var(--bg-surface-soft);
}

.pill.active {
  background: var(--brass);
  color: #FFFFFF;
  border-color: var(--brass);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(194, 155, 99, 0.25);
}

/* ---------- Vendor grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--brass-light);
  box-shadow: var(--shadow-hover);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: break-word;
}

.card-meta {
  display: flex;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  background: var(--brass-soft);
  border: 1px solid var(--brass-light);
  color: var(--brass-dark);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-desc {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--ink-soft);
  flex: 1;
  overflow-wrap: break-word;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  flex: 1;
  padding: 11px 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-wa {
  background: #25d366;
  color: #FFFFFF;
}
.btn-wa:hover {
  background: #1eb85a;
}

.btn-quote {
  background: var(--bg-surface);
  border: 1px solid var(--brass);
  color: var(--brass-dark);
}
.btn-quote:hover {
  background: var(--brass);
  color: #FFFFFF;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(38, 33, 30, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  max-width: 450px;
  width: 100%;
  padding: 32px;
  position: relative;
  box-shadow: 0 16px 40px rgba(38, 33, 30, 0.16);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--ink);
}

.modal h2 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  color: var(--brass-dark);
}

.modal-sub {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

#quote-form label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

#quote-form input,
#quote-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-surface-soft);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease;
}

#quote-form input:focus,
#quote-form textarea:focus {
  border-color: var(--brass);
}

.btn-gold {
  width: 100%;
  padding: 12px;
  background: var(--brass);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-gold:hover {
  background: var(--brass-dark);
}

/* ---------- Misc ---------- */
.empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 1.1rem;
  padding: 50px 20px;
}

footer {
  text-align: center;
  padding: 28px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* ---------- Tablet (<= 768px) ---------- */
@media (max-width: 768px) {
  .hero {
    padding: 44px 16px 32px;
  }
  .hero .logo-img {
    height: 220px;
    max-height: 26vh;
  }
  .hero .tagline {
    font-size: 1.05rem;
    margin: 8px 0 20px;
  }
  .search-wrap {
    max-width: 100%;
    margin-bottom: 20px;
  }
  .grid {
    gap: 20px;
    padding: 28px 16px;
  }
  .card-body {
    padding: 16px 16px 18px;
  }
  .card-name {
    font-size: 1.2rem;
  }
}

/* ---------- Phone (<= 480px) ---------- */
@media (max-width: 480px) {
  .hero {
    padding: 32px 14px 24px;
  }
  .hero .logo-img {
    height: 160px;
    max-height: 20vh;
  }
  .hero .tagline {
    font-size: 0.95rem;
  }
  .search-wrap input {
    padding: 12px 16px;
    font-size: 0.95rem;
  }
  .pills {
    gap: 8px;
  }
  .pill {
    padding: 7px 14px;
    font-size: 0.82rem;
  }
  .pill-lang {
    padding-inline-start: 12px;
    padding-inline-end: 12px;
  }
  .pill-lang__label {
    font-size: 0.85rem !important;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 12px;
  }
  .card-img {
    height: 180px;
  }
  .card-name {
    font-size: 1.1rem;
  }
  .card-meta {
    font-size: 0.82rem;
  }
  .badge {
    font-size: 0.72rem;
    padding: 2px 10px;
  }
  .card-desc {
    font-size: 0.88rem;
  }
  .btn {
    font-size: 0.88rem;
    padding: 10px 0;
  }
  footer {
    padding: 20px 16px;
    font-size: 0.82rem;
  }
  /* Modal: full-bleed on phones */
  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }
  .modal {
    width: 100%;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 24px 18px;
  }
  .modal h2 {
    font-size: 1.35rem;
  }
}

/* ---------- Touch devices: bigger tap targets ---------- */
@media (pointer: coarse) {
  .pill {
    min-height: 44px;
  }
  .btn {
    min-height: 44px;
  }
  .modal-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---------- RTL polish (Arabic) ---------- */
[dir="rtl"] .pill-lang {
  margin-inline-start: 8px; /* mirrors in RTL automatically */
}
[dir="rtl"] .hero .logo-img {
  /* Logo is a centred block; no direction-specific fix needed */
}

/* =========================================================
   Card gallery badge
   ========================================================= */
.card {
  position: relative;
}
.card-gallery-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(38, 33, 30, .7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.04em;
}
.card-img--clickable {
  cursor: zoom-in;
}

/* =========================================================
   Lightbox (gallery viewer)
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 17, 15, .94);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open {
  display: flex;
}
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}
.lightbox-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  background: rgba(0,0,0,.5);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: rgba(0,0,0,.8); }
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(0,0,0,.45);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-arrow:hover { background: rgba(0,0,0,.75); }
.lightbox-arrow--prev { left: 16px; }
.lightbox-arrow--next { right: 16px; }
.lightbox-foot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px;
  flex: 0 0 auto;
}
.lightbox-counter {
  color: rgba(255,255,255,.7);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
}
.lightbox-vendor-name {
  color: rgba(255,255,255,.7);
  font-size: 0.85rem;
  min-width: 52px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40vw;
}
.lightbox-strip {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
}
.lightbox-strip::-webkit-scrollbar { height: 6px; }
.lightbox-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 3px; }
.lightbox-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(255,255,255,.1);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lightbox-thumb.active {
  border-color: var(--brass, #c8a45a);
}
.lightbox-thumb-badge { font-size: 18px; }

/* Phone: lightbox full-bleed, smaller arrows */
@media (max-width: 480px) {
  .lightbox { padding: 12px; }
  .lightbox-arrow { width: 38px; height: 38px; font-size: 1.6rem; }
  .lightbox-arrow--prev { left: 8px; }
  .lightbox-arrow--next { right: 8px; }
  .lightbox-close { top: 8px; right: 8px; width: 36px; height: 36px; }
  .lightbox-foot { padding: 8px 4px; }
  .lightbox-thumb { width: 38px; height: 38px; }
  .lightbox-vendor-name { max-width: 36vw; font-size: 0.78rem; }
}

@media (pointer: coarse) {
  .lightbox-thumb { min-width: 44px; min-height: 44px; }
}