:root {
  --navy: #0b3558;
  --navy-dark: #082741;
  --gold: #c8a94b;
  --gold-light: #ddc689;
  --beige: #f7efe2;
  --ink: #14110f;
  --danger: #c0392b;
  --success: #1e8e5a;
  --surface: #fff;
}

:root[data-theme="dark"] {
  --beige: #14202e;
  --ink: #eef1f5;
  --surface: #1c2c3d;
  --navy: #14243a;
  --navy-dark: #0b1620;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  background: var(--beige);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color .2s, color .2s;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 768px) {
  .container { padding-inline: 2rem; }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 239, 226, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(11,53,88,.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  gap: 1rem;
}

.logo-img { height: 44px; width: auto; }
.logo-link { display: flex; align-items: center; }
.logo-img-dark { display: none; }
:root[data-theme="dark"] .logo-img-light { display: none; }
:root[data-theme="dark"] .logo-img-dark { display: block; }

.main-nav {
  display: none;
  align-items: center;
  gap: 1.75rem;
  font-weight: 600;
}

.main-nav a { color: var(--navy); transition: color .2s; }
.main-nav a:hover { color: var(--gold); }

@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-btn { display: none; }
}

.main-nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 78px;
  inset-inline: 0;
  background: var(--beige);
  padding: 1rem 1.5rem;
  gap: 1rem;
  border-bottom: 1px solid rgba(11,53,88,.1);
}

.header-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--navy);
  border: 1px solid rgba(11,53,88,.15);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.whatsapp-btn { color: var(--success); }
.lang-switch-btn { font-weight: 800; font-size: .8rem; letter-spacing: .03em; }

/* هيدر موبايل: تصغير الشعار والأيقونات ومنع الزحام، وإخفاء زر واتساب بالهيدر
   (متكرر مع الزر العائم) عشان يفضل مكان كافي للأيقونات الأساسية */
