/* الصفحة تأخذ طول الشاشة قبل ظهور المنتج: بدونها يظهر الـfooter أولاً ثم يُدفع للأسفل (قفزة كبيرة في Clarity) */
.pp { min-height: 100vh; }
/* ===== صفحة المنتج ===== */
/* hidden يجب أن يُخفي العنصر حتى لو كان له display خاص */
.page-product [hidden] { display: none !important; }
.pp { padding-top: 18px; padding-bottom: 40px; }
/* التذييل يظهر بعد عرض المنتج: لو ظهر أولاً لدفعه المنتج إلى الأسفل (قفزة كبيرة في الصفحة = CLS) */
.page-product:not(.is-ready) .footer { display: none; }
.pp-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .86rem; color: var(--muted); margin-bottom: 18px; }
.pp-crumbs a:hover { color: var(--gold-ink); }
.pp-crumbs [aria-current] { color: var(--text); font-weight: 600; }
.pp-missing { text-align: center; padding: 80px 0; display: grid; gap: 18px; justify-items: center; }

.pp-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }

/* المعرض */
.pp-gallery { position: sticky; top: 84px; min-width: 0; }
.pp-stage { position: relative; border-radius: 20px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.pp-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  aspect-ratio: 1; outline: none;
}
.pp-track::-webkit-scrollbar { display: none; }
.pp-slide { flex: 0 0 100%; scroll-snap-align: center; overflow: hidden; display: grid; place-items: center; background: #fff; }
.pp-slide img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; transition: transform .25s ease; }
.pp-slide img.is-zoom { transform: scale(2.2); }
.pp-arrow {
  position: absolute; top: 50%; translate: 0 -50%; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92); color: #161616; font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .12); z-index: 2;
}
.pp-arrow:disabled { opacity: 0; pointer-events: none; }
.pp-arrow--prev { inset-inline-start: 12px; }
.pp-arrow--next { inset-inline-end: 12px; }
.pp-counter, .pp-zoomhint {
  position: absolute; bottom: 12px; z-index: 2; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; pointer-events: none;
}
.pp-counter { inset-inline-start: 12px; unicode-bidi: isolate; }
.pp-zoomhint { inset-inline-end: 12px; font-weight: 500; }
.pp-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.pp-thumb {
  position: relative; flex: 0 0 64px; height: 64px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent;
  background: #fff; cursor: pointer; box-shadow: 0 0 0 1px var(--line); opacity: .7; transition: opacity .2s, border-color .2s;
}
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pp-thumb.is-active { border-color: var(--gold); opacity: 1; }
/* الفيديو عمودي: يملأ المربع كاملاً بدون قصّ (height: 100% وحده لا يعمل داخل grid بـ place-items) */
.pp-slide--video { position: relative; background: #000; }
.pp-slide--video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.pp-thumb__play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .85rem; background: rgba(0, 0, 0, .35); }

/* المعلومات */
.pp-info { min-width: 0; }
.pp-tag { top: 12px; inset-inline-start: 12px; pointer-events: none; }
.pp-tag[hidden] { display: none; }
.pp-title { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.25; font-weight: 800; margin-bottom: 6px; }
.pp-info .stars-row { margin-bottom: 8px; }
.pp-price { margin: 4px 0 2px; }
.pp-price .price__now { font-size: 1.8rem; }
.pp-desc { color: var(--muted); line-height: 1.9; margin: 14px 0 18px; }

