/* PLIK: assets/css/gallery.css - galeria zdjec produktu (lightbox) */

.m-product-thumb {
    cursor: pointer;
}

#m-gallery-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 20, 35, 0.92);
    z-index: 2147483000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#m-gallery-box {
    position: relative;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.m-gallery-close {
    position: absolute;
    top: -46px;
    right: 0;
    background: none;
    border: none;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    z-index: 5;
}

.m-gallery-close:hover { color: #a259ff; }

#m-gallery-main-img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 10px;
}

.m-gallery-nav {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #f1f4f8;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    color: #1d2b4f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    padding: 0;
}

.m-gallery-nav:hover {
    color: #a259ff;
    border-color: #a259ff;
}

.m-gallery-prev { left: -64px; }
.m-gallery-next { right: -64px; }

#m-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
}

#m-gallery-thumbs img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.55;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

#m-gallery-thumbs img.active,
#m-gallery-thumbs img:hover {
    opacity: 1;
    border-color: #a259ff;
}

/* Na waskich ekranach nie ma miejsca poza ramka - wracamy do srodka nad zdjeciem */
@media (max-width: 820px) {
    .m-gallery-prev { left: 8px; }
    .m-gallery-next { right: 8px; }
    .m-gallery-close {
        top: 10px;
        right: 14px;
        color: #aaa;
    }
    .m-gallery-close:hover { color: #1d2b4f; }
}

@media (max-width: 600px) {
    #m-gallery-box { padding: 16px; }
    .m-gallery-nav { width: 36px; height: 36px; font-size: 20px; }
}
