/* ==========================================================================
   Baraka Bazaar — design tokens
   Palette: emerald (primary), gold (accent/embroidery), maroon (secondary),
   ivory (ground), ink (text). Type: Amiri (display/calligraphic-serif),
   Inter (body), IBM Plex Mono (price/stock — receipt/ledger feel).
   Signature motif: eight-pointed khatam star, used as divider/bullet/empty-state.
   Card shape: pointed-arch ("mihrab") top, not generic rounded rectangles.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --emerald: #0b4f3c;
  --emerald-deep: #073226;
  --gold: #c9a227;
  --gold-soft: #e6cf87;
  --maroon: #7a2048;
  --ivory: #fbf8f1;
  --ivory-dim: #f1ead9;
  --ink: #1f2421;
  --ink-soft: #4a524c;
  --line: rgba(11, 79, 60, 0.16);

  --font-display: 'Amiri', 'Noto Naskh Arabic', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --arch: 22px; /* pointed-arch radius unit */
  --shadow: 0 6px 24px rgba(7, 50, 38, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
}
h1, h2, h3, .display {
  font-family: var(--font-display);
  color: var(--emerald-deep);
  font-weight: 700;
  margin: 0 0 0.4em;
  line-height: 1.15;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; }

.price, .stock, .mono {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* subtle geometric ground texture */
.pattern-bg {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(11,79,60,0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* ---------- khatam star (signature element) ---------- */
.khatam { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; }
.khatam svg { width: 100%; height: 100%; fill: var(--gold); }

.star-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 2px;
}
.star-divider::before,
.star-divider::after {
  content: '';
  height: 1px;
  width: 64px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.star-divider .khatam { width: 20px; height: 20px; }

/* ---------- header ---------- */
header.site-header {
  background: var(--emerald);
  color: var(--ivory);
  position: sticky; top: 0; z-index: 40;
  border-bottom: 3px solid var(--gold);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ivory); }
.brand .khatam { width: 26px; height: 26px; }
.brand-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.brand-sub { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-soft); display: block; margin-top: -2px; }

nav.main-nav { display: flex; gap: 22px; }
nav.main-nav a {
  color: var(--ivory); text-decoration: none; font-size: 0.94rem; font-weight: 500;
  opacity: 0.9; position: relative; padding: 4px 0;
}
nav.main-nav a:hover { opacity: 1; }
nav.main-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: var(--gold); transform: scaleX(0); transition: transform 0.2s ease;
}
nav.main-nav a:hover::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.cart-btn {
  background: var(--gold); color: var(--emerald-deep); border: none;
  border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 0.88rem;
  display: flex; align-items: center; gap: 6px;
}
.cart-count { background: var(--emerald-deep); color: var(--gold-soft); border-radius: 999px; padding: 1px 7px; font-size: 0.75rem; font-family: var(--font-mono); }

