/*
| جاليري صفحة المنتج — من غير مكتبات (بدل Swiper + Lightbox2) — js/product/gallery.js + shop/product/gallery.blade.php
| الألوان من متغيرات المتجر (app.css / brand.css) — المالك 21-10-2026
*/

/* ---------- السلايدر ---------- */
.pg-main { position: relative; overflow: hidden; border-radius: var(--radius-2xl, 1rem); background: var(--color-soft, #f3f4f6); }
.pg-track { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.pg-track::-webkit-scrollbar { display: none; }
.pg-slide { position: relative; flex: 0 0 100%; aspect-ratio: 1; overflow: hidden; scroll-snap-align: center; scroll-snap-stop: always; }
.pg-slide > a { display: block; width: 100%; height: 100%; }
.pg-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pg-slide video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.pg-ico { pointer-events: none; position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgb(0 0 0 / .5); color: #fff; }
.pg-color { pointer-events: none; position: absolute; right: 12px; top: 12px; z-index: 2; padding: 4px 11px; border-radius: 999px; background: rgb(0 0 0 / .62); color: #fff; font-size: 12.5px; font-weight: 800; line-height: 1.6; }
.pg-count { pointer-events: none; position: absolute; left: 12px; bottom: 12px; z-index: 2; padding: 2px 9px; border-radius: 999px; background: rgb(0 0 0 / .5); color: #fff; font-size: 12px; font-weight: 800; line-height: 1.7; direction: ltr; }
.pg-nav { display: none; }
@media (hover: hover) and (min-width: 768px) {
    .pg-nav {
        position: absolute; top: 50%; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; margin-top: -20px;
        border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); color: var(--color-ink, #111); font-size: 24px; line-height: 1;
        box-shadow: 0 4px 14px rgb(0 0 0 / .15); cursor: pointer; opacity: 0; transition: opacity .15s;
    }
    .pg-main:hover .pg-nav { opacity: 1; }
    .pg-prev { right: 10px; }
    .pg-next { left: 10px; }
}

/* ---------- الصور المصغّرة ---------- */
.pg-thumbs { display: flex; gap: 10px; margin-top: 10px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.pg-thumbs::-webkit-scrollbar { display: none; }
.pg-thumb {
    position: relative; flex: 0 0 4.5rem; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; border-radius: var(--radius-xl, .75rem); background: var(--color-soft, #f3f4f6); opacity: .6;
    transition: opacity .15s, border-color .15s;
}
.pg-thumb.on { border-color: var(--color-ink, #111); opacity: 1; }
.pg-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pg-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .3); color: #fff; font-size: 14px; }

/* ---------- التكبير (شاشة كاملة — نفس عارض صفحة العرض) ---------- */
.pgl { position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column; background: #0b0b0d; color: #fff; }
.pgl[hidden] { display: none; }
.pgl-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 6px; }
.pgl-n { min-width: 40px; font-size: 13px; font-weight: 800; opacity: .85; direction: ltr; }
.pgl-x { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .14); color: #fff; font-size: 18px; cursor: pointer; }
.pgl-body { position: relative; display: flex; flex: 1; min-height: 0; }
.pgl-track { display: flex; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.pgl-track::-webkit-scrollbar { display: none; }
.pgl-track figure { position: relative; display: flex; flex: 0 0 100%; align-items: center; justify-content: center; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.pgl-track img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pgl-track figcaption { position: absolute; top: 8px; right: 12px; padding: 3px 11px; border-radius: 999px; background: rgb(255 255 255 / .16); font-size: 12.5px; font-weight: 800; }
.pgl-dots { display: flex; justify-content: center; gap: 6px; min-height: 7px; padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px)); }
.pgl-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgb(255 255 255 / .35); }
.pgl-dots i.on { background: #fff; }
.pgl-nav { display: none; }
@media (hover: hover) and (min-width: 768px) {
    .pgl-nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
    .pgl-nav:hover { background: rgb(255 255 255 / .24); }
    .pgl-prev { right: 16px; }
    .pgl-next { left: 16px; }
    .pgl.one .pgl-nav { display: none; }
}
html.pg-lock, html.pg-lock body { overflow: hidden; }
/* متصفح فيسبوك: شريطه التحتاني بيغطي النقط */
html.in-fb .pgl-dots { padding-bottom: calc(14px + var(--fbbar, 0px)); }
