/* ==========================================================
   دیجی‌لند کیت - استایل اختصاصی گالری تصاویر و لایت‌باکس
   نسخه اصلاح‌شده: مخفی بودن قطعی لایت‌باکس در لود اولیه و تراز RTL فلش‌ها
   ========================================================== */

:root {
    --dl-primary: #e60067;
    --dl-border: #e2e8f0;
    --dl-radius: 14px;
    --dl-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.digiland-product-gallery-wrap {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    direction: rtl !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.digiland-main-img-holder {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    background: #ffffff !important;
    border: 1px solid var(--dl-border) !important;
    border-radius: var(--dl-radius) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04) !important;
}

.digiland-main-img-holder.is-lightbox-enabled {
    cursor: zoom-in !important;
}

.digiland-main-img-holder img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    transition: opacity 0.25s ease, transform 0.3s ease !important;
    display: block !important;
}

.digiland-main-img-holder.is-lightbox-enabled:hover img {
    transform: scale(1.03) !important;
}

/* دکمه ذره‌بین بزرگ‌نمایی روی عکس */
.dl-gallery-zoom-trigger {
    all: unset !important;
    box-sizing: border-box !important;
    position: absolute !important;
    bottom: 12px !important;
    left: 12px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 15 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: var(--dl-transition) !important;
}

.dl-gallery-zoom-trigger:hover {
    background: #ffffff !important;
    color: var(--dl-primary) !important;
    transform: scale(1.08) !important;
}

.digiland-sale-badge {
    position: absolute !important;
    z-index: 10 !important;
    background: linear-gradient(135deg, #ff1744 0%, #e60067 100%) !important;
    color: #ffffff !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 14px rgba(230, 0, 103, 0.35) !important;
    padding: 6px 14px !important;
    border-radius: 30px !important;
}

.digiland-sale-badge.is-hidden,
.digiland-sale-badge[style*="display: none"],
.digiland-sale-badge[style*="display:none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.digiland-sale-badge.badge-top-right { top: 14px !important; right: 14px !important; }
.digiland-sale-badge.badge-top-left { top: 14px !important; left: 14px !important; }
.digiland-sale-badge.badge-bottom-right { bottom: 14px !important; right: 14px !important; }
.digiland-sale-badge.badge-bottom-left { bottom: 14px !important; left: 14px !important; }

/* بندانگشتی‌های زیر تصویر */
.digiland-thumbs-strip {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    direction: rtl !important;
}

.digiland-thumb-item {
    width: 74px !important;
    height: 74px !important;
    aspect-ratio: 1 / 1 !important;
    border: 2px solid var(--dl-border) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    cursor: pointer !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px !important;
    box-sizing: border-box !important;
    transition: var(--dl-transition) !important;
}

.digiland-thumb-item img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    display: block !important;
}

.digiland-thumb-item:hover {
    border-color: #cbd5e1 !important;
    transform: translateY(-2px) !important;
}

.digiland-thumb-item.active {
    border-color: var(--dl-primary) !important;
    box-shadow: 0 4px 12px rgba(230, 0, 103, 0.22) !important;
}

/* ==========================================================
   کادر لایت‌باکس تمام‌صفحه بزرگ‌نمایی تصویر (Lightbox Modal)
   مخفی در لود اولیه و نمایش صرفاً با کلاس is-active
   ========================================================== */
.digiland-gallery-lightbox {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999999 !important;
    align-items: center !important;
    justify-content: center !important;
    direction: rtl !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.22s ease, visibility 0.22s ease !important;
}

.digiland-gallery-lightbox.is-active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.dl-lightbox-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 1 !important;
}

.dl-lightbox-dialog {
    position: relative !important;
    z-index: 2 !important;
    width: 92% !important;
    max-width: 900px !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    box-sizing: border-box !important;
}

.dl-lightbox-top-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    color: #ffffff !important;
    padding: 0 4px !important;
}

.dl-lightbox-counter {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #cbd5e1 !important;
    direction: rtl !important;
}

.dl-lightbox-close-btn {
    all: unset !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: var(--dl-transition) !important;
}

.dl-lightbox-close-btn:hover {
    background: var(--dl-primary) !important;
    transform: rotate(90deg) !important;
}

.dl-lightbox-viewer {
    position: relative !important;
    width: 100% !important;
    height: 65vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.dl-lightbox-img-wrap {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.dl-lightbox-img-wrap img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    transition: opacity 0.2s ease !important;
}

/* دکمه‌های ناوبری قبلی و بعدی در لایت‌باکس بر اساس استانداردهای RTL */
.dl-lightbox-nav-btn {
    all: unset !important;
    box-sizing: border-box !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: var(--dl-transition) !important;
    z-index: 10 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.dl-lightbox-nav-btn:hover {
    background: var(--dl-primary) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

/* در چیدمان RTL: دکمه قبلی در سمت راست و دکمه بعدی در سمت چپ قرار می‌گیرد */
.dl-lightbox-prev {
    right: 12px !important;
    left: auto !important;
}

.dl-lightbox-next {
    left: 12px !important;
    right: auto !important;
}

.dl-lightbox-thumbs-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding: 6px 0 !important;
    direction: rtl !important;
}

.dl-lb-thumb-btn {
    all: unset !important;
    width: 54px !important;
    height: 54px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    opacity: 0.55 !important;
    transition: var(--dl-transition) !important;
    flex-shrink: 0 !important;
}

.dl-lb-thumb-btn img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.dl-lb-thumb-btn.is-active,
.dl-lb-thumb-btn:hover {
    opacity: 1 !important;
    border-color: var(--dl-primary) !important;
    transform: scale(1.05) !important;
}