/* ===== CSS VARIABLES ===== */
:root {
    --primary-green: #2e7b52;        
    --secondary-green: #4f9d69;    
    --highlight-yellow: #f9c74f;     
    --highlight-yellow-light: #ffd670;
    
    --card-bg: #98c58c;            
    --text-dark: #191919;
    --text-light: #5a5a5a;
    --text-price: #e63946;             
    --text-highlight: var(--primary-green);
    
    --card-bg: #ffffff;              
    --footer-bg: #2e7b52;
    --border-color: #e0e0e0;
    
    --link-color: #d4a517;
    --link-hover: #b8860b;
    
    --btn-primary-bg: var(--primary-green);
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #246542;
    
    --btn-secondary-bg: var(--highlight-yellow);
    --btn-secondary-text: #191919;
    --btn-secondary-hover: #e0b43f;
    
    --success: #4f9d69;  
    --warning: #f9c74f;  
    --error: #e63946;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    --primary-green: #4f9d69;       
    --secondary-green: #5ab17a;     
    --highlight-yellow: #ffd670;     
    --highlight-yellow-light: #ffe599;
    
    --bg-light: #1a1a1a;          
    --text-dark: #f0f0f0;
    --text-light: #b0b0b0;
    --text-highlight: var(--highlight-yellow);
    --card-bg: #242424;
    --footer-bg: #1f5d43;
    --border-color: #333333;
    
    --link-color: #ffd670;
    --link-hover: #ffe599;
    
    --btn-primary-bg: var(--primary-green);
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #5ab17a;
    
    --btn-secondary-bg: var(--highlight-yellow);
    --btn-secondary-text: #1a1a1a;
    --btn-secondary-hover: #ffe599;
    
    --success: #5ab17a;   
    --warning: #ffd670;
    --error: #ff6b6b;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ===== GLOBAL STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== MAIN CONTENT ===== */
main {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.5s ease;
    background-color: var(--bg-light);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PRODUTO CONTAINER ===== */
.produto {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* ===== SEÇÃO DE IMAGENS ===== */
.imagens {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* Container da Imagem Principal */
.imagemPrincipal {
    background-color: var(--bg-light);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    min-height: 450px;
}

.nomeProduto {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

/* Container para centralizar a imagem principal */
.imagemPrincipal-wrapper {
    width: 100%;
    max-width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#imgPrincipal {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    transition: all 0.4s ease;
}

#imgPrincipal:hover {
    transform: scale(1.05);
}

/* Miniaturas */
.imagensSecundarias {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.imagensSecundarias > div {
    flex: 0 0 auto;
    width: 90px;
    height: 90px;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--bg-light);
}

.imagensSecundarias img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.imagensSecundarias img:hover {
    border-color: var(--primary-green);
    transform: scale(1.1);
}

.imagensSecundarias img.active {
    border-color: var(--primary-green);
}

/* ===== SEÇÃO DE INFORMAÇÕES ===== */
.informacoes {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: auto 0;
}

/* Card de informações */
.infoCard {
    background-color: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Preço */
.informacoes > p:first-child {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-price);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Descrição */
.informacoes > p:nth-child(2) {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.7;
    margin: 0;
    padding: 1.2rem;
    background-color: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--primary-green);
}

/* Estoque */
.informacoes > p:nth-child(3) {
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.informacoes > p:nth-child(3) strong {
    color: var(--primary-green);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.informacoes > p:nth-child(3) strong::before {
    content: '\f49e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.1rem;
}

/* Formulário */
.informacoes form {
    margin-top: auto;
}

/* ===== BOTÃO ADICIONAR AO CARRINHO ===== */
.adicionarCarrinho {
    width: 100%;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--btn-primary-text);
    background-color: var(--btn-primary-bg);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.adicionarCarrinho::before {
    content: '\f07a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
}

.adicionarCarrinho:hover {
    background-color: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.adicionarCarrinho:active {
    transform: translateY(0);
}

/* ===== MENSAGEM DE SUCESSO ===== */
.mensagem {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: var(--success);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    font-size: 1rem;
    z-index: 1000;
    animation: slideInRight 0.4s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mensagem.visivel {
    display: flex;
}

.mensagem::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.5rem;
}

.mensagem p {
    margin: 0;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== RESPONSIVE - MOBILE (até 767px) ===== */
@media (max-width: 767px) {
    main {
        padding: 1rem 0.5rem;
    }

    .produto {
        padding: 1.5rem;
        gap: 1.5rem;
        border-radius: 12px;
    }

    .imagemPrincipal {
        padding: 1.5rem;
        min-height: 350px;
    }

    .nomeProduto {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .imagemPrincipal-wrapper {
        max-width: 280px;
        height: 280px;
    }

    .imagensSecundarias > div {
        width: 70px;
        height: 70px;
    }

    .informacoes {
        gap: 1.2rem;
    }

    .informacoes > p:first-child {
        font-size: 2rem;
    }

    .informacoes > p:nth-child(2) {
        font-size: 0.95rem;
        padding: 1rem;
    }

    .informacoes > p:nth-child(3) {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    .adicionarCarrinho {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .mensagem {
        top: 80px;
        right: 10px;
        left: 10px;
        font-size: 0.9rem;
        padding: 0.9rem 1.2rem;
    }
}

/* ===== RESPONSIVE - TABLET (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    main {
        padding: 2rem 1.5rem;
    }

    .produto {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        padding: 2rem;
    }

    .imagemPrincipal {
        min-height: 450px;
    }

    .nomeProduto {
        font-size: 1.4rem;
    }

    .imagemPrincipal-wrapper {
        max-width: 350px;
        height: 350px;
    }

    .imagensSecundarias {
        gap: 0.8rem;
    }

    .imagensSecundarias > div {
        width: 80px;
        height: 80px;
    }

    .informacoes > p:first-child {
        font-size: 2.2rem;
    }

    .informacoes > p:nth-child(2) {
        font-size: 1rem;
    }

    .adicionarCarrinho {
        font-size: 1.05rem;
    }
}

/* ===== RESPONSIVE - DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
    main {
        padding: 3rem 2rem;
    }

    .produto {
        grid-template-columns: 1.2fr 1fr;
        gap: 3rem;
        padding: 3rem;
    }

    .imagemPrincipal {
        padding: 2.5rem;
        min-height: 550px;
    }

    .nomeProduto {
        font-size: 1.7rem;
        margin-bottom: 2rem;
    }

    .imagemPrincipal-wrapper {
        max-width: 450px;
        height: 450px;
    }

    .imagensSecundarias {
        gap: 1.2rem;
    }

    .imagensSecundarias > div {
        width: 100px;
        height: 100px;
    }

    .informacoes {
        gap: 2rem;
    }

    .informacoes > p:first-child {
        font-size: 2.8rem;
    }

    .informacoes > p:nth-child(2) {
        font-size: 1.05rem;
        padding: 1.5rem;
    }

    .informacoes > p:nth-child(3) {
        font-size: 1.05rem;
        padding: 1.2rem;
    }

    .adicionarCarrinho {
        padding: 1.4rem 2.5rem;
        font-size: 1.15rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 3px solid var(--primary-green);
    outline-offset: 2px;
}

[data-theme="dark"] *:focus-visible {
    outline-color: var(--highlight-yellow);
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: #fff;
        color: #000;
    }

    .produto {
        box-shadow: none;
    }

    .adicionarCarrinho,
    .mensagem {
        display: none;
    }
}