/* ————————————————————————————————————————————————
   أنماط الميزات الجديدة فقط (قائمة الرغبات، اقتراحات البحث،
   معرض الأعمال، الأسئلة الشائعة).

   ملف منفصل عمدًا عن site.css و site-extra.css حتى تبقى ملفات
   التصميم الخاصة بك كما هي. عدّل هنا أو احذف الملف بحرّية.
   ———————————————————————————————————————————————— */

/* ————— نسبة الصور: 4:3 عرضي —————
   هي نسبة كاميرا الهاتف حين تُمسكه أفقيًا، فما تصوّره في المحل يظهر
   كما هو بلا قصّ من الأعلى أو الأسفل. كل إطارات الصور موحّدة عليها. */
.product-image { aspect-ratio: 4 / 3; }
.cat-tile-media,
.project-media { aspect-ratio: 4 / 3; }

/* صورة صفحة المنتج: الإطار يتبع الصورة، لا العكس.
   بهذا لا يبقى فراغ حول الصورة ولا تُقصّ منها زاوية — مهما كانت
   أبعاد ما صوّرته. height:auto ضروري: بدونه يبقى الارتفاع المكتوب
   في وسم الصورة ساريًا ويتجاهل المتصفح النسبة تمامًا.
   السقف 78vh يمنع الصور الطولية جدًا من ابتلاع الشاشة. */
.gallery-main img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  max-height: 78vh;
  object-fit: cover;
}
.gallery-main { align-self: start; background: transparent; }

/* ————— إصلاح: الصور التي لا تملأ إطارها —————
   الإطار يحدَّد بـ min-height بلا ارتفاع صريح، و height:100% على صورة
   داخله لا يجد ارتفاعًا يستند إليه، فترتدّ الصورة إلى مقاسها الطبيعي
   وتترك فراغًا أسفلها. الحل: نُثبّت الصورة على حواف الإطار الأربع. */
.story-visual img,
.hero-media > img,
.modal-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* صورة «من نحن» تأخذ ارتفاع الصف كاملًا بدل التوسّط */
.story-grid { align-items: stretch; }
.story-copy { align-self: center; }

/* ————— شعار المتجر —————
   الشعار صار صورة شفافة، فأزلنا الخلفية والظل اللذين كانا حول المربع.
   احذف هذه القاعدة إن أردت إعادة الإطار. */
.brand-logo {
  width: 52px; height: 52px; flex-basis: 52px;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.brand-logo img { object-fit: contain; }

/* شعار داخل ختم لوحة الإدارة */
.brand-seal img { width: 30px; height: 30px; object-fit: contain; }

/* ————— زر واتساب العائم: أصغر وبلون العلامة ————— */
.whatsapp-float {
  inset-inline-end: 18px;
  bottom: 18px;
  min-height: 46px;
  padding: 0 15px;
  gap: 8px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 26px rgba(24, 23, 19, .22);
  font-size: .76rem;
  font-weight: 700;
}
.whatsapp-float:hover { background: var(--accent-dark, #704923); transform: translateY(-2px); }
.whatsapp-float svg { width: 18px; height: 18px; color: #4fd06a; }
@media (max-width: 720px) {
  .whatsapp-float { width: 50px; height: 50px; min-height: 50px; inset-inline-end: 14px; bottom: 14px; }
}

/* ————— لمسات عامة على الموقع ————— */
:focus-visible { outline: 3px solid rgba(147, 102, 55, .5); outline-offset: 3px; border-radius: 6px; }
.product-card { transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s, border-color .28s; }
.product-card:hover { transform: translateY(-4px); }
.btn { transition: transform .2s, background .2s, color .2s, border-color .2s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
img { background-color: var(--paper-deep, #ebe5da); }

/* ————— قائمة التصنيفات في الترويسة ————— */
.nav-cats { position: relative; display: inline-flex; }
/* جسر شفاف يملأ الفراغ بين الزر والقائمة حتى لا تُغلق أثناء تحريك الفأرة إليها */
.nav-cats::after {
  content: "";
  position: absolute;
  top: 100%;
  inset-inline: -24px;
  height: 22px;
  display: none;
}
.nav-cats.open::after { display: block; }
.nav-cats-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: .91rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s;
}
.nav-cats-btn:hover,
.nav-cats-btn.active,
.nav-cats.open .nav-cats-btn { color: var(--ink); }
.nav-cats-arrow { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .25s; }
.nav-cats.open .nav-cats-arrow { transform: rotate(-90deg); }

.nav-cats-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 14px);
  inset-inline-start: 50%;
  transform: translateX(50%);
  width: max-content;
  max-width: 460px;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
[dir="ltr"] .nav-cats-menu { transform: translateX(-50%); }
.nav-cats-menu a {
  padding: 9px 13px;
  border-radius: 11px;
  color: var(--ink-soft);
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.nav-cats-menu a:hover { color: var(--ink); background: var(--paper); }

/* ————— التصنيفات داخل قائمة الهاتف ————— */
.mobile-cats { padding: 18px 0 4px; border-top: 1px solid var(--line-light, rgba(255,255,255,.14)); }
.mobile-cats-title { margin: 0 0 10px; color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .1em; }
.mobile-cats-list { display: flex; flex-wrap: wrap; gap: 7px; }
.mobile-cats-list a {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.mobile-cats-list a:hover { border-color: currentColor; }

/* ————————————————— شبكة التصنيفات —————————————————
   بلاطات بصور على نمط متاجر الأثاث العالمية: صورة + اسم + عدد المنتجات. */
.cat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
}
.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius, 20px);
  background: #26241f;
  box-shadow: 0 10px 26px rgba(10, 9, 8, .18);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
}
.cat-tile:hover { transform: translateY(-5px); box-shadow: 0 20px 44px rgba(10, 9, 8, .3); }

.cat-tile-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #3a3730; }
.cat-tile-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), filter .35s;
}
.cat-tile:hover .cat-tile-media img { transform: scale(1.06); }
.cat-tile-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20, 18, 15, .55), transparent 55%);
}

