/* ==========================================================================
   ESTILOS ESPECÍFICOS PARA CARROSSEL.HTML
   ==========================================================================
   Este arquivo contém todos os estilos específicos para a página carrossel.html
   ========================================================================== */

/* Reset CSS básico */
* {
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Estilos para o body do carrossel */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Estilos do carrossel */
.carrossel {
    position: relative;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: #f0f2f5;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    max-width: 100vw;
}

/* Container da imagem principal */
.carrossel-main {
    max-width: 1080px;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    background: transparent;
    pointer-events: none;
}

/* Imagens principais */
.carrossel-img {
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.5s ease-in-out;
    display: none;
    margin: 0 auto;
    pointer-events: auto;
}

.carrossel-img.ativa {
    display: block;
}

.carrossel-img:hover {
    transform: scale(1.02);
}

/* Containers das imagens de preview */
.carrossel-preview {
    position: absolute;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

/* Preview anterior (esquerda) - máximo 640px */
.carrossel-preview.prev {
    left: max(40px, calc(50vw - 640px));
    right: 50%;
    max-width: 640px;
}

/* Preview seguinte (direita) - máximo 640px */
.carrossel-preview.next {
    right: max(40px, calc(50vw - 640px));
    left: 50%;
    max-width: 640px;
}

/* Imagens de preview */
.carrossel-img-preview {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
    position: absolute;
}

/* Preview anterior - imagem posicionada à direita (no centro), esvanece para esquerda */
.carrossel-preview.prev .carrossel-img-preview {
    position: absolute;
    right: 0;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    mask: linear-gradient(to left, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask: linear-gradient(to left, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Preview seguinte - imagem posicionada à esquerda (no centro), esvanece para direita */
.carrossel-preview.next .carrossel-img-preview {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    mask: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

.carrossel-preview:hover .carrossel-img-preview {
    opacity: 0.8;
}

/* Botões do carrossel */
.carrossel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.4em;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    z-index: 10;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    opacity: 0.7;
}

@media (max-width: 599px) {
    /* Esconder previews no mobile */
    .carrossel-preview {
        display: none;
    }
    
    /* Carrossel volta ao layout original */
    .carrossel {
        padding: 0;
    }
    
    .carrossel-main {
        max-width: none;
        width: 100%;
    }
    
    .carrossel-img {
        width: 100%;
        height: 100vh;
    }
    
    .carrossel-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
        opacity: 0.6;
    }
    
    .carrossel-btn.esq {
        left: 10px;
    }
    
    .carrossel-btn.dir {
        right: 10px;
    }
}

.carrossel-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.carrossel-btn.esq {
    left: max(10px, calc(50% - 540px - 25px));
}

.carrossel-btn.dir {
    right: max(10px, calc(50% - 540px - 25px));
}

/* Ajuste para telas menores que o container da imagem central */
@media (max-width: 1130px) {
    .carrossel-btn.esq {
        left: 10px;
    }
    
    .carrossel-btn.dir {
        right: 10px;
    }
}

/* Estilos do popup */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.popup-wrapper {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    padding-bottom: 100px;
}

.popup-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background-color: transparent;
    border-radius: 8px;
}

.popup-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
}

/* Header do popup */
.popup-header {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: row;
    gap: 15px;
    z-index: 1002;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.popup-close,
.share-toggle {
    color: #fff;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.8);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.popup-close {
    font-size: 32px;
}

.share-toggle {
    font-size: 18px;
}

.popup-close:hover,
.share-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
}

.share-toggle.active {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

@media (max-width: 599px) {
    .popup-close,
    .share-toggle {
        width: 40px;
        height: 40px;
    }
    
    .popup-close {
        font-size: 28px;
    }
    
    .share-toggle {
        font-size: 18px;
    }
    
    /* Fallback para mobile - botões nas bordas da tela */
    .popup-header {
        position: fixed;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.6);
        padding: 8px;
        border-radius: 12px;
    }
    
    .popup-nav {
        position: fixed;
        width: 100%;
        left: 0;
        padding: 0 15px;
    }
    
    .share-buttons {
        position: fixed;
        top: 85px;
        right: 20px;
    }
}

/* Navegação do popup */
.popup-nav {
    position: absolute;
    width: calc(100% + 120px);
    top: 50%;
    left: -60px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0;
    z-index: 1005;
    pointer-events: none;
    box-sizing: border-box;
}

.popup-nav-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    backdrop-filter: blur(5px);
}

.popup-nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-2px);
}

.popup-nav-btn i {
    font-size: 24px;
}

@media (max-width: 599px) {
    .popup-nav {
        padding: 0 15px;
    }
    
    .popup-nav-btn {
        width: 48px;
        height: 48px;
        background: rgba(0, 0, 0, 0.8);
        border-color: rgba(255, 255, 255, 0.3);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        margin: 0;
    }
    
    .popup-nav-btn:active {
        background: rgba(0, 0, 0, 0.95);
        transform: scale(0.95);
    }
}

/* Botões de compartilhamento */
.share-buttons {
    position: absolute;
    top: 70px;
    right: 10px;
    display: none;
    flex-direction: column;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 12px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    z-index: 1002;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.share-buttons.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.popup-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 16px;
    transition: opacity 0.3s;
}

.popup-btn:hover {
    opacity: 0.8;
}

.popup-btn.share {
    width: 45px;
    height: 45px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-btn.share:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.popup-btn.share i {
    line-height: 1;
}

@media (max-width: 599px) {
    .share-buttons {
        padding: 12px 20px;
        margin: 0 10px;
    }
    
    .popup-btn.share {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* Previne scroll do body quando popup está aberto */
body.popup-open {
    overflow: hidden;
}

/* Ajustes finais para responsividade */
@media (max-width: 599px) {
    .carrossel {
        border-radius: 0;
    }
}