/* ==========================================================================
   1. VARIÁVEIS, RESET E CONFIGURAÇÕES GERAIS
   ========================================================================== */
:root {
    --primary-color: rgb(3, 3, 66);
    --secondary-color: rgb(3, 3, 180);
    --bg-light: #f4f4f9;
    --white: #ffffff;
    --text-dark: #333;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   2. NAVBAR & ELEMENTOS DE NAVEGAÇÃO (DESKTOP)
   ========================================================================== */
nav,
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    border-bottom: 2px solid rgba(3, 3, 66, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo span {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.menu-toggle {
    display: none; /* Oculto no desktop */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--secondary-color);
}

/* --- Ícone do Carrinho na Navbar --- */
#icone-carrinho {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #030342;
    color: #ffffff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    margin-left: auto;  /* Faz a mágica de empurrar para o lado oposto no flexbox */
    margin-right: 15px; 
}

#contador-carrinho {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ==========================================================================
   3. SLIDER PRINCIPAL
   ========================================================================== */
.slider-container {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    background-color: #000;
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.slide.active {
    display: block;
    animation: fadeEffect 0.8s ease-in-out;
}

@keyframes fadeEffect {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.6);
    transition: filter 0.3s ease;
}

.slide-link:hover img {
    filter: brightness(0.8);
}

.slide-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 15%;
    z-index: 5;
    pointer-events: none;
}

.slide-content h2 {
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

.slide-content p {
    font-size: 1.2rem;
    color: #f1f1f1;
    max-width: 700px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: none;
    padding: 20px 15px;
    cursor: pointer;
    font-size: 24px;
    z-index: 20;
    transition: all 0.3s ease;
    border-radius: 0 5px 5px 0;
}

.next {
    right: 0;
    border-radius: 5px 0 0 5px;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px 20px;
}

/* ==========================================================================
   4. SEÇÕES, GRIDS E PRODUTOS
   ========================================================================== */
.services-section {
    padding: 80px 0;
    background-color: var(--bg-light);
    text-align: center;
    width: 100%;
}

.services-section h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 25px;
}

.service-item,
.service-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: inherit;
}

.service-item h3,
.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--text-dark);
}

.service-item:hover,
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(3, 3, 66, 0.1);
}

.service-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* --- Sistema de Busca --- */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.search-icon {
    position: absolute;
    left: 35px;
    color: #666;
}

#input-busca {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s ease;
    font-size: 16px;
}

#input-busca:focus {
    border-color: #007bff;
}

/* --- Catálogo de Produtos --- */
.section-produtos {
    width: 100%;
    padding: 40px 0;
}

.grid-produtos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card-produto {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    height: 100%;
}

.card-produto:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.grid-produtos img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
}

