/* ===========================================
   Image Zoom Modal - ProdivetZN
   =========================================== */

/* Cursor de zoom na imagem da pagina */
.main-image-container.has-zoom {
    cursor: zoom-in;
    position: relative;
}

/* Overlay com icone de lupa */
.zoom-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0.8;
    z-index: 2;
}

.main-image-container.has-zoom:hover .zoom-overlay {
    opacity: 1;
    transform: scale(1.1);
}

/* ===========================================
   Modal Overlay
   =========================================== */
.image-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-zoom-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Container da imagem no modal */
.zoom-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.zoom-image-wrapper.dragging {
    cursor: grabbing;
}

/* Imagem ampliada */
.zoom-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.15s ease-out;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* Botao fechar (X) */
.zoom-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 10001;
}

.zoom-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Controlos de zoom (+/-) */
.zoom-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 30px;
    z-index: 10001;
}

.zoom-controls button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.zoom-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.zoom-level {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    min-width: 50px;
    text-align: center;
    user-select: none;
}

.zoom-controls .zoom-reset-btn {
    width: auto;
    border-radius: 20px;
    padding: 0 14px;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
}

/* ===========================================
   Responsivo
   =========================================== */
@media (max-width: 768px) {
    .zoom-close-btn {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .zoom-controls {
        bottom: 20px;
        padding: 6px 12px;
        gap: 6px;
    }

    .zoom-controls button {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .zoom-overlay {
        width: 38px;
        height: 38px;
        font-size: 16px;
        bottom: 14px;
        right: 14px;
    }
}

@media (max-width: 480px) {
    .zoom-image {
        max-width: 100vw;
        max-height: 100vh;
    }

    .zoom-controls {
        bottom: 14px;
    }
}