.cat-tile-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 17px 17px;
  color: white;
}
.cat-tile-body h3 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.35;
  color: white;
}
.cat-tile-body p {
  margin: 0;
  color: rgba(255, 255, 255, .6);
  font-size: .78rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-tile-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: #d5a05c;
  font-size: .74rem;
  font-weight: 800;
}
.cat-tile-go svg { width: 15px; height: 15px; transition: transform .3s; }
.cat-tile:hover .cat-tile-go svg { transform: translateX(-4px); }
[dir="ltr"] .cat-tile:hover .cat-tile-go svg { transform: translateX(4px); }

/* على الخلفية الفاتحة (صفحات أخرى) تبقى البلاطة أنيقة */
.section:not(.collections) .cat-tile { background: var(--surface); box-shadow: var(--shadow-sm); }
.section:not(.collections) .cat-tile-body { color: var(--ink); }
.section:not(.collections) .cat-tile-body h3 { color: var(--ink); }
.section:not(.collections) .cat-tile-body p { color: var(--muted); }

@media (max-width: 560px) {
  .cat-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .cat-tile-body { padding: 12px 13px 14px; }
  .cat-tile-body h3 { font-size: .92rem; }
  .cat-tile-body p { display: none; }
}

/* ————— قائمة الرغبات ————— */
.wish-link {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: .2s;
}
.wish-link:hover { color: var(--accent); border-color: var(--accent); }
.wish-link svg { width: 19px; height: 19px; }
.wish-count {
  position: absolute; top: -3px; inset-inline-end: -3px;
  min-width: 19px; height: 19px;
  display: grid; place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent); color: white;
  font-size: .64rem; font-weight: 800;
}
.wish-btn {
  position: absolute; top: 12px; inset-inline-end: 12px;
  z-index: 3;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(255, 253, 248, .92);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(30, 25, 18, .14);
  transition: transform .2s, color .2s;
}
.wish-btn:hover { color: var(--accent); transform: scale(1.08); }
.wish-btn.on { color: #a03e32; }
.wish-btn.pop { transform: scale(1.28); }
.wish-btn svg { width: 19px; height: 19px; }

.wish-summary {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 26px; padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.wish-total { display: grid; gap: 3px; }
.wish-total span { color: var(--muted); font-size: .84rem; }
.wish-total strong { font-size: 1.14rem; }
.wish-form { max-width: 640px; margin-top: 22px; }

/* ————— اقتراحات البحث الفوري ————— */
.search-box { position: relative; }
.suggest-panel {
  position: absolute;
  z-index: 40;
  inset-inline: 0;
  top: calc(100% + 8px);
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.suggest-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 13px;
  transition: background .16s;
}
.suggest-item:hover { background: var(--paper); }
.suggest-item img { width: 48px; height: 44px; object-fit: cover; border-radius: 9px; background: var(--paper-deep); }
.suggest-item b { display: block; font-size: .88rem; font-weight: 700; }
.suggest-item small { display: block; color: var(--muted); font-size: .72rem; }
.suggest-item em { font-style: normal; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.suggest-empty { margin: 0; padding: 16px; color: var(--muted); font-size: .84rem; text-align: center; }

/* ————— معرض الأعمال ————— */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: clamp(16px, 2.4vw, 26px); }
.project-card {
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 28px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.project-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-deep); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.2,.8,.2,1); }
.project-card:hover .project-media img { transform: scale(1.05); }
.project-body { display: flex; flex-direction: column; gap: 7px; padding: clamp(16px, 2vw, 22px); }
.project-body h2, .project-body h3 { margin: 0; font-size: 1.15rem; }
.project-body p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.7; }
.project-place { display: inline-flex; align-items: center; gap: 6px; color: var(--accent) !important; font-size: .76rem !important; font-weight: 800; }
.project-place svg { width: 15px; height: 15px; }
.project-more { margin-top: auto; display: inline-flex; align-items: center; gap: 7px; padding-top: 6px; color: var(--ink); font-size: .8rem; font-weight: 800; }
.project-more svg { width: 16px; height: 16px; }

/* ————— الأسئلة الشائعة ————— */
.faq-wrap { max-width: 860px; }
.faq-list { display: grid; gap: 12px; }
.faq-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.faq-item.open { border-color: rgba(147, 102, 55, .35); box-shadow: var(--shadow-sm); }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px clamp(16px, 2.2vw, 24px);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}
.faq-icon { position: relative; flex: 0 0 auto; width: 17px; height: 17px; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; inset-inline: 0; top: 50%;
  height: 2px; border-radius: 2px; background: var(--accent);
  transform: translateY(-50%); transition: transform .25s;
}
.faq-icon::after { transform: translateY(-50%) rotate(90deg); }
.faq-item.open .faq-icon::after { transform: translateY(-50%) rotate(0); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-item.open .faq-a { max-height: 420px; }
.faq-a p { margin: 0; padding: 0 clamp(16px, 2.2vw, 24px) 19px; color: var(--ink-soft); font-size: .92rem; line-height: 1.85; }

@media (max-width: 560px) {
  .wish-link { width: 40px; height: 40px; }
  .wish-btn { width: 34px; height: 34px; top: 9px; inset-inline-end: 9px; }
}
