/* مكوّنات إضافية (تبديل اللغة، الشبكات الاجتماعية، صفحة المنتج، نموذج الطلب)
   تستخدم نفس متغيّرات site.css حتى تبقى هوية التصميم كما هي. */

/* ————— شعار المتجر في الترويسة ————— */
.brand-logo {
  width: 46px;
  height: 46px;
  display: inline-flex;
  flex: 0 0 46px;
  overflow: hidden;
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(24, 23, 19, .14);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ————— تبديل اللغة ————— */
.lang-switch {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 700;
  transition: color .2s, border-color .2s, background .2s;
}
.lang-switch:hover { color: var(--ink); border-color: var(--ink); background: var(--surface); }
.lang-switch svg { width: 17px; height: 17px; }

/* ————— الشبكات الاجتماعية في التذييل ————— */
.social-row { display: flex; gap: 9px; margin-top: 18px; }
.social-link {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line-light);
  border-radius: 50%;
  color: inherit;
  transition: .2s;
}
.social-link:hover { border-color: currentColor; transform: translateY(-2px); }
.social-link svg { width: 19px; height: 19px; }

/* ————— روابط داخل بطاقة المنتج ————— */
.product-image a { display: block; width: 100%; height: 100%; }
.product-card h3 a { color: inherit; }
.product-card h3 a:hover { color: var(--accent); }
a.product-order { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ————— صفحات الحالة (404 / منتج محذوف) ————— */
.state-page { max-width: 620px; margin-inline: auto; padding: 40px 0 20px; text-align: center; }
.state-page .btn { margin-top: 12px; }

/* ————— مسار التنقل ————— */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-top: 26px;
  color: var(--muted);
  font-size: .8rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb b { color: var(--ink); font-weight: 700; }

/* ————— تخطيط صفحة المنتج ————— */
.product-page { padding-top: 26px; }
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: start;
  gap: clamp(24px, 4vw, 54px);
}
.gallery { position: sticky; top: 96px; display: grid; gap: 12px; }
.gallery-main {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg, 30px);
  background: var(--paper-deep);
  box-shadow: var(--shadow-sm);
}
.gallery-main img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-main .product-badge { position: absolute; inset-inline-start: 16px; top: 16px; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-thumb {
  width: 82px; height: 68px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: none;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb:hover { transform: translateY(-2px); }
.gallery-thumb.active { border-color: var(--accent); }

.product-detail { padding-top: 6px; }
.product-title { margin: 6px 0 14px; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.25; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.detail-price { font-size: 1.45rem; font-weight: 800; color: var(--ink); }
.detail-chip {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
}
.detail-chip.ok { color: var(--success); border-color: rgba(53, 102, 75, .25); background: rgba(53, 102, 75, .07); }
.detail-description { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.85; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.detail-actions .btn { flex: 0 1 auto; }

/* ————— نموذج الطلب ————— */
.order-box {
  margin-top: 26px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.order-title { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-size: 1.18rem; }
.order-title svg { width: 20px; height: 20px; color: var(--accent); }
.order-lead { margin: 0 0 16px; color: var(--muted); font-size: .88rem; }
.order-form { display: grid; gap: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-field { display: grid; gap: 6px; }
.form-field span { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  transition: border-color .2s, background .2s;
}
.form-field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.form-field input:focus,
.form-field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.order-submit { width: 100%; margin-top: 4px; }
.order-alt { margin: 4px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.order-alt a { color: var(--accent); font-weight: 800; }
.trap { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-note {
  padding: 12px 15px;
  border: 1px solid;
  border-radius: 13px;
  margin-bottom: 14px;
  font-size: .85rem;
  font-weight: 700;
}
.form-note.success { color: var(--success); border-color: rgba(53, 102, 75, .25); background: rgba(53, 102, 75, .08); }
.form-note.error   { color: var(--danger);  border-color: rgba(160, 62, 50, .25); background: rgba(160, 62, 50, .07); }

.related-section { padding-top: 10px; }

/* ————— التخفيضات ————— */
.badge-sale { color: white; background: var(--danger); }
.price-now { font-weight: 800; }
.price-old { margin-inline-start: 7px; color: var(--muted); font-size: .82em; font-weight: 600; text-decoration: line-through; }
.price-ask { font-size: .92em; font-weight: 700; color: var(--accent-dark, var(--accent)); }
.detail-price .price-old { font-size: .62em; }
.offers .product-card { border-color: rgba(160, 62, 50, .18); }

/* ————— ترقيم الصفحات ————— */
.site-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 34px; }
.page-link {
  min-width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: .84rem; font-weight: 800;
  transition: .2s;
}
.page-link:hover { border-color: var(--ink); color: var(--ink); }
.page-link.active { color: white; border-color: var(--ink); background: var(--ink); }
.page-gap { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); }
a.filter-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ————— صفحة التصنيف ————— */
.category-hero { padding-top: 18px; padding-bottom: 0; }
.category-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg, 30px);
  background: var(--paper-deep);
  box-shadow: var(--shadow-sm);
}
.category-banner img { width: 100%; height: clamp(210px, 34vw, 340px); object-fit: cover; }
.category-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24,23,19,.86), rgba(24,23,19,.25) 62%, rgba(24,23,19,.05));
}
.category-banner-copy {
  position: absolute;
  inset-inline-start: clamp(18px, 4vw, 46px);
  inset-inline-end: clamp(18px, 4vw, 46px);
  bottom: clamp(18px, 3vw, 34px);
  z-index: 2;
  color: white;
}
.category-banner-copy .section-title { margin: 4px 0 6px; color: white; }
.category-banner-copy .section-kicker { color: rgba(255,255,255,.72); }
.category-banner-copy .section-intro { max-width: 60ch; margin: 0; color: rgba(255,255,255,.86); }
.count-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 13px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
}

/* ————— الخريطة المضمّنة ————— */
.map-embed {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-deep);
}
.map-embed iframe { display: block; width: 100%; height: 250px; border: 0; }
.map-cta { width: 100%; margin-top: 12px; }

/* ————— الصفحات القانونية ————— */
.legal-page { max-width: 760px; margin-inline: auto; }
.legal-body { color: var(--ink-soft); font-size: 1.02rem; line-height: 2; }
.legal-updated { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.footer-legal a { text-decoration: underline; text-underline-offset: 3px; }

/* ————— شاشات صغيرة ————— */
@media (max-width: 980px) {
  .product-layout { grid-template-columns: 1fr; }
  .gallery { position: static; }
}
@media (max-width: 560px) {
  .brand-logo { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .lang-switch span { display: none; }
  .lang-switch { padding: 6px 10px; }
  .detail-actions .btn { flex: 1 1 100%; }
  .page-link { min-width: 38px; height: 38px; padding: 0 10px; }
  .map-embed iframe { height: 210px; }
}