@media (max-width: 480px) {
  .header-inner { height: 62px; gap: .4rem; }
  .logo-img { height: 32px; }
  .header-actions { gap: .3rem; }
  .icon-btn { width: 38px; height: 38px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .header-actions .whatsapp-btn { display: none; }
}

.cart-count {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  background: var(--gold);
  color: var(--navy);
  font-size: .65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.6rem;
  border-radius: .9rem;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all .2s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-secondary { background: var(--gold); color: var(--navy); }
.btn-secondary:hover { background: var(--gold-light); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-whatsapp { background: var(--success); color: #fff; }
.btn-sm { padding: .5rem 1rem; font-size: .875rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--beige);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(200,169,75,.15) 1px, transparent 0);
  background-size: 22px 22px;
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 720px; }
.hero-eyebrow { color: var(--gold); font-weight: 700; margin-bottom: .5rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin: 0 0 1rem; line-height: 1.3; }
.hero p { font-size: 1.1rem; opacity: .9; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ===== Sections ===== */
.section { padding: 3.5rem 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-eyebrow { color: var(--gold); font-weight: 700; margin-bottom: .4rem; display: block; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--navy); margin: 0 0 .5rem; }
.section-head p { color: rgba(20,17,15,.65); }
.section-alt { background: var(--surface); }

/* ===== Grids =====
   نظام تجاوب حقيقي (بنفس نقاط توقف Tailwind): 1 عمود موبايل → 2 من sm(640px) → 3 من md(768px) → 4 من lg(1024px) */
.grid { display: grid; gap: .85rem; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(1, 1fr); }
.grid-3 { grid-template-columns: repeat(1, 1fr); }
.grid-4 { grid-template-columns: repeat(1, 1fr); }

/* sm */
@media (min-width: 640px) {
  .grid { gap: 1rem; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
/* md */
@media (min-width: 768px) {
  .grid { gap: 1.5rem; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
/* lg */
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ===== Product Card ===== */
.product-card {
  background: var(--surface);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(11,53,88,.08);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(11,53,88,.12); }
.product-card-img { position: relative; aspect-ratio: 4/5; background: var(--beige); overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-badges { position: absolute; top: .6rem; inset-inline-start: .6rem; display: flex; flex-direction: column; gap: .3rem; }
.badge { display: inline-flex; align-items: center; padding: .25rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.badge-gold { background: var(--gold); color: var(--navy); }
.badge-navy { background: var(--navy); color: #fff; }
.badge-success { background: var(--success); color: #fff; }
.badge-danger { background: var(--danger); color: #fff; }
.product-card-body { padding: .85rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.product-card-cat { font-size: .75rem; color: rgba(20,17,15,.55); overflow-wrap: break-word; }
.product-card-name {
  font-weight: 700;
  color: var(--navy);
  font-size: .95rem;
  margin: 0;
  line-height: 1.35;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
}
.product-card-name a { overflow-wrap: break-word; }
.product-card-price { display: flex; align-items: baseline; gap: .25rem .5rem; flex-wrap: wrap; margin-top: auto; }
.price-retail { font-weight: 800; color: var(--navy); font-size: 1rem; }
.price-wholesale { font-size: .72rem; color: var(--success); font-weight: 700; overflow-wrap: break-word; }
.product-card-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
@media (min-width: 640px) { .product-card-actions { flex-direction: row; } }
.product-card-actions .btn {
  width: 100%;
  flex: 1 1 0;
  min-width: 0;
  padding: .6rem .5rem;
  font-size: .8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 380px) {
  .product-card-body { padding: .7rem; }
  .product-card-name { font-size: .88rem; }
  .price-retail { font-size: .95rem; }
}

/* ===== Cards general ===== */
.card { background: var(--surface); border-radius: 1rem; padding: 1.5rem; border: 1px solid rgba(11,53,88,.08); }
.icon-circle {
  width: 52px; height: 52px; border-radius: 999px;
  background: var(--beige); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; font-size: 1.4rem;
}

/* ===== Forms ===== */
label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--navy); font-size: .9rem; }
input, select, textarea {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: .7rem;
  border: 1.5px solid rgba(11,53,88,.18);
  font-family: inherit;
  font-size: .95rem;
  background: var(--surface);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
.form-row { margin-bottom: 1.1rem; }
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.form-error { color: var(--danger); font-size: .8rem; margin-top: .3rem; }
.form-hint { color: rgba(20,17,15,.55); font-size: .8rem; margin-top: .3rem; }
.payment-hint { background: var(--beige); border: 1px solid rgba(200,169,75,.4); border-radius: .6rem; padding: .6rem .8rem; margin-top: .5rem; font-size: .85rem; color: var(--navy); }
.checkbox-row { display: flex; align-items: center; gap: .5rem; }
.modal-overlay { position: fixed; inset: 0; background: rgba(20,17,15,.55); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: var(--surface); border-radius: 1rem; padding: 1.5rem; max-width: 480px; width: 100%; max-height: 80vh; overflow-y: auto; }
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checkbox-row input { width: auto; }
fieldset { border: none; padding: 0; margin: 0; }

/* ===== Alerts ===== */
.alert { padding: 1rem 1.2rem; border-radius: .8rem; margin-bottom: 1.5rem; font-weight: 600; }
.alert-success { background: #e6f6ee; color: var(--success); border: 1px solid #b7e4cc; }
.alert-error { background: #fbebe9; color: var(--danger); border: 1px solid #f0c4bf; }

/* ===== Tables (cart, tracking) ===== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .8rem; text-align: start; border-bottom: 1px solid rgba(11,53,88,.08); }
.table th { color: var(--navy); font-size: .85rem; }

/* ===== Cart ===== */
.cart-item { display: flex; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid rgba(11,53,88,.08); }
.cart-item img { width: 80px; height: 96px; object-fit: cover; border-radius: .6rem; }
.qty-control { display: inline-flex; align-items: center; border: 1.5px solid rgba(11,53,88,.18); border-radius: .6rem; overflow: hidden; }
.qty-control button { border: none; background: var(--beige); width: 32px; height: 32px; cursor: pointer; font-size: 1.1rem; color: var(--navy); }
.qty-control span { width: 36px; text-align: center; font-weight: 700; }
.summary-row { display: flex; justify-content: space-between; padding: .5rem 0; }
.summary-total { font-size: 1.2rem; font-weight: 800; color: var(--navy); border-top: 1px solid rgba(11,53,88,.15); padding-top: .8rem; margin-top: .5rem; }

/* ===== Timeline (order tracking) ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step { display: flex; gap: 1rem; }
.timeline-dot { width: 14px; height: 14px; border-radius: 999px; background: rgba(11,53,88,.2); margin-top: 4px; flex-shrink: 0; position: relative; }
.timeline-step.reached .timeline-dot { background: var(--gold); }
.timeline-line { width: 2px; flex: 1; background: rgba(11,53,88,.15); margin-inline-start: 6px; }
.timeline-step.reached .timeline-line { background: var(--gold); }
.timeline-content { padding-bottom: 1.5rem; }
.timeline-content strong { color: var(--navy); display: block; }

/* ===== FAQ ===== */
.faq-item { border-bottom: 1px solid rgba(11,53,88,.1); padding: 1rem 0; }
.faq-question { cursor: pointer; font-weight: 700; color: var(--navy); display: flex; justify-content: space-between; align-items: center; }
.faq-answer { display: none; margin-top: .6rem; color: rgba(20,17,15,.75); }
.faq-item.open .faq-answer { display: block; }

/* ===== Testimonials ===== */
.testimonial-card { background: var(--surface); border-radius: 1rem; padding: 1.5rem; border: 1px solid rgba(11,53,88,.08); }
.stars { color: var(--gold); margin-bottom: .6rem; }

/* ===== Footer ===== */
.site-footer { margin-top: 4rem; background: var(--navy); color: var(--beige); }
.footer-grid { display: grid; gap: 2rem; padding: 3.5rem 0; grid-template-columns: 1fr; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-logo { height: 40px; margin-bottom: 1rem; }
.footer-brand p { opacity: .75; max-width: 340px; font-size: .9rem; }
.footer-social { display: flex; gap: .6rem; margin-top: 1rem; }
.footer-social a { width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; overflow: hidden; transition: transform .15s; }
.footer-social a:hover { transform: translateY(-2px); }
.footer-social a img { width: 22px; height: 22px; object-fit: contain; display: block; }
.footer-col h4 { color: var(--gold); margin-bottom: 1rem; }
.footer-col a, .footer-col p { display: block; opacity: .8; margin-bottom: .6rem; font-size: .92rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.2rem 0; text-align: center; font-size: .85rem; opacity: .6; }

.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-start: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(30,142,90,.4);
  z-index: 60;
}

@media (max-width: 480px) {
  .whatsapp-float {
    width: 48px;
    height: 48px;
    bottom: 1rem;
    inset-inline-start: 1rem;
  }
  .whatsapp-float svg { width: 22px; height: 22px; }
}

/* ===== Page header (breadcrumb-ish) ===== */
.page-hero { background: var(--navy); color: var(--beige); padding: 2.5rem 0; text-align: center; }
.page-hero h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.text-muted { color: rgba(20,17,15,.6); }
.empty-state { text-align: center; padding: 4rem 1rem; color: rgba(20,17,15,.5); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ===== Filters (products page) ===== */
.filters-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: .8rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(11,53,88,.08);
}
.filters-bar select,
.filters-bar input { width: 100%; }
.filters-bar .filters-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.filters-bar .filters-actions { display: flex; gap: .6rem; }
.filters-bar .filters-actions .btn { flex: 1; }
@media (min-width: 720px) {
  .filters-bar { display: flex; flex-wrap: wrap; align-items: center; }
  .filters-bar select, .filters-bar input { width: auto; }
  .filters-bar input[type="search"] { flex: 1; min-width: 180px; }
  .filters-bar select { min-width: 150px; }
  .filters-bar input[type="number"] { width: 100px; }
  .filters-bar .filters-row,
  .filters-bar .filters-actions { display: contents; }
}

/* ===== Product detail ===== */
.product-detail { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .product-detail { grid-template-columns: 1fr 1fr; } }
.gallery-main { aspect-ratio: 4/5; border-radius: 1rem; overflow: hidden; background: var(--surface); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .6rem; margin-top: .8rem; }
.gallery-thumbs img { width: 64px; height: 76px; object-fit: cover; border-radius: .5rem; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--gold); }
.swatch-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch {
  padding: .5rem 1rem;
  border-radius: .6rem;
  border: 1.5px solid rgba(11,53,88,.18);
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
  background: var(--surface);
}
.swatch.active { border-color: var(--navy); background: var(--navy); color: #fff; }

/* ===== لوحة طلب الجملة حسب اللون والمقاس (صفحة تفاصيل المنتج) ===== */
.wholesale-matrix-wrap { overflow-x: auto; margin: .8rem 0; -webkit-overflow-scrolling: touch; }
.wholesale-matrix { border-collapse: separate; border-spacing: .4rem; width: 100%; }
.wholesale-matrix th { font-size: .78rem; color: var(--navy); font-weight: 700; white-space: nowrap; padding: 0 .2rem; }
.wholesale-matrix td { padding: 0; }

.wholesale-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid rgba(11,53,88,.18);
  border-radius: .6rem;
  overflow: hidden;
  background: var(--surface);
}
.wholesale-stepper button {
  border: none;
  background: var(--beige);
  width: 30px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.wholesale-stepper button:hover { background: var(--gold-light); }
.wholesale-qty {
  width: 40px;
  height: 34px;
  text-align: center;
  border: none;
  border-inline: 1px solid rgba(11,53,88,.12);
  padding: 0;
  font-weight: 700;
  -moz-appearance: textfield;
}
.wholesale-qty::-webkit-outer-spin-button,
.wholesale-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

@media (max-width: 480px) {
  .wholesale-stepper button { width: 26px; height: 30px; }
  .wholesale-qty { width: 32px; height: 30px; font-size: .85rem; }
}
