/*
=========================================
--- 1. CONFIGURAÇÕES GLOBAIS E :ROOT ---
=========================================
*/
:root {
    /* Paleta de cor com Azul e Verde */
    --primary-blue: #004B8D;  /* Azul para o header */
    --primary-green: #198754; /* Verde para botões e ações */
    --green-hover: #146c43;   /* Verde mais escuro */
    
    --light-gray: #f4f5f7;
    --medium-gray: #e1e4e8;
    --dark-gray: #586069;
    --text-color: #24292e;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--white);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-green);
}

img {
    max-width: 100%;
    display: block;
}

/*
=========================================
--- 3. LAYOUT DA PÁGINA (CATÁLOGO) ---
=========================================
*/
.page-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.catalog-main {
    width: 100%;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--medium-gray);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.catalog-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.catalog-header span {
    font-size: 1rem;
    color: var(--dark-gray);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.filter-group select {
    min-width: 250px;
    padding: 0.7rem;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: var(--white);
    cursor: pointer;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

/*
===============================
--- 4. CARD DE PRODUTO ---
===============================
*/
.product-card {
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-image-container {
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Imagem cobre todo o espaço */
}

.product-info {
    padding: 1rem;
    border-top: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.25rem; /* Aumentado */
    font-weight: 600;
    color: var(--text-color);
}

.product-brand {
    font-size: 1rem; /* Aumentado */
    color: var(--dark-gray);
    margin-bottom: 0.75rem;
}

.product-prices {
    margin-top: auto;
    padding-top: 0.5rem;
}

.price-retail {
    display: flex; /* MUDADO para flex */
    align-items: center; /* Alinha tudo verticalmente */
    flex-wrap: wrap; 
    gap: 0.5rem; /* Adiciona espaço */
    font-size: 1.2rem; /* Aumentado */
    font-weight: 700;
    color: var(--text-color);
}
.price-retail small {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dark-gray);
}

/* BADGE DE DESCONTO (10% OFF) */
.product-discount-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary-green);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 12px;
    line-height: 1;
}

.price-wholesale {
    display: block;
    font-size: 1.5rem; /* Aumentado */
    color: var(--primary-green);
    font-weight: 600;
    margin-top: 0.25rem;
}

.add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--primary-green);
    color: var(--white);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: auto; 
}

.add-to-cart-btn:hover {
    background: var(--green-hover);
}

/*
=========================================
--- 6. ESTILOS PÁGINA DE PRODUTO ---
=========================================
*/
.back-link-container {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--green-hover);
}

.product-detail-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.product-image-gallery {
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    background: var(--white);
    align-self: start;
}

.product-image-gallery img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.product-info-details {
    display: flex;
    flex-direction: column;
}

.product-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.product-prices-detail {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--medium-gray);
    /* Garante que os preços fiquem em colunas */
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Espaço entre o preço primário e secundário */
}

.product-prices-detail .price-retail {
    color: #004B8D;
    font-size: 1.8rem;
    gap: 0.75rem;
}
.product-prices-detail .price-wholesale {
    font-size: 2.25rem;
}

.product-prices-detail .price-original {
    text-decoration: line-through;
    font-size: 1.3rem;
}

.product-stock {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

.cart-form {
    margin-top: 1rem;
}

.quantity-selector {
    margin-bottom: 1.5rem;
}

.quantity-selector label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quantity-selector input[type="number"] {
    padding: 0.7rem;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    font-size: 1rem;
    width: 80px;
    font-weight: 600;
    text-align: center;
}

.add-to-cart-btn-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: var(--primary-green);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-to-cart-btn-large:hover {
    background: var(--green-hover);
}

.product-description {
    grid-column: 1 / -1; 
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--medium-gray);
}

.product-description h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-description p {
    font-size: 1rem;
    color: var(--dark-gray);
    line-height: 1.7;
    margin-bottom: 1rem;
}


/*
=========================================
--- 7. RESPONSIVIDADE (MOBILE) ---.
=========================================
*/

/* Elementos Mobile (Escondidos por padrão) */
.mobile-menu-icon {
    display: none;
    color: var(--white);
}

.search-bar-mobile {
    display: none;
    margin-bottom: 1.5rem;
    width: 100%;
}


/* Para tablets e celulares grandes (ex: até 695px) */
@media (max-width: 695px) {

    .page-container {
        padding: 0 1rem;
        margin-top: 1.5rem;
    }
    
    .logo {
        margin-right: 0;
    }

    /* Mostra a barra de busca mobile */
    .search-bar-mobile {
        display: flex;
        width: 100%;
        border: 1px solid var(--medium-gray);
        border-radius: var(--border-radius);
        overflow: hidden;
        background-color: var(--light-gray);
    }
    .search-bar-mobile input {
        flex-grow: 1;
        border: none;
        padding: 0.8rem 1rem;
        font-size: 1rem;
        outline: none;
        background-color: transparent;
    }
    .search-bar-mobile .search-button {
        padding: 0 1rem;
    }

    /* Ajusta o header do catálogo */
    .catalog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        min-width: 100%;
    }

    .catalog-header h1 {
        font-size: 1.75rem;
    }

    /* (Página de Produto) Transforma o grid de 2 colunas em 1 */
    .product-detail-main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .back-link-container {
        margin-bottom: 1rem;
    }

    .product-detail-title {
        font-size: 2rem;
    }

    .product-prices-detail .price-retail {
        font-size: 2rem;
    }

    .product-description {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .add-to-cart-btn-large {
        padding: 0.8rem;
        font-size: 1rem;
    }
}

/* Para celulares pequenos (ex: até 480px) */
@media (max-width: 480px) {
    .reference-icon-action {
        display: none;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
}