/**
 * CSS público para o visualizador WP360
 * 
 * Estilos para o visualizador 360° no frontend
 * Mobile first para garantir responsividade em todos os dispositivos
 *
 * @package    WP360
 * @author     Dante Testa <https://dantetesta.com.br>
 */

/**
 * Container principal do visualizador
 */
.wp360-wrapper {
    position: relative;
    width: 100%; /* Garantir que ocupe 100% da largura */
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.4;
}

/**
 * Cursor personalizado para indicar arrasto horizontal
 */
.wp360-360-canvas {
    cursor: grab;
    cursor: -webkit-grab;
}

/**
 * Estilos removidos do preloader
 */

/* Estilos de preloader removidos */

/**
 * Botão 360°
 */
/* Indicador 360 graus */
.wp360-360btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.wp360-360-arrow {
    margin-left: 3px;
    font-size: 14px;
    display: inline-block;
}

/* Controles de navegação left-right */
.wp360-nav-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 15%;
    z-index: 10;
    pointer-events: none; /* Permite cliques nos elementos abaixo */
}

.wp360-nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
    pointer-events: auto; /* Ativa interação para este elemento */
}

.wp360-nav-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
}

.wp360-nav-btn:active {
    transform: scale(0.95);
}

.wp360-nav-btn svg {
    width: 20px;
    height: 20px;
    fill: #444;
}

/* Estilo para indicar rotação automática */
.wp360-auto-rotating {
    cursor: not-allowed !important;
}

/* Adaptação para dispositivos móveis */
@media (max-width: 767px) {
    /* Estilos de botões de navegação removidos */
}

/**
 * Container principal - Mobile First
 */
.wp360-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    max-width: 100%;
    position: relative;
}

/**
 * Container de loading - Overlay com barra de progresso
 */
.wp360-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

/**
 * Barra de progresso do loading
 */
.wp360-progress-container {
    width: 80%;
    max-width: 300px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

/**
 * Barra de progresso interna
 */
.wp360-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #333, #666);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/**
 * Texto de porcentagem do loading
 */
.wp360-loading-text {
    font-size: 10px;
    color: #333;
    margin-top: 4px;
    font-weight: 600;
    animation: textPulse 1.5s infinite ease-in-out;
}

/**
 * Canvas principal do visualizador 360°
 * Container para as imagens e anel rotativo
 */
.wp360-360-canvas {
    position: relative;
    width: 100%;
    height: 280px; /* Altura para mobile */
    margin: 0 auto;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    box-sizing: border-box;
}

/**
 * Container principal da imagem rotacionada
 */
.wp360-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

/**
 * Imagem do produto em rotação
 * Tamanho aumentado em 30% conforme solicitado
 */
.wp360-image-container img {
    width: auto;
    height: auto;
    max-height: 100%;
    max-width: 100%;
    transform: translateY(-30px) scale(1.3); /* Ajuste vertical + aumento de 30% */
    display: block;
    transform-origin: center center;
}

/**
 * Container do anel 360° na base
 */
.wp360-ring-container {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1;
    pointer-events: none;
}

/**
 * Imagem do anel 360°
 */
.wp360-ring-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    opacity: 0.9;
    object-fit: contain;
}

/* Os estilos para botões de navegação foram removidos conforme solicitado */

/**
 * Área de controles separada
 */
.wp360-controls-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -60px;
}

/**
 * Responsividade - Tablets
 */
@media (min-width: 768px) {
    .wp360-container {
        max-width: 650px;
    }
    
    .wp360-360-canvas {
        height: 500px;
    }
    
    .wp360-ring-container {
        height: 70px;
    }
    
    .wp360-ring-image {
        max-width: 500px;
    }
    
    /* Referências aos botões de navegação removidas */
}

/**
 * Responsividade - Desktop
 */
@media (min-width: 1024px) {
    .wp360-container {
        max-width: 800px;
    }
    
    .wp360-360-canvas {
        height: 600px;
    }
    
    .wp360-ring-container {
        height: 150px;
    }
    
    .wp360-ring-image {
        max-width: 600px;
    }
}

/**
 * Label para o nome da cor
 */
/**
 * Label da cor atual
 * Margem superior reduzida para aproximar do visualizador
 */
.wp360-label {
    text-align: center;
    margin: 35px 0 5px; /* Redução de 30px na margem superior */
    font-size: 0.7em !important;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/**
 * Controles de cores
 * Margem reduzida para aproximar as bolinhas do label
 */
.wp360-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 5px auto; /* Reduzido de 15px para 5px */
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    width: 100%;
}

/**
 * Animações para o visualizador 360°
 */
@keyframes softPulse {
    0% {
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
    }
}

/**
 * Animação de pulsar para o texto de loading
 */
@keyframes textPulse {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

/**
 * Animação para fade de baixo para cima
 */
@keyframes fadeUpIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(1.3);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1.3);
    }
}

/**
 * Estilo base para as bolinhas de cor - Mobile First
 */
.wp360-color-ball {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 0 4px;
}

/**
 * Efeito hover para feedback visual ao passar o mouse
 */
.wp360-color-ball:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

/**
 * Estilo para a bolinha de cor selecionada
 * Visual mais suave e elegante
 */
.wp360-color-ball.selected {
    transform: scale(1.2);
    z-index: 2;
    animation: softPulse 2s infinite ease-in-out;
    border-color: transparent;
}

/**
 * Versão para tablets e desktop
 */
@media (min-width: 768px) {
    .wp360-color-ball {
        width: 30px;
        height: 30px;
        margin: 0 6px;
    }
}

/**
 * Mensagens de erro
 */
.wp360-error {
    padding: 20px;
    background-color: #fff3f3;
    border: 1px solid #ffcaca;
    border-radius: 5px;
    color: #d32f2f;
    text-align: center;
    margin: 15px 0;
}

/**
 * Acessibilidade - Foco nos elementos interativos
 */
.wp360-360-canvas:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.wp360-color-ball:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/**
 * Responsividade - Tablets
 */
@media screen and (min-width: 768px) {
    .wp360-360-canvas {
        max-width: 650px;
    }
    
    .wp360-360btn {
        padding: 6px 14px;
        font-size: 14px;
    }
    
    .wp360-color-ball {
        width: 30px;
        height: 30px;
    }
    
    .wp360-label {
        font-size: 20px;
    }
}

/**
 * Responsividade - Desktop
 */
@media screen and (min-width: 1024px) {
    .wp360-360-canvas {
        max-width: 800px;
    }
    
    .wp360-360btn {
        padding: 8px 16px;
        font-size: 16px;
    }
    
    .wp360-color-ball {
        width: 36px;
        height: 36px;
    }
}
