/* Estilos para a nova galeria de produtos - implementação completa do padrão Amazon */

.amazon-gallery {
    display: flex;
    flex-direction: row;
    gap: 15px;
    position: relative;
    margin-bottom: 30px;
}

/* Estilos para desktop - thumbnails à esquerda */
@media (min-width: 768px) {
    .amazon-gallery-container {
        display: flex;
        flex-direction: row;
        width: 100%;
    }
    
    .amazon-thumbnails {
        display: flex;
        flex-direction: column;
        width: 80px;
        overflow-y: auto;
        max-height: 500px; /* Aumentado para mostrar mais miniaturas */
        padding-right: 10px;
        scrollbar-width: thin;
        scrollbar-color: #d5d9d9 #f8f8f8;
    }
    
    .amazon-thumbnails::-webkit-scrollbar {
        width: 6px;
    }
    
    .amazon-thumbnails::-webkit-scrollbar-track {
        background: #f8f8f8;
    }
    
    .amazon-thumbnails::-webkit-scrollbar-thumb {
        background-color: #d5d9d9;
        border-radius: 6px;
    }
    
    .amazon-image-zoom-container {
        flex: 1;
        position: relative;
    }
}

/* Estilos para mobile - thumbnails abaixo */
@media (max-width: 767px) {
    .amazon-gallery-container {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .amazon-thumbnails {
        display: flex;
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        padding-top: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .amazon-thumbnails::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .amazon-image-zoom-container {
        width: 100%;
        position: relative;
    }
}

/* Estilos para as miniaturas */
.amazon-thumbnail {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    position: relative;
    opacity: 0.7;
    width: 80px !important;
    height: 80px !important;
    flex: 0 0 80px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.amazon-thumbnail.active {
    border-color: #e77600; /* Cor padrão Amazon */
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5); /* Sombra padrão Amazon */
    opacity: 1;
}

.amazon-thumbnail:hover {
    opacity: 1;
}

.amazon-thumbnail.clicked {
    transform: scale(0.95);
}

.amazon-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Alterado para contain para garantir que a imagem seja exibida completamente */
    display: block;
}

/* Botão "Ver mais imagens" */
.amazon-show-all-images {
    cursor: pointer;
    border: 2px solid #d5d9d9;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    position: relative;
    width: 80px !important;
    height: 80px !important;
    flex: 0 0 80px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background-color: #f8f8f8;
    color: #0066c0;
    font-weight: bold;
    font-size: 16px;
}

.amazon-show-all-images:hover {
    border-color: #e77600;
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5);
}

/* Estilos para desktop */
@media (min-width: 768px) {
    .amazon-thumbnails {
        width: 90px; /* Aumentado para acomodar as miniaturas maiores */
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Estilos para mobile */
@media (max-width: 767px) {
    .amazon-thumbnail {
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .amazon-thumbnails {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 10px 0;
    }
    
    .amazon-show-all-images {
        margin-right: 10px;
        margin-bottom: 0;
    }
}

/* Estilos para a imagem principal - Otimizado para exibição completa */
.amazon-main-image {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f8f8f8;
    /* Altura adaptativa baseada na proporção da imagem */
    min-height: 350px;
    max-height: 550px;
    padding-bottom: 10px;
}

.amazon-main-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Mantém a proporção da imagem */
    transition: all 0.3s ease;
    /* Remover qualquer borda vermelha que possa estar aparecendo */
    border: none;
    /* Garantir que a imagem seja exibida completamente */
    position: relative;
    margin: auto;
}

/* Efeitos de transição para troca de imagens */
.amazon-main-image img.fade-out {
    opacity: 0.5;
    transform: scale(0.98);
}

.amazon-main-image img.fade-in {
    opacity: 1;
    transform: scale(1);
}

/* Estilos para os botões de navegação */
.amazon-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid #d5d9d9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000; /* Valor alto para garantir que fique acima de outros elementos */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.amazon-gallery-nav:hover {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    border-color: #6f42c1; /* Cor roxa conforme UX-UI-IMPROVEMENTS.md */
    opacity: 0.9;
}

.amazon-gallery-nav.clicked {
    transform: translateY(-50%) scale(0.95);
}

.amazon-gallery-prev {
    left: 10px;
}

.amazon-gallery-next {
    right: 10px;
}

/* Ajuste para os botões de navegação na galeria principal */
.amazon-gallery-container .amazon-gallery-prev,
.amazon-gallery-container .amazon-gallery-next {
    z-index: 1000; /* Valor alto para garantir que fique acima de outros elementos */
}

/* Posicionamento correto dos botões de navegação */
@media (min-width: 768px) {
    .amazon-gallery-container .amazon-gallery-prev {
        left: 100px; /* Posiciona à direita das miniaturas em desktop */
    }
}

@media (max-width: 767px) {
    .amazon-gallery-container .amazon-gallery-prev {
        left: 10px; /* Posiciona à esquerda em dispositivos móveis */
    }
    
    /* Aumentar área clicável em dispositivos móveis */
    .amazon-gallery-nav {
        width: 48px;
        height: 48px;
    }
}

/* Garantir que os ícones dentro dos botões sejam visíveis */
.amazon-gallery-nav i {
    font-size: 18px;
    color: #333;
}

/* Contador de imagens */
.amazon-gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 10;
    font-weight: 500;
}