.hours-strip {
  background: var(--emerald-deep); color: var(--gold-soft);
  text-align: center; font-size: 0.78rem; padding: 5px 0; letter-spacing: 0.03em;
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--emerald) 0%, var(--emerald-deep) 100%);
  color: var(--ivory);
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(201,162,39,0.14) 1.5px, transparent 1.5px);
  background-size: 34px 34px;
  opacity: 0.7;
}
.hero-inner { position: relative; text-align: center; max-width: 720px; margin: 0 auto; }
.hero .eyebrow {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.72rem; color: var(--gold-soft); margin-bottom: 14px; display: block;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); color: var(--ivory); }
.hero p.lede { font-size: 1.08rem; color: rgba(251,248,241,0.86); max-width: 540px; margin: 14px auto 26px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: 999px; padding: 12px 26px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--emerald-deep); }
.btn-gold:hover { box-shadow: 0 6px 18px rgba(201,162,39,0.4); }
.btn-outline { background: transparent; color: var(--ivory); border: 1.5px solid rgba(251,248,241,0.5); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-whatsapp { background: #1f7a4d; color: #fff; }
.btn-whatsapp:hover { box-shadow: 0 6px 18px rgba(31,122,77,0.4); }

/* ---------- category chips ---------- */
.category-rail { padding: 34px 0 6px; }
.category-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.cat-chip {
  flex: 0 0 auto; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 18px; font-size: 0.9rem; font-weight: 600;
  color: var(--emerald-deep); text-decoration: none; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cat-chip:hover, .cat-chip.active { background: var(--emerald); color: var(--ivory); border-color: var(--emerald); }

/* ---------- product grid + arch cards ---------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-size: 1.6rem; }
.section-head .count { font-family: var(--font-mono); color: var(--ink-soft); font-size: 0.85rem; }

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

.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
/* pointed-arch top via clip-path on the image wrapper */
.card-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--ivory-dim);
  clip-path: path('M0,28 C0,10 44,0 100,0 C156,0 200,10 200,28 L200,200 L0,200 Z');
  overflow: hidden;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .no-photo { display:flex; align-items:center; justify-content:center; height:100%; }
.card-photo .no-photo .khatam { width: 34px; height: 34px; opacity: 0.35; }

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; color: var(--ink); margin: 0; }
.card-cat { font-size: 0.72rem; color: var(--maroon); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.card-price { font-size: 1.08rem; color: var(--emerald-deep); font-weight: 600; margin-top: 2px; }
.card-stock { font-size: 0.76rem; color: var(--ink-soft); }
.card-stock.low { color: var(--maroon); font-weight: 600; }
.card-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 10px; }
.card-actions .btn { padding: 8px 12px; font-size: 0.8rem; flex: 1; justify-content: center; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
.empty-state .khatam { width: 40px; height: 40px; opacity: 0.4; margin-bottom: 10px; }

/* ---------- sell-with-us ---------- */
.sell-section {
  background: var(--ivory-dim);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sell-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--arch) var(--arch) 10px 10px;
  padding: 30px; box-shadow: var(--shadow); max-width: 620px; margin: 0 auto; text-align: center;
}
.sell-card .khatam { width: 30px; height: 30px; margin-bottom: 10px; }
.contact-list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 8px; font-family: var(--font-mono); font-size: 0.92rem; }

/* ---------- footer ---------- */
footer {
  background: var(--emerald-deep); color: rgba(251,248,241,0.75);
  padding: 40px 0 24px; font-size: 0.88rem;
}
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
footer h4 { color: var(--gold-soft); font-family: var(--font-body); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }
footer .foot-bottom { text-align: center; margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(251,248,241,0.12); font-size: 0.78rem; }

/* ---------- cart drawer ---------- */
.cart-drawer {
  position: fixed; top: 0; right: -420px; width: min(420px, 100vw); height: 100vh;
  background: #fff; box-shadow: -10px 0 30px rgba(0,0,0,0.18);
  z-index: 100; transition: right 0.25s ease; display: flex; flex-direction: column;
}
.cart-drawer.open { right: 0; }
.cart-drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.cart-drawer-head h3 { margin: 0; }
.cart-close { background: none; border: none; font-size: 1.3rem; color: var(--ink-soft); }
.cart-items { flex: 1; overflow-y: auto; padding: 14px 20px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.cart-item-info { flex: 1; }
.cart-item-info .nm { font-weight: 600; font-size: 0.9rem; }
.qty-stepper { display: flex; align-items: center; gap: 8px; }
.qty-stepper button { background: var(--ivory-dim); border: 1px solid var(--line); border-radius: 6px; width: 26px; height: 26px; font-weight: 700; }
.cart-drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; font-size: 1.05rem; }
.overlay { position: fixed; inset: 0; background: rgba(7,50,38,0.4); z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.overlay.show { opacity: 1; pointer-events: auto; }

/* ---------- product modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(7,50,38,0.5); display: none; align-items: center; justify-content: center; z-index: 110; padding: 20px; }
.modal-backdrop.show { display: flex; }
.modal-box { background: #fff; border-radius: var(--arch) var(--arch) 10px 10px; max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-photo { aspect-ratio: 4/3; background: var(--ivory-dim); overflow: hidden; }
.modal-photo img { width: 100%; height: 100%; object-fit: cover; }
.modal-content { padding: 22px; }
.modal-close { position: absolute; top: 10px; right: 14px; background: rgba(255,255,255,0.9); border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 1.1rem; }

@media (max-width: 780px) {
  nav.main-nav { display: none; }
  .header-row { padding: 12px 0; }
  .section { padding: 30px 0; }
}
