/*
 * 🖼️ معرضُ صور صفحة الخدمة (partials/feature-gallery) — يُحمَّل في الصفحة التي فيها معرضٌ وحدَها.
 * المبدّلُ بشكل «شهري / سنوي» في صفحة الأسعار (#dfe6f9 · حبّةٌ بيضاء) بأصنافٍ مستقلّة: `.tab` يربطها سكربتُ الفوتر.
 */

.sg-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2rem;
}
.sg-seg {
    display: inline-flex;
    gap: 5px;
    padding: 5px;
    background: #dfe6f9;
    border-radius: 15px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.sg-seg::-webkit-scrollbar { display: none; }
.sg-seg-btn {
    flex: 0 0 auto;
    min-width: 120px;
    min-height: 44px;
    padding: 6px 18px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #6b6f8c;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.sg-seg-btn:hover { color: #1c2041; }
.sg-seg-btn.is-on {
    background: #fff;
    color: #000;
    box-shadow: 0 1px 3px rgba(28, 32, 65, .12);
}
.sg-seg-btn:focus-visible { outline: 2px solid #405189; outline-offset: 2px; }

.sg-card { height: 100%; display: flex; flex-direction: column; }
.sg-title {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 .75rem;
}
.sg-thumb {
    position: relative;
    display: block;
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, #e9eefb 0%, #f4f6fd 100%);
    border: 1px solid #e3e8f6;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.sg-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(28, 32, 65, .14);
    background: #fff;
}
.sg-zoom {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .92);
    color: #405189;
    box-shadow: 0 2px 8px rgba(28, 32, 65, .15);
    opacity: 0;
    transition: opacity .2s ease;
}
.sg-thumb:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(28, 32, 65, .12); }
.sg-thumb:hover .sg-zoom,
.sg-thumb:focus-visible .sg-zoom { opacity: 1; }
.sg-thumb:focus-visible { outline: 2px solid #405189; outline-offset: 3px; }
@media (hover: none) { .sg-zoom { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .sg-thumb, .sg-seg-btn { transition: none; }
    .sg-thumb:hover { transform: none; }
}

/* ── زرُّ صفحة التحميل تحت المعرض ── */
.sg-download {
    margin-top: 2.5rem;
    text-align: center;
}
.sg-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(64, 81, 137, .25);
}
.sg-download-btn .bi { font-size: 1.25em; }
.sg-download-note {
    margin: .75rem 0 0;
    color: #6b6f8c;
    font-size: 14px;
}

/* ── نافذةُ التكبير ── */
.sg-lb {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(12, 16, 32, .96);
    color: #fff;
}
.sg-lb[open] { display: flex; flex-direction: column; }
.sg-lb::backdrop { background: rgba(0, 0, 0, .6); }
.sg-lb-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}
.sg-lb-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-weight: 700;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sg-lb-count { color: rgba(255, 255, 255, .7); font-size: 14px; }
.sg-lb-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 64px 24px;
}
.sg-lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
    cursor: grab;   /* تُسحب بالفأرة للتالي/السابق (site-gallery.js) */
}
.sg-lb-img:active { cursor: grabbing; }
.sg-lb-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
}
.sg-lb-btn:hover { background: rgba(255, 255, 255, .22); }
.sg-lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sg-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.sg-lb-prev { inset-inline-start: 12px; }
.sg-lb-next { inset-inline-end: 12px; }
.sg-lb-nav[hidden] { display: none; }

@media (max-width: 575.98px) {
    .sg-seg-btn { min-width: 0; padding: 6px 14px; }
    .sg-lb-stage { padding: 0 8px 16px; }
    .sg-lb-nav { top: auto; bottom: 20px; transform: none; background: rgba(0, 0, 0, .45); }
}
