/* ============================================================
   WALID & RIM — Lalla Laarousa | Global Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
  --gold:        #C9A84C;
  --gold-light:  #E8C96D;
  --gold-dark:   #9A7A2A;
  --burgundy:    #8B1D40;
  --burgundy-dk: #4A0E22;
  --dark:        #1A0800;
  --cream:       #FDF6EC;
  --cream-dk:    #F2E8D4;
  --text:        #2E1208;
  --text-muted:  #7A5A3A;
  --white:       #FFFFFF;
  --shadow:      rgba(26,8,0,.12);
  --radius:      16px;
  --radius-sm:   10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ─── HEADER / NAV ─────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(26,8,0,.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,168,76,.25);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  flex-shrink: 0;
}
.nav-logo-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 2px;
}
.nav-logo-sub {
  font-size: .6rem;
  color: rgba(255,255,255,.45);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  flex: 1;
}
.nav-links a {
  color: rgba(255,255,255,.75);
  font-size: .88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: color .2s, background .2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  background: rgba(201,168,76,.1);
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-cart-btn {
  position: relative;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--dark);
  border: none;
  padding: 9px 20px;
  border-radius: 24px;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.nav-cart-btn:hover { transform: scale(1.04); box-shadow: 0 4px 18px rgba(201,168,76,.4); }
.cart-badge {
  background: var(--burgundy);
  color: var(--white);
  font-size: .68rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ─── TOAST ─────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--dark);
  border: 1px solid rgba(201,168,76,.4);
  color: var(--white);
  padding: 13px 28px;
  border-radius: 50px;
  font-size: .88rem;
  font-weight: 600;
  z-index: 9999;
  transition: transform .38s cubic-bezier(.34,1.56,.64,1);
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ─── CART DRAWER ────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.cart-drawer {
  position: fixed;
  top: 0; right: -460px;
  width: min(460px,100vw);
  height: 100vh;
  background: var(--white);
  z-index: 601;
  display: flex;
  flex-direction: column;
  transition: right .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,.22);
}
.cart-drawer.open { right: 0; }
.drawer-head {
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--dark), var(--burgundy-dk));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-head h3 { font-size: 1.1rem; font-weight: 800; color: var(--white); }
.drawer-head p  { font-size: .75rem; color: rgba(255,255,255,.5); margin-top: 2px; }
.drawer-close {
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--white);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.drawer-close:hover { background: rgba(255,255,255,.22); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #bbb;
  gap: 12px;
  text-align: center;
}
.cart-empty-state .icon { font-size: 3.5rem; }
.cart-empty-state p { font-size: .9rem; line-height: 1.6; }
.drawer-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.drawer-item-img {
  width: 64px; height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.drawer-item-info { flex: 1; min-width: 0; }
.drawer-item-name { font-weight: 700; font-size: .88rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-item-price { color: var(--burgundy); font-weight: 700; font-size: .82rem; margin-top: 2px; }
.qty-control { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid #ddd;
  background: #f7f7f7;
  cursor: pointer;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s;
  color: var(--text);
  font-weight: 700;
}
.qty-btn:hover { border-color: var(--gold); background: var(--gold); color: var(--dark); }
.qty-num { font-weight: 700; font-size: .9rem; min-width: 18px; text-align: center; }
.drawer-foot {
  padding: 18px 20px;
  border-top: 1.5px solid #eee;
  flex-shrink: 0;
}
.drawer-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.drawer-total span:first-child { font-size: .9rem; color: var(--text-muted); }
.drawer-total-price { font-size: 1.25rem; font-weight: 800; color: var(--burgundy); }
.drawer-checkout-btn {
  width: 100%;
  background: linear-gradient(90deg, var(--burgundy), #C0385A);
  color: var(--white);
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.drawer-checkout-btn:hover { transform: scale(1.02); box-shadow: 0 8px 24px rgba(139,29,64,.38); }

/* ─── SECTION HELPERS ────────────────────────────────── */
.section-label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.8rem,4vw,2.8rem);
  font-weight: 800;
  color: var(--dark);
  line-height: 1.15;
}
.section-title em { font-style: normal; color: var(--burgundy); }
.section-line {
  width: 56px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--burgundy));
  border-radius: 2px;
  margin: 14px 0 0;
}
.section-line.centered { margin: 14px auto 0; }
.section-header { margin-bottom: 52px; }
.section-header.center { text-align: center; }

/* ─── BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  color: var(--dark);
  border: none;
  padding: 13px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover { transform: scale(1.04); box-shadow: 0 6px 22px rgba(201,168,76,.4); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(201,168,76,.5);
  padding: 11px 26px;
  border-radius: 50px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--gold); background: rgba(201,168,76,.12); }

/* ─── FOOTER ──────────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 44px 20px;
  font-size: .82rem;
}
.footer-logo { font-size: 1.3rem; font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin: 14px 0; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.5); font-size: .8rem; transition: color .2s; }
.footer-links a:hover { color: var(--gold); }
.footer-copy { margin-top: 12px; font-size: .75rem; opacity: .6; }

/* ─── MOROCCAN PATTERN BG ─────────────────────────────── */
.pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg width='56' height='100' viewBox='0 0 56 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23C9A84C' stroke-width='.4' stroke-opacity='.12'/%3E%3Cpath d='M28 0L28 34L0 50' fill='none' stroke='%23C9A84C' stroke-width='.4' stroke-opacity='.12'/%3E%3Cpath d='M28 34L56 50' fill='none' stroke='%23C9A84C' stroke-width='.4' stroke-opacity='.12'/%3E%3C/svg%3E");
}

/* ─── LANGUAGE SWITCHER ───────────────────────────────────── */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(201,168,76,.22);
  border-radius: 22px;
  padding: 3px;
  flex-shrink: 0;
}
.lang-btn {
  padding: 5px 11px;
  border-radius: 18px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.5);
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .5px;
  line-height: 1;
}
.lang-btn.active {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  color: var(--dark);
}
.lang-btn:hover:not(.active) { color: var(--white); background: rgba(255,255,255,.1); }

/* ─── ARABIC / RTL ────────────────────────────────────────── */
[lang="ar"] body,
[lang="ar"] input,
[lang="ar"] textarea,
[lang="ar"] select,
[lang="ar"] button {
  font-family: 'Cairo', 'Segoe UI', sans-serif;
}

[dir="rtl"] .nav-inner       { flex-direction: row-reverse; }
[dir="rtl"] .nav-links       { flex-direction: row-reverse; }
[dir="rtl"] .nav-right       { flex-direction: row-reverse; }
[dir="rtl"] .drawer-head     { flex-direction: row-reverse; }
[dir="rtl"] .drawer-item     { flex-direction: row-reverse; }
[dir="rtl"] .drawer-total    { flex-direction: row-reverse; }
[dir="rtl"] .drawer-foot     { direction: rtl; }
[dir="rtl"] .section-line    { margin-inline-start: 0; }
[dir="rtl"] .section-header.center .section-line { margin: 14px auto 0; }
[dir="rtl"] .footer-links    { flex-direction: row-reverse; }
[dir="rtl"] .lang-switcher   { flex-direction: row-reverse; }
[dir="rtl"] .qty-control     { flex-direction: row-reverse; }
[dir="rtl"] .cart-empty-state a { direction: rtl; }

/* text alignment in RTL */
[dir="rtl"] .topbar-user,
[dir="rtl"] .admin-topbar { flex-direction: row-reverse; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-inner { gap: 0; justify-content: space-between; }
}
