/* =========================================================
   معرض الأثاث - تصميم دافئ بألوان خشبية وبيج
   ========================================================= */

:root {
  /* لوحة الألوان */
  --cream: #F5EFE6;
  --cream-deep: #EDE3D3;
  --card-bg: #FFFBF5;
  --wood-dark: #4A3728;
  --wood: #6B4F38;
  --wood-warm: #8B5A2B;
  --gold: #B08D57;
  --gold-light: #D4B98C;
  --text-main: #3A2E22;
  --text-soft: #6B5D4F;
  --line: #E2D5C0;
  --shadow-color: 30, 20, 10;

  --font-display: 'Tajawal', sans-serif;
  --font-body: 'Cairo', sans-serif;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }

a { color: inherit; text-decoration: none; }

/* ===== الهيدر ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 239, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  color: var(--wood-warm);
  display: flex;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--wood-dark);
  letter-spacing: -0.01em;
}

.header-whatsapp {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
}

.header-whatsapp:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

/* ===== الهيرو ===== */
.hero {
  position: relative;
  padding: 64px 24px 56px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(176, 141, 87, 0.10), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(139, 90, 43, 0.08), transparent 45%),
    var(--cream);
  overflow: hidden;
}

.hero-content { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; }

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  color: var(--wood-dark);
  margin: 0 0 16px;
  line-height: 1.15;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin: 0;
  font-weight: 400;
}

.hero-grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(74, 55, 40, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  z-index: 1;
}

/* ===== شريط التصنيفات ===== */
.cat-nav {
  position: sticky;
  top: 60px;
  z-index: 40;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.cat-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-btn {
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--text-soft);
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.cat-btn:hover {
  border-color: var(--gold);
  color: var(--wood-dark);
}

.cat-btn.active {
  background: var(--wood-warm);
  border-color: var(--wood-warm);
  color: #fff;
}

/* ===== المعرض ===== */
.gallery-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.cat-section { margin-bottom: 56px; }
.cat-section:last-child { margin-bottom: 0; }

.cat-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gold-light);
}

.cat-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--wood-dark);
  margin: 0;
}

.cat-count {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}

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

.card {
  margin: 0;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(.2,.7,.3,1), box-shadow 0.28s ease;
}

.card:hover, .card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 18px 32px rgba(var(--shadow-color), 0.14);
  outline: none;
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--cream-deep);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img-wrap img { transform: scale(1.06); }

.card-zoom {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: var(--wood-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.25s ease;
}

.card:hover .card-zoom, .card:focus-visible .card-zoom {
  opacity: 1;
  transform: translateY(0);
}

.card-info {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--wood-warm);
  flex-shrink: 0;
}

/* ===== حالة فارغة ===== */
.empty-state {
  text-align: center;
  padding: 90px 20px;
  color: var(--text-soft);
}
.empty-state svg { color: var(--gold-light); margin-bottom: 16px; }
.empty-state h2 { font-family: var(--font-display); color: var(--wood-dark); margin: 0 0 8px; }
.empty-state p { margin: 0; }

/* ===== لايت بوكس (تكبير الصورة) ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 18, 12, 0.88);
  backdrop-filter: blur(4px);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 1000px;
  width: 100%;
  max-height: 88vh;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.lightbox-img-wrap {
  background: var(--wood-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 88vh;
  overflow: hidden;
}

.lightbox-img-wrap img {
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: contain;
}

.lightbox-details {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.lightbox-cat {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-transform: uppercase;
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--wood-dark);
  margin: 0;
}

.lightbox-desc {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0;
  flex-grow: 1;
}

.lightbox-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--wood-warm);
}

.lightbox-whatsapp {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  padding: 13px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  transition: filter 0.2s ease;
}
.lightbox-whatsapp:hover { filter: brightness(1.06); }

.lightbox-close, .lightbox-nav {
  position: absolute;
  z-index: 3;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,0.25); }

.lightbox-close {
  top: 20px;
  left: 20px;
  width: 42px; height: 42px;
}

.lightbox-nav { width: 48px; height: 48px; top: 50%; transform: translateY(-50%); }
.lightbox-prev { right: 20px; }
.lightbox-next { left: 20px; }

/* ===== فوتر ===== */
.site-footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* ===== الجوال ===== */
@media (max-width: 760px) {
  .header-inner { padding: 12px 16px; }
  .brand-name { font-size: 1.05rem; }
  .header-whatsapp span { display: none; }
  .header-whatsapp { padding: 10px; }

  .hero { padding: 44px 16px 36px; }

  .cat-nav { top: 56px; }
  .cat-nav-inner { padding: 12px 16px; }

  .gallery-wrap { padding: 28px 16px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

  .lightbox { padding: 0; }
  .lightbox-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    overflow-y: auto;
  }
  .lightbox-img-wrap { max-height: 50vh; }
  .lightbox-img-wrap img { max-height: 50vh; }
  .lightbox-close { top: 12px; left: 12px; }
  .lightbox-prev { right: 12px; }
  .lightbox-next { left: 12px; }
  .lightbox-nav { width: 40px; height: 40px; }
}

/* احترام تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