/* Estilos para o zoom - Otimizado para exibição completa (padrão Amazon) */
.amazon-zoom-window {
    position: absolute;
    top: 0;
    left: 100%;
    width: 300px;
    height: 300px;
    margin-left: 20px;
    overflow: hidden;
    border: 1px solid #d5d9d9;
    background-color: white;
    z-index: 9999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: none;
}

/* Botão de fechar para a janela de zoom */
.amazon-zoom-window-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 16px;
    z-index: 10000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.amazon-zoom-window-close:hover {
    border-color: #e77600;
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5);
}

.amazon-zoom-image {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    max-height: none;
}

/* Lente de zoom - Otimizada para melhor visualização (padrão Amazon) */
.amazon-zoom-lens {
    position: absolute;
    border: 1px solid #d5d9d9;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: crosshair;
    width: 100px;
    height: 100px;
    display: none;
    pointer-events: none;
    z-index: 9998;
    /* Garantir que a lente não ultrapasse os limites da imagem */
    box-sizing: border-box;
}

/* Indicador de carregamento para o zoom */
.amazon-zoom-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-size: 14px;
    color: #333;
}

.amazon-zoom-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #e77600;
    border-radius: 50%;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cursor personalizado para área de zoom */
.amazon-main-image.zoomable {
    cursor: crosshair !important;
}

/* Ajuste para o container de zoom - Otimizado para exibição completa */
.amazon-image-zoom-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Responsividade para o zoom */
@media (max-width: 992px) {
    .amazon-zoom-window {
        display: none !important; /* Desativa o zoom em telas menores */
    }
    
    .amazon-zoom-lens {
        display: none !important; /* Desativa a lente em telas menores */
    }
    
    /* Ajustes para garantir visualização completa em dispositivos móveis */
    .amazon-main-image {
        min-height: 250px;
        max-height: 400px;
    }
}

/* Lightbox estilo Amazon - Otimizado para exibição completa */
.amazon-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.amazon-lightbox.active {
    opacity: 1;
    display: block;
}

.amazon-lightbox-container {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.amazon-lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.amazon-lightbox-sidebar {
    width: 300px;
    padding: 20px;
    box-sizing: border-box;
    border-left: 1px solid #eee;
    overflow-y: auto;
    background-color: #fff;
}

.amazon-lightbox-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imagem do lightbox - Otimizada para exibição completa */
.amazon-lightbox-image {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    /* Garantir que a imagem seja exibida completamente */
    width: auto;
    height: auto;
    /* Centralizar a imagem */
    position: relative;
    margin: auto;
    transition: all 0.3s ease;
}

.amazon-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 24px;
    transition: all 0.2s ease;
    z-index: 10001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.amazon-lightbox-close:hover {
    border-color: #e77600;
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5);
}

