/* ==========================================================================
   Estilos para páginas de detalhes de produtos (geradas dinamicamente)
   ========================================================================== */

/* Container da galeria de produtos */
.gallery-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gallery-main-content {
    width: 100%;
    min-height: 400px;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    display: block;
}

@media (max-width: 768px) {
    .gallery-main-content {
        min-height: 300px;
        height: auto;
    }
}

.gallery-main-content img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
}

/* Vídeo embed container */
.video-embed-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-embed-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

/* Overlay para capturar eventos de toque no vídeo em mobile */
@media (max-width: 768px) {
    .video-embed-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        pointer-events: none;
        background: transparent;
    }
    
    .gallery-container.swipe-mode .video-embed-container::before {
        pointer-events: auto;
    }
}

/* Navegação da galeria (mobile) */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.gallery-nav .btn {
    pointer-events: auto;
    opacity: 0.8;
}

/* Navegação da galeria - botões */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.gallery-nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-nav-btn.prev {
    left: 10px;
}

.gallery-nav-btn.next {
    right: 10px;
}

/* Indicadores da galeria (mobile) */
.gallery-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.gallery-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    display: block;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease;
}

.gallery-indicator.active {
    background: #fff;
}

/* Miniaturas da galeria (desktop) */
.gallery-thumbs {
    margin-top: 10px;
    gap: 5px;
    flex-wrap: wrap;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.gallery-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.gallery-thumb.active,
.gallery-thumbnail.active {
    border-color: #007bff;
}

.video-thumb {
    width: 60px;
    height: 60px;
    background: #000;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: border-color 0.3s ease;
}

.video-thumb.active {
    border-color: #007bff;
}

.video-thumb i {
    font-size: 24px;
}

/* Barra de pesquisa na página do produto */
.product-search-container {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.product-search-bar {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.product-search-input {
    border: 2px solid #dee2e6;
    border-radius: 8px 0 0 8px;
}

.product-search-btn {
    border-radius: 0 8px 8px 0;
    padding: 8px 12px;
    border: 2px solid #007bff;
    border-left: none;
}

/* Cards de produtos */
.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-code-badge {
    top: 10px;
    left: 10px;
    z-index: 10;
}

.product-code {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.product-image:hover {
    transform: scale(1.05);
}

.product-title {
    font-size: 1rem;
    margin: 10px 0 5px 0;
    color: #333;
    cursor: pointer;
    transition: color 0.3s ease;
}

.product-title:hover {
    color: var(--primary-color, #007bff);
}

/* Ícones de contato */
.contact-icon {
    font-size: 2rem;
    margin-right: 0.75rem;
}

/* Estados vazios */
.empty-state-icon {
    font-size: 3rem;
    color: #6c757d;
}

.no-products-icon {
    font-size: 4rem;
    color: #6c757d;
}

/* Imagem principal da galeria */
.main-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Vídeo embed */
.video-embed-container {
    max-width: 800px;
    height: 400px;
}

.video-embed-container iframe {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Botões de navegação mobile */
.mobile-nav-btn {
    cursor: pointer;
    border: none;
    background: transparent;
    color: white;
    padding: 8px 0;
}

/* Responsividade */
@media (max-width: 768px) {
    .gallery-thumbs {
        display: none !important;
    }
    
    .gallery-indicators {
        display: flex;
    }
    
    /* Setas visíveis no mobile */
    .gallery-nav {
        display: flex;
    }
}

@media (min-width: 769px) {
    .gallery-indicators {
        display: none !important;
    }
    
    .gallery-thumbs {
        display: flex !important;
    }
    
    /* Setas também visíveis no desktop */
    .gallery-nav {
        display: flex;
    }
    
    /* Ajustar estilo das setas para desktop */
    .gallery-nav .btn {
        background: rgba(0, 0, 0, 0.6);
        border: none;
        color: white;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }
    
    .gallery-nav .btn:hover {
        background: rgba(0, 0, 0, 0.8);
        transform: scale(1.1);
    }
}

/* Estilos para elementos específicos da intermediação */
.step-number {
    width: 50px;
    height: 50px;
}

.contact-circle {
    width: 40px;
    height: 40px;
}

/* Ícones de pesquisa */
.search-icon {
    font-weight: bold;
}

/* Container de destaque */
.highlight-container {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 10px;
}

/* Botão WhatsApp flutuante */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* Ocultar elementos quando necessário */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

/* Estilos para iframe do mapa */
.map-iframe {
    border: 0;
    width: 100%;
    height: 300px;
    border-radius: 8px;
}

/* Ajustes de margem e espaçamento */
.footer-spacing {
    margin-top: 50px;
}

.product-page-container {
    position: relative;
    z-index: 1;
    clear: both;
}