/* Definição de Cores */
:root {
    --jbl-orange: #f7941d;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #eee;
}

/* Estilos Globais e Reset */
body {
    font-family: 'Open Sans', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-gray);
    color: var(--text-color);
    
    /* COMPENSAÇÃO: Padding para compensar a altura do cabeçalho fixo */
    padding-top: 70px; 
}

/* Container Principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Cabeçalho e Navegação Principal --- */
.header-top {
    background-color: #fff;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    
    /* FIXO: Propriedades para FIXAR o cabeçalho no topo */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.header-nav {
    display: flex;
    gap: 30px;
}
.header-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95em;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}
.header-nav a:hover, .header-nav a.active-nav {
    border-bottom-color: var(--jbl-orange);
    color: var(--jbl-orange);
}

/* --- Layout do Produto (Topo) --- */
.product-page-top {
    display: flex;
    gap: 40px;
    background-color: #fff;
    padding: 40px 20px;
    margin-bottom: 20px;
}

.product-image-section {
    flex: 1;
    text-align: center;
}

/* FIXO: Coluna de Informações (Preço/Botão) agora é Sticky */
.product-info-section {
    flex: 1;
    position: sticky;
    top: 80px; 
    height: fit-content; 
    padding-bottom: 20px; 
}

.main-image {
    max-width: 80%;
    height: auto;
    margin-bottom: 20px;
}