.amazon-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 24px;
    transition: all 0.2s ease;
    z-index: 10001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.amazon-lightbox-nav:hover {
    border-color: #e77600;
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5);
}

.amazon-lightbox-prev {
    left: 20px;
}

.amazon-lightbox-next {
    right: 20px;
}

.amazon-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.amazon-lightbox-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #0F1111;
    line-height: 1.3;
}

.amazon-lightbox-description {
    font-size: 14px;
    color: #565959;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Miniaturas do lightbox - Otimizadas para melhor visualização */
.amazon-lightbox-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.amazon-lightbox-thumbnail {
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.amazon-lightbox-thumbnail.active {
    border-color: #e77600;
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5);
    opacity: 1;
}

.amazon-lightbox-thumbnail:hover {
    opacity: 1;
}

.amazon-lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botões de compartilhamento no lightbox */
.amazon-lightbox-share {
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

.amazon-lightbox-share-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.amazon-lightbox-social-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.amazon-lightbox-social-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}

.amazon-lightbox-social-button:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.amazon-lightbox-social-button.facebook {
    background-color: #3b5998;
}

.amazon-lightbox-social-button.twitter {
    background-color: #1da1f2;
}

.amazon-lightbox-social-button.whatsapp {
    background-color: #25d366;
}

.amazon-lightbox-social-button.pinterest {
    background-color: #bd081c;
}

.amazon-lightbox-social-button.email {
    background-color: #666;
}

.amazon-lightbox-social-button.copy {
    background-color: #333;
}

.amazon-lightbox-social-button.copy-feedback {
    background-color: #28a745;
}

/* Responsividade para o Lightbox - Otimizada para exibição completa */
@media (max-width: 992px) {
    .amazon-lightbox-container {
        flex-direction: column;
        padding: 10px;
        overflow-y: auto;
    }
    
    .amazon-lightbox-main {
        height: 60vh;
        min-height: 300px;
    }
    
    .amazon-lightbox-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #eee;
        padding: 15px 0;
    }
    
    .amazon-lightbox-image {
        max-height: 55vh;
    }
    
    .amazon-lightbox-thumbnails {
        justify-content: center;
    }
    
    .amazon-lightbox-social-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .amazon-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .amazon-lightbox-prev {
        left: 10px;
    }
    
    .amazon-lightbox-next {
        right: 10px;
    }
    
    .amazon-lightbox-close {
        top: 5px;
        right: 5px;
    }
    
    .amazon-lightbox-main {
        height: 50vh;
        min-height: 250px;
    }
    
    .amazon-lightbox-image {
        max-height: 45vh;
    }
}

@media (max-width: 576px) {
    .amazon-lightbox-container {
        padding: 5px;
    }
    
    .amazon-lightbox-main {
        height: 40vh;
        min-height: 200px;
    }
    
    .amazon-lightbox-image {
        max-height: 35vh;
    }
    
    .amazon-lightbox-title {
        font-size: 16px;
    }
    
    .amazon-lightbox-description {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .amazon-lightbox-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .amazon-lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    /* Ajuste para os botões de compartilhamento em telas pequenas */
    .amazon-lightbox .share-buttons {
        justify-content: center;
        padding: 10px 5px;
    }
    
    .amazon-lightbox .share-buttons a {
        width: 36px;
        height: 36px;
    }
}

/* Cursor para indicar que a imagem é clicável */
.amazon-main-image {
    cursor: pointer;
}

/* Estilos para quando não há imagens */
.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-align: center;
    padding: 20px;
}

.no-image i {
    margin-bottom: 10px;
}

.no-image-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    background-color: #f5f5f5;
}

/* Overlay de zoom - Otimizado para exibição completa */
.amazon-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.amazon-zoom-overlay img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    /* Garantir que a imagem seja exibida completamente */
    width: auto;
    height: auto;
}

.amazon-zoom-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 24px;
    z-index: 10001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.amazon-zoom-close:hover {
    background-color: #f5f5f5;
}
