.store-gallery-page {
    background: #f5f8ff;
    min-height: 70vh;
}

.store-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    align-items: start;
}

.store-gallery-card {
    overflow: hidden;
    border: 1px solid rgba(17, 70, 184, .12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    height: 100%;
}

.store-gallery-card:hover {
    transform: translateY(-3px);
    border-color: rgba(17, 70, 184, .28);
    box-shadow: 0 18px 34px rgba(15, 23, 42, .13);
}

.store-gallery-media {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 230px;
    border: 0;
    background: linear-gradient(145deg, #edf4ff, #dbeafe);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}

.store-gallery-media img,
.store-gallery-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-gallery-card-mark-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    pointer-events: none;
}

.store-gallery-card-mark {
    position: absolute;
    border: 2px solid var(--mark-color, #e53935);
    border-radius: 7px;
    background: rgba(255, 255, 255, .05);
}

.store-gallery-card-mark.is-circle {
    border-radius: 999px;
}

.store-gallery-card-mark.is-highlight {
    border-color: transparent;
    background: color-mix(in srgb, var(--mark-color, #facc15) 38%, transparent);
}

.store-gallery-card-freehand {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.store-gallery-file-icon {
    width: 66px;
    height: 66px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1146b8;
    color: #fff;
    font-size: 26px;
    box-shadow: 0 12px 24px rgba(17, 70, 184, .24);
}

.store-gallery-file-icon.is-pdf {
    background: #dc2626;
}

.store-gallery-empty {
    grid-column: 1 / -1;
    border: 1px dashed rgba(17, 70, 184, .28);
    border-radius: 18px;
    background: #fff;
    padding: 28px;
    text-align: center;
}

.store-gallery-pagination {
    margin-top: 24px;
}

.store-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 0;
    background: rgba(2, 6, 23, .82);
    backdrop-filter: blur(5px);
}

.store-gallery-lightbox[hidden] {
    display: none;
}

.store-gallery-lightbox-content {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 24px 72px;
}

.store-gallery-lightbox-content img,
.store-gallery-lightbox-content video {
    max-width: 100%;
    max-height: calc(100vh - 48px);
    border-radius: 16px;
    object-fit: contain;
    background: #000;
}

.store-gallery-lightbox-image-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    line-height: 0;
}

.store-gallery-lightbox-image-wrap > img {
    display: block;
}

.store-gallery-lightbox-mark-layer,
.store-gallery-lightbox-freehand {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.store-gallery-lightbox-mark {
    position: absolute;
    border: 3px solid var(--mark-color, #e53935);
    border-radius: 9px;
    background: rgba(255, 255, 255, .05);
}

.store-gallery-lightbox-mark.is-circle {
    border-radius: 999px;
}

.store-gallery-lightbox-mark.is-highlight {
    border-color: transparent;
    background: color-mix(in srgb, var(--mark-color, #facc15) 38%, transparent);
}

.store-gallery-lightbox-content iframe {
    width: min(980px, 100%);
    height: calc(100vh - 48px);
    border: 0;
    border-radius: 16px;
    background: #fff;
}

.store-gallery-lightbox-details {
    overflow-y: auto;
    background: #fff;
    padding: 30px 24px;
}

.store-gallery-lightbox-details strong {
    display: block;
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 900;
}

.store-gallery-lightbox-details p {
    margin: 0 0 12px;
    color: #475569;
    line-height: 1.55;
    white-space: pre-line;
}

.store-gallery-lightbox-details p[hidden] {
    display: none;
}

.store-gallery-lightbox-empty {
    color: #94a3b8 !important;
    font-style: italic;
}

.store-gallery-lightbox-details a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    border-radius: 999px;
    background: #1146b8;
    color: #fff;
    padding: 10px 15px;
    font-weight: 800;
    text-decoration: none;
}

.store-gallery-lightbox-close {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .2);
}

.store-gallery-lightbox-nav {
    position: fixed;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(17, 70, 184, .2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    color: #1146b8;
    font-size: 38px;
    line-height: 1;
    box-shadow: 0 14px 30px rgba(2, 6, 23, .24);
    transform: translateY(-50%);
}

.store-gallery-lightbox-nav:hover {
    background: #1146b8;
    color: #fff;
}

.store-gallery-lightbox-nav.is-prev {
    left: 18px;
}

.store-gallery-lightbox-nav.is-next {
    right: 358px;
}

.store-gallery-lightbox-nav[hidden] {
    display: none;
}

.store-gallery-lightbox-counter {
    position: fixed;
    left: calc((100vw - 340px) / 2);
    bottom: 18px;
    z-index: 2;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #0f172a;
    padding: 7px 13px;
    font-size: .84rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(2, 6, 23, .2);
}

body.store-gallery-open {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .store-gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .store-gallery-media {
        height: 220px;
    }

    .store-gallery-lightbox {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .store-gallery-lightbox-content {
        padding: 60px 14px 48px;
    }

    .store-gallery-lightbox-details {
        max-height: 36vh;
        padding: 16px;
    }

    .store-gallery-lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 32px;
    }

    .store-gallery-lightbox-nav.is-prev {
        left: 10px;
    }

    .store-gallery-lightbox-nav.is-next {
        right: 10px;
    }

    .store-gallery-lightbox-counter {
        left: 50%;
        bottom: calc(36vh + 10px);
    }
}
