/* === ESTILOS GERAIS === */
body {
    background-color: #f4f7f9; /* Fundo mais suave para a página */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
}

h1, h2, h3, h4, h5 {
   color: white;
    font-weight: 700;
}

main {
    padding: 0 15px;
    margin: 0 auto;
    max-width: 1400px;
}

/* Cores Principais */
.text-primary-color { color: #0545A2; }
.bg-primary-color { background-color: #0545A2; }
.btn-primary {
    background-color: #0545A2;
    border-color: #0545A2;
    color: #fff;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #03387a;
    border-color: #03387a;
    color: #fff;
}

/* === HEADER & FOOTER (Mantendo o estilo do footer profissionalizado) === */
header {
    background-color: #0545A2;
    color: #fff;
    padding: 1em;
    text-align: center;
}

header nav {
    background-color: #0545A2;
    padding: 1em;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

header nav a {
    color: #fff;
    text-decoration: none;
}

footer {
    background-color: #0545A2;
    border-top: 3px solid #337ab7;
    color: #fff;
    padding: 1.5rem 0;
    clear: both;
}

.social-icons a {
    color: white;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: #ffd700 !important;
}

/* === ESTILOS DE GRID (Otimizados) === */

.category-header {
    background-color: #0545A2;
    color: #fff;
    padding: 20px;
    text-align: center;
    border-radius: 10px 10px 0 0;
    margin-top: 5px;
}

/* --- GRID DE OFERTAS (.category-grid2) --- */
.category-grid2 {
    padding: 20px 0;
    background-color: #f9f9f9;
}

.row2 {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-md-4 {
    padding: 10px;
}

.product-card2 {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image2 {
    width: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1; 
    transition: transform 0.3s ease;
}

.product-card2 .product-info {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card2 .product-info h5 {
    font-size: 16px;
    margin: 10px 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.product-card2 .btn-primary {
    margin-top: auto;
    width: 100%;
}

/* --- GRID DE DESTAQUES (.category-grid) --- */
.category-container {
    padding: 20px 0;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: #f9f9f9;
}

.product-card {
    background-color: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease-in-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 24px; /* Substitui o margin-bottom das colunas */
}

.product-card .product-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f9f9f9;
    flex-shrink: 0;
}

.product-card .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card .product-info {
    padding: 16px;
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* === ESTILOS DA PÁGINA DE DETALHES (detalhes.html) === */

.product-detail-container {
    background-color: white;
    padding: 30px;
    margin: 30px auto;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
}

.product-image-container {
    padding: 0;
    border-radius: 10px;
    /* Removido box-shadow interno, foca no container principal */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Centraliza a imagem principal */
}

.product-main-image {
    width: 100%;
    max-height: 450px; /* Limita a altura para evitar imagens gigantes */
    object-fit: contain; /* Garante que a imagem inteira seja visível */
    margin-bottom: 20px;
    transition: transform 0.3s;
    border: 1px solid #eee; /* Borda sutil para a imagem principal */
    border-radius: 8px;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.thumbnail:hover, .thumbnail.active {
    border-color: #0545A2;
    transform: scale(1.05);
}

.product-title {
    color: #0545A2;
    font-weight: 800;
    margin-bottom: 10px;
    font-size: 2.2rem; /* Aumenta um pouco o título */
}

.product-code {
    background-color: #ddd;
    color: #555;
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.product-rating {
    color: #ffc107; /* Amarelo Bootstrap */
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.product-rating span {
    color: #777;
    font-size: 0.9rem;
    margin-left: 5px;
}

.product-description {
    margin-bottom: 20px;
    line-height: 1.7;
    color: #555;
}

.product-features h5 {
    color: #333;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.product-features ul {
    list-style: none;
    padding-left: 0;
}

.product-features li {
    margin-bottom: 8px;
    padding-left: 25px;
    position: relative;
    color: #555;
}

.product-features li::before {
    content: "\f058"; /* Ícone de checkmark (Font Awesome Solid) */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #0545A2;
    position: absolute;
    left: 0;
    top: 2px;
}

/* --- Formulário de Pedido (Order Form) --- */
.order-form {
    background-color: #f7f7f7; /* Fundo levemente cinza para destacar */
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
}

.order-form h4 {
    color: #0545A2;
    margin-bottom: 20px;
    font-weight: 700;
}

.form-label {
    font-weight: 600;
    color: #333;
}

.quantity-selector {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background-color: #0545A2;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background-color: #03387a;
}

.quantity-input {
    width: 60px;
    text-align: center;
    margin: 0 10px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.contact-option label {
    font-weight: normal;
    margin-left: 5px;
}

.contact-field {
    display: none;
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #fff;
}

.contact-field.active {
    display: block;
}

/* --- Botões de Ação --- */
.submit-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 5px;
}

.back-button {
    margin-top: 30px;
    text-align: center; /* Centraliza o botão no mobile */
}

.back-button .btn-secondary {
    background-color: #6c757d; /* Cinza do Bootstrap */
    border-color: #6c757d;
    color: white;
    padding: 10px 20px;
    transition: background-color 0.2s;
}

.back-button .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

/* === MEDIA QUERIES (Responsividade de Detalhes) === */

@media only screen and (max-width: 768px) {
    /* Ajustes para Detalhes */
    .product-detail-container {
        padding: 20px;
        margin: 15px auto;
    }

    .product-title {
        font-size: 1.8rem;
    }
    
    .product-main-image {
        max-height: 300px;
    }

    .back-button {
        text-align: left; /* Alinha o botão de voltar à esquerda no mobile */
    }
    
    .order-form {
        margin-top: 20px;
    }
}

/* Media Query para grades (mantidas da correção anterior) */
@media only screen and (max-width: 991.98px) {
    .category-grid .col-lg-3,
    .category-grid .col-md-4,
    .category-grid .col-sm-6,
    .category-grid .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .row2 > .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media only screen and (max-width: 575.98px) {
    .category-grid .col-lg-3,
    .category-grid .col-md-4,
    .category-grid .col-sm-6,
    .category-grid .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .row2 > .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}