.card-produto h3 {
    font-size: 1.05rem;
    color: #333;
    margin: 10px 0;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-produto p {
    color: #2c3e50;
    font-weight: 800;
    font-size: 1.2rem;
    margin-top: auto;
}

/* ==========================================================================
   5. MODAL DE DETALHES (SISTEMA PREMIUM GLOBAL)
   ========================================================================== */
.modal, 
#modal-detalhes,
.modal-detalhes {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    animation: slideDown 0.3s ease-out;
    box-sizing: border-box;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #666;
    z-index: 10;
    line-height: 1;
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.btn-whatsapp {
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn-whatsapp:hover {
    background: #128c7e !important;
    transform: scale(1.02);
}

/* ==========================================================================
   6. CARRINHO LATERAL (SIDEBAR) & BOTÕES
   ========================================================================== */
#carrinho-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

#carrinho-sidebar.aberto {
    right: 0;
}

.btn-finalizar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #030342;
    color: #ffffff;
    padding: 15px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(3, 3, 66, 0.2);
}

.btn-finalizar:hover {
    background: #25d366; /* Transição para verde WhatsApp */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-finalizar:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.2);
}

/* ==========================================================================
   7. SEÇÃO DE CONTATO E MAPAS
   ========================================================================== */
.contact-section {
    padding: 60px 5%;
    background-color: #f8f9fa;
}

.contact-section .container {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.contact-section h2 {
    color: #000033;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.contact-section p {
    color: #666;
    margin-bottom: 40px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 50px;
    text-align: left;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.info-item i {
    font-size: 1.8rem;
    color: rgba(3, 3, 66);
    background: #eef5ff;
    padding: 15px;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-item h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #333;
}

.info-item p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.contact-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: #fdfdfd;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: #007bff;
    outline: none;
    background: #fff;
}

.btn-enviar {
    margin-top: 10px;
}

.mapa-section {
    width: 100%;
    padding: 40px 0 60px 0;
    background-color: #f8f9fa;
}

.mapa-section .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.mapa-section h3 {
    text-align: center;
    color: #000033;
    margin-bottom: 30px;
    font-size: 1.8rem;
    position: relative;
}

.mapa-section h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #25D366;
    margin: 10px auto 0;
    border-radius: 2px;
}

.mapa-wrapper {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 5px solid #fff;
}

.mapa-wrapper iframe {
    display: block;
    width: 100%;
    height: 450px;
}

/* ==========================================================================
   8. MEDIA QUERIES UNIFICADAS (RESPONSIVIDADE MOBILE / TABLET)
   ========================================================================== */
@media (max-width: 768px) {
    /* Navbar Dinâmica Mobile */
    nav, .navbar {
        padding: 1rem 20px;
    }

    .menu-toggle {
        display: block !important;
        cursor: pointer;
        font-size: 1.8rem;
        color: var(--primary-color);
        z-index: 1100;
        position: relative;
    }

    /* Menu Gaveta Premium (Abre pela Direita) */
    .nav-links {
        position: fixed;
        top: 70px; /* Começa rigorosamente abaixo da barra */
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding-top: 40px;
        gap: 25px;
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.4s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Ajuste do Carrinho Lateral Mobile */
    #carrinho-sidebar {
        width: 100%;
        right: -100%;
    }
    #carrinho-sidebar.aberto {
        right: 0;
    }

    /* Forçar travamento e correção do Modal Estourado */
    .modal, #modal-detalhes, .modal-detalhes {
        padding: 10px !important;
    }

    .modal-content {
        width: 94% !important;
        max-width: 360px !important;
        padding: 15px !important;
        margin: auto !important;
    }

    #modal-body {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #modal-body img {
        max-width: 140px !important;
        height: auto !important;
        margin-bottom: 12px;
    }

    #modal-body h2 {
        font-size: 1.2rem;
    }

    #modal-body button, 
    #modal-body a {
        width: 100% !important;
        margin: 5px 0 !important;
    }

    /* Slider Responsivo */
    .slider-container {
        height: 320px;
    }

    .slide-content {
        padding: 0 8%;
    }

    .slide-content h2 {
        font-size: 1.8rem;
    }

    .slide-content p {
        font-size: 0.95rem;
    }

    .prev, .next {
        padding: 12px 8px;
        font-size: 18px;
    }

    /* Seções e Elementos do Catálogo */
    .services-section, .contact-section {
        padding: 50px 0;
    }

    .services-section h2, .contact-section h2 {
        font-size: 1.8rem;
    }

    .services-grid {
        gap: 20px;
        padding: 0 20px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 20px;
    }

    /* Configuração Unificada de 2 itens por linha no catálogo */
    .grid-produtos {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        padding: 10px;
    }

    .card-produto {
        padding: 10px;
        border-radius: 8px;
    }

    .grid-produtos img {
        height: 120px;
        margin-bottom: 8px;
    }

    .card-produto h3 {
        font-size: 0.9rem;
        height: 2.8em;
        margin: 5px 0;
    }

    .card-produto p {
        font-size: 1rem;
    }

    .mapa-wrapper iframe {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .slider-container {
        height: 260px;
    }

    .slide-content h2 {
        font-size: 1.5rem;
    }
}