/* آخر الصفحة: الخانات واحدة تحت الأخرى، وبدون فراغ قبل التذييل */
.pp-trust.pp-trust--end { grid-template-columns: 1fr; margin: 28px 0 0; }
.pp-trust { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.pp-trust li, .pp-wa {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--line); font-size: .88rem; font-weight: 600;
}
.pp-trust li:has(.pp-wa) { padding: 0; border: 0; background: none; }
.pp-wa { width: 100%; color: #fff; background: #1faa59; border-color: #1faa59; }
.pp-wa:hover { filter: brightness(1.05); }
.pp-trust svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--gold-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pp-wa svg { stroke: none; color: #fff; }

.pp-order { margin: 14px 0 22px; scroll-margin-top: 90px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.pp-order__title { font-size: 1.15rem; margin-bottom: 16px; }
.pp-colorname { color: var(--gold-ink); font-weight: 700; }
.pp-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.pp-color {
  width: 52px; height: 52px; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer; background: #fff;
  border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line); transition: transform .15s, border-color .15s;
}
.pp-color img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }
.pp-color:hover { transform: translateY(-2px); }
.pp-color.is-active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 178, 79, .35); }
.pp-colors--bundle { display: grid; gap: 14px; }
.pp-colors--bundle[hidden] { display: none; }
.pp-bundle__name { display: block; font-size: .9rem; margin-bottom: 8px; }
.pp-bundle__name b { color: var(--gold-ink); }
.pp-success { padding: 10px 0; }
/* زر السلة: ذهبي فاتح بإطار ذهبي، واضح أنه زر، وأقل بروزاً من زر الطلب الذهبي الممتلئ */
.pp-addcart { margin-bottom: 16px; border: 2px solid var(--gold); background: rgba(242, 178, 79, .14); color: var(--gold-ink); font-weight: 800; }
.pp-addcart:hover { background: rgba(242, 178, 79, .26); border-color: var(--gold); }
.pp-addcart svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* أقسام أسفل الصفحة */
.pp-section { margin-top: 56px; }
.pp-section h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: 18px; }
.pp-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pp-spec {
  display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2);
}
.pp-spec__icon {
  grid-row: span 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--gold-ink);
  background: radial-gradient(circle at 30% 25%, rgba(248, 208, 143, .55), rgba(242, 178, 79, .14) 70%);
  box-shadow: inset 0 0 0 1px rgba(242, 178, 79, .45);
}
.pp-spec__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pp-spec dt { font-size: .8rem; color: var(--muted); }
.pp-spec dd { font-weight: 700; font-size: .95rem; }
[data-theme="dark"] .pp-spec__icon { background: radial-gradient(circle at 30% 25%, rgba(242, 178, 79, .28), rgba(242, 178, 79, .06) 70%); }