.gallery-thumbs {
    font-size: 0.9em; 
    color: #666;
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    margin-top: 15px;
}
.gallery-thumbs .thumb {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.gallery-thumbs .thumb:hover {
    border-color: var(--jbl-orange);
}
.gallery-thumbs .thumb.active-thumb {
    border-color: var(--jbl-orange); 
    border-width: 2px;
}

/* Estilo para o nome LANÇAMENTO */
.product-highlight {
    font-size: 1.5em; 
    font-weight: 600; 
    color: var(--jbl-orange); 
    margin: 5px 0 15px 0; 
}

.cor-modelo {
    font-size: 0.9em; 
    margin: 0;
}

.product-title {
    font-size: 2.2em; 
    font-weight: 300; 
    margin: 5px 0 10px 0;
}

.rating {
    color: #ffaa00;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.label-cor {
    font-weight: bold;
}

/* Seleção de Cores */
.color-options {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); 
    transition: all 0.2s; 
}
/* Cores baseadas nos nomes das classes */
.color-dot.black { background-color: black; }
.color-dot.blue { background-color: #007bff; }
.color-dot.white { background-color: white; border: 1px solid #ccc;} 
.color-dot.purple { background-color: #800080; }
.color-dot.red { background-color: #dc3545; } 

.color-dot.active { 
    border-color: var(--jbl-orange); 
    box-shadow: 0 0 0 2px rgba(247, 148, 29, 0.4); 
}

/* Preço e Botão */
.price-details {
    text-align: right;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}
.price {
    font-size: 2.5em;
    color: #000;
    font-weight: 700;
    margin: 0;
}
.parcelamento {
    font-size: 0.8em; 
    color: #666; 
    margin: 5px 0 0 0;
}

.buy-button, .button-primary, .button-secondary {
    display: block;
    width: 100%;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.buy-button {
    background-color: var(--jbl-orange);
    color: white;
    margin-top: 15px;
}
.buy-button:hover {
    background-color: #e58715;
}

/* Ícones de Benefícios (Frete, Devolução) */
.benefits {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

/* --- Navegação por Abas (Tabs) --- */
.tabs-container {
    background-color: #fff;
    margin-bottom: 40px;
}
/* FIXO: Barra de abas agora é Sticky, logo abaixo do cabeçalho */
.tabs-nav {
    display: flex;
    border-bottom: 1px solid #ccc;
    width: 100%;
    padding-left: 20px;
    position: sticky;
    top: 70px; /* Começa a fixar após o cabeçalho fixo (70px) */
    z-index: 999; 
    background-color: #fff;
}
.tabs-nav button {
    background-color: transparent;
    border: none;
    padding: 15px 25px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-bottom-color 0.3s;
}
.tabs-nav button.active {
    color: var(--jbl-orange);
    border-bottom-color: var(--jbl-orange);
}

.tab-content {
    padding: 30px 20px;
    min-height: 400px;
}
/* REGRAS CRUCIAIS PARA O FUNCIONAMENTO DAS ABAS */
.tab-pane {
    display: none !important; 
}
.tab-pane.active {
    display: block !important; 
}

/* Estilos de Conteúdo das Abas */
.section-title-highlight {
    font-weight: 600; 
    font-size: 1.5em; 
    color: var(--jbl-orange);
}

.features-grid {
    display: flex; 
    gap: 40px; 
    margin-top: 20px; 
    text-align: center;
}

.feature-card {
    flex: 1;
}

.feature-icon {
    font-size: 30px; 
    color: var(--jbl-orange);
}

/* Estilo da Tabela de Especificações */
.specs-table {
    width: 70%; 
    border-collapse: collapse;
    margin-top: 20px;
}
.specs-table th, .specs-table td {
    padding: 12px 0;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.specs-table th {
    font-weight: 600;
    color: #000;
    width: 50%;
}
.box-content {
    color: #666;
}

.main-rating {
    font-size: 1.5em; 
    font-weight: bold; 
    color: #000;
}

.rating-info {
    color: #666;
}

/* Botões da seção Suporte */
.support-cards {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}
.support-card {
    flex: 1;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #fafafa;
}
.support-card h3 {
    font-size: 1.2em;
    color: #000;
}

.button-secondary {
    display: block;
    width: auto;
    padding: 10px 20px;
    background-color: #000;
    color: white;
    margin-top: 15px; 
    margin-left: 0;
}

.button-primary {
    display: block;
    width: auto;
    padding: 10px 20px;
    background-color: var(--jbl-orange);
    color: white;
    margin-top: 15px; 
}

/* Rodapé JBL (Simulação do final do vídeo) */
.footer-jbl {
    background-color: #000;
    color: #fff;
    padding: 40px 0;
    text-align: center;
    font-size: 0.8em;
}

/* ESTILO ADICIONADO PARA O SELO DE SEGURANÇA */
.security-seal {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto; 
    padding: 8px 15px;
    border: 1px solid #008000; /* Borda verde */
    border-radius: 4px;
    width: fit-content; 
    background-color: #d4edda; /* Fundo verde muito claro */
}

.security-seal .lock-icon {
    font-size: 1.5em; 
    color: #008000; 
    margin-right: 8px;
}

.security-seal .seal-text {
    font-weight: bold;
    font-size: 0.9em;
    color: #008000; 
    letter-spacing: 0.5px;
}
/* FIM DOS ESTILOS DO SELO */

.footer-jbl .logo-large {
    font-size: 3em;
    font-weight: bold;
    color: var(--jbl-orange);
    margin-top: 20px;
}
/* --- OUTROS ESTILOS --- */

/* Imagens de Avaliações de Clientes (tamanho) */
.customer-images {
    display: flex;
    gap: 20px; 
    margin-top: 20px;
    justify-content: center;
}
.customer-images img {
    width: 150px; 
    height: 150px;
    object-fit: cover;
    border: 1px solid #eee;
}
/* --- Novo Estilo para o Preview da Cor --- */
.selected-color-preview {
    margin-top: 15px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s;
}

.selected-color-preview p {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.preview-box {
    width: 120px; /* Tamanho do quadrado */
    height: 120px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: border-color 0.3s;
}

.preview-box:hover {
    border-color: var(--jbl-orange);
}

.preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Garante que a imagem caiba no quadrado sem esticar */
}

/* Animação suave */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }

}
/* --- ADICIONE ISTO NO FINAL DO ARQUIVO CSS --- */

/* Regras para telemóveis e tablets (telas menores que 768px) */
@media (max-width: 768px) {
    
    /* 1. Faz a parte de cima (foto e preço) ficar um em cima do outro */
    .product-page-top {
        flex-direction: column; /* Muda de linha para coluna */
        padding-top: 20px;
    }

    /* 2. Tira o efeito "Sticky" (fixo) da descrição no telemóvel para não atrapalhar */
    .product-info-section {
        position: static; 
        padding-bottom: 0;
    }

    /* 3. Ajusta o tamanho da imagem principal */
    .main-image {
        max-width: 100%; /* Ocupa a largura total */
    }

    /* 4. Ajusta a navegação das abas para não quebrar */
    .tabs-nav {
        overflow-x: auto; /* Permite rolar para o lado se não couber */
        white-space: nowrap; /* Impede que os botões quebrem de linha */
        padding-bottom: 10px; /* Espaço para a barra de rolagem */
    }

    /* 5. Empilha os cards de características (Bateria, Chamadas...) */
    .features-grid {
        flex-direction: column;
        gap: 20px;
    }

    /* 6. Ajusta a tabela de especificações para largura total */
    .specs-table {
        width: 100%;
    }

    /* 7. Ajusta o rodapé e vídeos */
    .video-item video {
        margin-bottom: 20px;
    }
}
