/**
 * Product Gallery - COMPLETE REBUILD
 * Prosta, działająca galeria
 * @package Drewniane
 */

/* ==========================================================================
   GŁÓWNE ZDJĘCIE
   ========================================================================== */

.drewniane-gallery-main {
    width: 100%;
    margin-bottom: 1rem;
    cursor: pointer;
    background: #fff;
}

.drewniane-gallery-main-img {
    width: 100%;
    height: auto;
    display: block;
}

.drewniane-gallery-main:hover .drewniane-gallery-main-img {
    opacity: 0.95;
}

/* ==========================================================================
   MINIATURKI Z PRZEWIJANIEM
   ========================================================================== */

.drewniane-gallery-thumbs-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    margin-top: 1rem;
}

.drewniane-gallery-thumbs-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.drewniane-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.drewniane-gallery-thumb {
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    flex-shrink: 0;
}

.drewniane-gallery-thumb:hover {
    border-color: #8b4513;
    transform: translateY(-2px);
}

.drewniane-gallery-thumb.active {
    border-color: #8b4513;
    box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.2);
}

.drewniane-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Przyciski przewijania miniaturek - białe kółka, czarne strzałki, czarny border */
.drewniane-gallery-thumbs-prev,
.drewniane-gallery-thumbs-next {
    width: 35px; /* 50px - 30% = 35px */
    height: 35px;
    background: #fff;
    border: 2px solid #000;
    color: #000;
    font-size: 25px; /* 36px - 30% = 25px */
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 0 0 7px 0; /* padding-bottom 7px dla centrowania */
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.drewniane-gallery-thumbs-prev:hover,
.drewniane-gallery-thumbs-next:hover {
    background: #000;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.drewniane-gallery-thumbs-prev:disabled,
.drewniane-gallery-thumbs-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: scale(1);
}

.drewniane-gallery-thumbs-prev:disabled:hover,
.drewniane-gallery-thumbs-next:disabled:hover {
    background: #fff;
    color: #000;
    transform: scale(1);
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */

.drewniane-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.95);
    display: none;
}

.drewniane-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.drewniane-lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drewniane-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: none;
}

.drewniane-lightbox-img.active {
    display: block;
}

/* Przyciski lightbox - BEZ kółek, tylko białe strzałki */
.drewniane-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 50px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.drewniane-lightbox-close:hover {
    color: #ddd;
    transform: scale(1.2);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
}

.drewniane-lightbox-prev,
.drewniane-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 60px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 5px 0; /* padding-bottom 5px dla centrowania */
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.drewniane-lightbox-prev {
    left: 20px;
}

.drewniane-lightbox-next {
    right: 20px;
}

.drewniane-lightbox-prev:hover,
.drewniane-lightbox-next:hover {
    color: #ddd;
    transform: translateY(-50%) scale(1.2);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
}

/* Miniaturki w lightboxie */
.drewniane-lightbox-thumbs {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    z-index: 10;
}

.drewniane-lightbox-thumb {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 4px;
}

.drewniane-lightbox-thumb:hover {
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.drewniane-lightbox-thumb.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .drewniane-gallery-thumb {
        width: 60px;
        height: 60px;
    }

    /* Mniejsze przyciski miniaturek na mobile */
    .drewniane-gallery-thumbs-prev,
    .drewniane-gallery-thumbs-next {
        width: 28px; /* 35px * 0.8 */
        height: 28px;
        font-size: 20px;
    }

    /* Strzałki lightbox na mobile - bez kółek */
    .drewniane-lightbox-prev,
    .drewniane-lightbox-next {
        font-size: 45px;
    }

    .drewniane-lightbox-close {
        font-size: 40px;
    }

    .drewniane-lightbox-thumbs {
        max-width: 95%;
        padding: 8px;
    }

    .drewniane-lightbox-thumb {
        width: 60px;
        height: 60px;
    }

    .drewniane-lightbox-prev {
        left: 10px;
    }

    .drewniane-lightbox-next {
        right: 10px;
    }

    .drewniane-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}