.pp-reviews { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.pp-reviews .m-rev__text { font-size: .82rem; }

.pp-related { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pp-rel { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: transform .2s, border-color .2s; }
.pp-rel:hover { transform: translateY(-3px); border-color: rgba(242, 178, 79, .6); }
.pp-rel__img { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #fff; }
.pp-rel__img img { width: 100%; height: 100%; object-fit: cover; }
/* صور الاستوديو (خلفية بيضاء): الساعة تأخذ ~84% من ارتفاع الصورة، نكبّرها حتى تملأ الإطار تقريباً دون قص. صور الباك تملأ الإطار أصلاً */
.pp-rel__img.is-studio img { transform: scale(1.15); }
.pp-rel__name { font-weight: 700; font-size: .92rem; }
.pp-rel__price { color: var(--gold-ink); font-weight: 800; }

/* شريط الشراء الثابت: الهاتف فقط */
.pp-bar { display: none; }

/* عارض الصور بملء الشاشة */
.pp-viewer { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .94); }
.pp-viewer[hidden] { display: none; }
.pp-viewer__scroll { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; touch-action: pan-x pan-y pinch-zoom; }
.pp-viewer__scroll img { max-width: 100vw; max-height: 100vh; object-fit: contain; cursor: zoom-in; background: #fff; }
.pp-viewer__scroll img.is-zoomed { max-width: none; max-height: none; width: 250vmin; cursor: zoom-out; }
.pp-viewer__close { position: fixed; top: 12px; inset-inline-end: 16px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }

@media (max-width: 900px) {
  /* الاسم والسعر قريبان من الصور */
  .pp-grid { grid-template-columns: 1fr; gap: 8px; }
  .pp-title { margin-bottom: 2px; }
  .pp-price { margin-top: 0; }
  .pp-gallery { position: static; margin-inline: -16px; }
  .pp-stage { border-radius: 0; border-inline: 0; }
  .pp-thumbs { padding-inline: 16px; }
  .pp-arrow { display: none; }
  .pp-related { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  /* الفراغ تحت الصفحة (حتى لا يغطي الشريط الثابت شيئاً) صار في التذييل نفسه، لا بين المحتوى والتذييل */
  .pp { padding-top: 10px; padding-bottom: 24px; }
  .page-product .footer { padding-bottom: 96px; }
  .pp-crumbs { font-size: .78rem; margin-bottom: 10px; }
  .pp-trust { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pp-trust li, .pp-wa { font-size: .8rem; padding: 9px 10px; }
  .pp-order { padding: 16px; border-radius: 16px; }
  .pp-section { margin-top: 40px; }
  .pp-specs { grid-template-columns: 1fr; }
  /* زر الشراء الثابت أسفل الشاشة */
  .pp-bar {
    display: flex; align-items: center; gap: 10px; position: fixed; inset-inline: 0; bottom: 0; z-index: 90;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--header-bg); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, .08); transition: transform .3s;
  }
  .pp-bar[hidden] { display: none; }
  .pp-bar.is-hidden { transform: translateY(110%); }
  .pp-bar__price { display: grid; line-height: 1.2; }
  .pp-bar__price strong { font-size: 1.15rem; color: var(--gold-ink); }
  .pp-bar__price small { font-size: .72rem; color: var(--muted); }
  .pp-bar__wa { margin-inline-start: auto; width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; }
  .pp-bar__wa svg { width: 24px; height: 24px; }
  .pp-bar__buy { padding: 13px 22px; }
  /* زر واتساب العائم غير موجود في هذه الصفحة، وشريط الشراء يحل مكانه */
}
.form-privacy { display: block; margin-top: 8px; text-align: center; font-size: .78rem; color: var(--muted); }

/* موعد التوصيل التقريبي */
.pp-eta { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px dashed rgba(242, 178, 79, .6); }
.pp-eta svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--gold-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pp-eta span { display: grid; line-height: 1.5; }
.pp-eta b { font-size: .92rem; }
.pp-eta small { font-size: .76rem; color: var(--muted); }

/* زر الفيديو الحقيقي ونافذته */
.pp-video-btn { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; text-align: start; cursor: pointer; transition: border-color .2s; }
.pp-video-btn:hover { border-color: var(--gold); }
.pp-video-btn__play { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1a1408; font-size: .9rem; padding-inline-start: 3px; }
.pp-video-btn span:last-child { display: grid; line-height: 1.45; }
.pp-video-btn b { font-size: .95rem; }
.pp-video-btn small { font-size: .78rem; color: var(--muted); }
.pp-vmodal { display: grid; place-items: center; }
.pp-vmodal[hidden] { display: none; }
.pp-vmodal video { max-width: min(92vw, 520px); max-height: 88vh; border-radius: 14px; background: #000; }
@media (max-width: 900px) { .pp-video-btn { width: auto; margin-inline: 16px; } }

/* تفاصيل الساعة: تحت الفيديو في عمود الصور، بطاقات بيضاء بدون إطار */
.pp-details-wrap { margin-top: 22px; }
.pp-details-wrap h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 12px; }
.pp-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pp-detail { margin: 0; background: #fff; color: #161616; border: 0; border-radius: 0; overflow: hidden; }
.pp-detail__img { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: #fff; cursor: zoom-in; overflow: hidden; }
.pp-detail__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.pp-detail__img:hover img { transform: scale(1.06); }
.pp-detail figcaption { display: grid; gap: 3px; padding: 4px 12px 14px; }
.pp-detail figcaption b { font-size: .95rem; color: #161616; }
.pp-detail figcaption span { font-size: .84rem; color: #5c5650; line-height: 1.65; }
/* عمود الصور لا يبقى ثابتاً عند التمرير إن صار طويلاً بالتفاصيل */
.pp-gallery:has(.pp-details-wrap:not([hidden])) { position: static; }
@media (max-width: 900px) { .pp-details-wrap { padding-inline: 16px; } .pp-grid > .pp-details-wrap { padding-inline: 0; margin-top: 0; } }
@media (max-width: 520px) { .pp-details { gap: 8px; } .pp-detail figcaption { padding: 2px 8px 10px; } .pp-detail figcaption span { font-size: .78rem; } }
