/* PALETA E VARIÁVEIS GLOBAIS */
:root {
    --black: #1A1A1A;
    --graphite: #2B2B2B;
    --light-gray: #F4F4F6; /* Cinza ligeiramente mais quente para fundo */
    --border-gray: #E5E5E5;
    --white: #FFFFFF;
    --petrol: #1F4E5F;
    --petrol-dark: #12313D;
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

body { 
    background-color: var(--light-gray); 
    color: var(--graphite); 
    -webkit-font-smoothing: antialiased;
}

.container { 
    max-width: 1280px; 
    margin: 0 auto; 
    padding: 0 24px; 
}

/* 1. CABEÇALHO */
.main-header { 
    background-color: var(--black); /* Fundo preto */
    padding: 0; /* Removido padding para a logo encostar no topo e na base */
    border-bottom: none; 
    position: sticky; 
    top: 0; 
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    height: 80px; /* Definida uma altura fixa para controlar o tamanho da logo */
}

.header-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 20px;
    height: 100%;
    max-width: 100%; /* Permite ir até as bordas absolutas */
    padding: 0 24px 0 0; /* Remove o padding da esquerda para colar a logo no canto */
}

/* Estrutura da Logo Absolutamente no Canto */
.brand-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 15px;
    padding-left: 0; /* Garante que está no limite zero da esquerda */
}

.brand-logo-img {
    height: 100%; /* Ocupa toda a altura do navbar */
    width: auto;  /* Mantém a proporção da imagem sem distorcer */
    display: block;
    object-fit: contain;
    background: none; /* Sem fundo */
    border: none;     /* Sem quadradinho */
    padding: 0;       /* Sem espaçamento interno */
    margin: 0;        /* Sem margem, colado no canto */
}

.logo { 
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-subtitle {
    font-size: 13px;
    color: var(--white);
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 0;
    white-space: nowrap; /* Impede que o texto quebre em duas linhas */
}

/* Barra de Pesquisa Preservada e Funcional */
.search-wrapper { 
    display: flex; 
    flex: 1; 
    max-width: 600px; 
    position: relative;
    margin: 0 20px;
}

.search-wrapper input { 
    flex: 1; 
    padding: 12px 20px; 
    border: 1px solid var(--graphite); 
    border-radius: 50px; 
    font-size: 14px;
    outline: none; 
    transition: var(--transition);
    background: #2b2b2b;
    color: var(--white);
}

.search-wrapper input::placeholder {
    color: #aaa;
}

.search-wrapper input:focus {
    border-color: var(--petrol);
    background: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(31, 78, 95, 0.3);
}

.search-wrapper button { 
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--petrol); 
    color: var(--white); 
    border: none; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: var(--transition);
}

.search-wrapper button:hover { background: var(--petrol-dark); }

.header-actions {
    display: flex;
    align-items: center;
}

.cart-toggle-btn { 
    background: none; 
    border: none; 
    font-size: 24px; 
    color: var(--white); /* Sacola branca */
    cursor: pointer; 
    position: relative; 
    transition: var(--transition);
}

.cart-toggle-btn:hover { color: #ccc; }

#cart-count { 
    position: absolute; 
    top: -5px; 
    right: -8px; 
    background: #E63946; 
    color: var(--white); 
    font-size: 11px; 
    font-weight: 600;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; 
    border: 2px solid var(--black);
}

/* 2. NAVEGAÇÃO DE CATEGORIAS */
.category-nav { 
    background: var(--white); 
    border-bottom: 1px solid var(--border-gray);
}

#category-list { 
    list-style: none; 
    display: flex; 
    overflow-x: auto; 
    gap: 30px;
    padding: 15px 0; 
}

#category-list::-webkit-scrollbar { display: none; }

#category-list a { 
    color: #666; 
    text-decoration: none; 
    font-size: 14px; 
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

#category-list a:hover, #category-list a.active { 
    color: var(--petrol); 
    font-weight: 600;
}

/* 3. HERO (BANNER) */
.hero-section { 
    position: relative;
    background-image: url('./180902.png');
    background-size: cover;
    background-position: center;
    height: 350px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(26, 26, 26, 0.9) 0%, rgba(31, 78, 95, 0.6) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
}

.hero-content h1 { 
    font-size: 42px; 
    line-height: 1.2;
    margin-bottom: 15px; 
    font-weight: 700;
}

.hero-content p {
    font-size: 18px;
    font-weight: 300;
    max-width: 500px;
    opacity: 0.9;
}

/* 4. ÁREA PRINCIPAL E PRODUTOS */
.main-content { padding: 60px 24px; }

.section-header { 
    margin-bottom: 40px; 
    text-align: left;
}

.section-header h2 {
    font-size: 28px;
    color: var(--black);
    font-weight: 600;
}

.divider {
    width: 60px;
    height: 4px;
    background: var(--petrol);
    margin-top: 10px;
    border-radius: 2px;
}

.product-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 30px; 
}

.product-card { 
    background: var(--white); 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: var(--shadow-soft); 
    transition: var(--transition); 
    display: flex;
    flex-direction: column;
}

.product-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 16px 32px rgba(0,0,0,0.1);
}

.img-container {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: #F9F9F9;
}

.promo-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--black);
    color: var(--white);
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 2;
}

.img-container img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s ease;
}

.product-card:hover .img-container img {
    transform: scale(1.05);
}

.product-info { 
    padding: 20px; 
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-cat {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.product-name { 
    font-size: 16px; 
    font-weight: 600; 
    color: var(--black); 
    margin-bottom: 15px; 
    line-height: 1.4;
    flex: 1;
}

.price-row {
    margin-bottom: 20px;
}

.price { 
    font-size: 22px; 
    color: var(--petrol); 
    font-weight: 700; 
}

.btn-add-cart { 
    background: transparent; 
    color: var(--petrol); 
    border: 2px solid var(--petrol); 
    padding: 12px; 
    width: 100%; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition); 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-add-cart:hover { 
    background: var(--petrol); 
    color: var(--white); 
}

/* ESTADOS VAZIOS */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
}
.empty-state i { font-size: 48px; margin-bottom: 15px; color: #CCC;}

/* 5. CARRINHO LATERAL (DRAWER) */
.cart-backdrop { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.6); 
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000; 
}

.cart-backdrop.active { 
    opacity: 1;
    visibility: visible;
}

.cart-sidebar { 
    position: absolute;
    top: 0; right: -450px;
    width: 100%;
    max-width: 420px; 
    background: var(--white); 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.cart-backdrop.active .cart-sidebar {
    right: 0;
}

.cart-header { 
    padding: 25px; 
    border-bottom: 1px solid var(--border-gray);
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.cart-header h3 { font-size: 18px; color: var(--black); display: flex; gap: 10px; align-items: center;}
.close-cart { background: #f4f4f4; border: none; width: 36px; height: 36px; border-radius: 50%; color: var(--black); font-size: 16px; cursor: pointer; transition: var(--transition); }
.close-cart:hover { background: #e0e0e0; }

.cart-items-container { 
    flex: 1; 
    overflow-y: auto; 
    padding: 25px; 
}

.cart-item { 
    display: flex; 
    gap: 15px;
    margin-bottom: 25px; 
}

.cart-item img {
    width: 80px; height: 80px; border-radius: 8px; object-fit: cover; background: #eee;
}

.cart-item-details { flex: 1; display: flex; flex-direction: column; justify-content: center;}
.cart-item-details h4 { font-size: 14px; font-weight: 500; margin-bottom: 5px; color: var(--graphite); }
.cart-item-price { font-weight: 600; color: var(--petrol); margin-bottom: 10px; }

.qty-controls { display: flex; align-items: center; gap: 15px; border: 1px solid var(--border-gray); width: fit-content; padding: 4px 8px; border-radius: 6px;}
.qty-controls button { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--graphite); padding: 0 5px;}
.qty-controls span { font-size: 14px; font-weight: 500; }

.remove-item { background: none; border: none; color: #aaa; cursor: pointer; font-size: 18px; padding: 10px; transition: color 0.2s;}
.remove-item:hover { color: #E63946; }

.cart-footer { 
    padding: 25px; 
    background: var(--white); 
    border-top: 1px solid var(--border-gray);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
}

.cart-total { 
    display: flex; justify-content: space-between; align-items: center;
    font-size: 16px; margin-bottom: 20px; color: var(--graphite);
}
.cart-total strong { font-size: 24px; color: var(--black); }

.btn-checkout { 
    width: 100%; 
    background: #25D366; 
    color: var(--white); 
    border: none; 
    padding: 16px; 
    font-size: 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: background 0.3s; 
    display: flex; justify-content: center; align-items: center; gap: 10px;
}

.btn-checkout:hover { background: #1ebd5a; }

.checkout-note { font-size: 12px; color: #888; text-align: center; margin-top: 15px; }

/* 6. WHATSAPP FLUTUANTE */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}
.floating-whatsapp:hover { transform: scale(1.1); box-shadow: 0 6px 14px rgba(37, 211, 102, 0.5); color: white;}

/* 7. RODAPÉ */
.main-footer { background: var(--black); color: var(--white); padding: 60px 0 20px; margin-top: 40px; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; border-bottom: 1px solid #333; padding-bottom: 40px; margin-bottom: 20px;}
.footer-brand h3 { font-size: 24px; color: var(--white); margin-bottom: 10px;}
.footer-brand p { color: #aaa; font-weight: 300;}
.footer-contact h4 { font-size: 16px; margin-bottom: 15px; color: var(--white);}
.footer-contact p { color: #aaa; margin-bottom: 10px; display: flex; gap: 10px; align-items: center;}
.footer-bottom { text-align: center; color: #777; font-size: 14px;}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 15px; }
    .search-wrapper { max-width: 100%; width: 100%; margin: 0; }
    .hero-content h1 { font-size: 32px; }
    .hero-section { height: 280px; text-align: center; }
    .hero-content p { margin: 0 auto; }
    .footer-content { flex-direction: column; }
}

.empty-state h3{margin-top:15px;font-size:24px;color:#1F4E5F;}
.empty-state p{margin-top:10px;color:#777;font-size:15px;}]

@media (max-width: 768px) {

    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }

    .brand-wrapper {
        width: 100%;
        justify-content: center;
    }

    .search-wrapper {
        width: 100%;
        max-width: 100%;
        order: 3;
    }

    .header-actions {
        order: 2;
    }

    .category-nav {
        margin-top: 10px;
    }

}

/* CORREÇÃO FORÇADA MOBILE */
@media (max-width: 768px) {

    .main-header,
    header {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        height: auto !important;
        z-index: 999 !important;
    }

    .header-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 15px !important;
        height: auto !important;
    }

    .brand-wrapper {
        width: 100% !important;
        justify-content: center !important;
    }

    .search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        order: 2 !important;
    }

    .header-actions {
        order: 3 !important;
    }

    .category-nav {
        position: relative !important;
        top: auto !important;
        margin-top: 15px !important;
        z-index: 1 !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }

    .category-nav ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 10px !important;
        padding-bottom: 5px !important;
    }
}



/* CORREÇÃO DEFINITIVA MOBILE */

@media (max-width: 768px){

    .main-header{
        padding: 12px 0 !important;
    }

    .header-container{
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .search-wrapper{
        width: 100% !important;
        max-width: 100% !important;
    }

    .hero-section{
        height: 220px !important;
        text-align: center !important;
    }

    .hero-content h1{
        font-size: 26px !important;
    }

    .hero-content p{
        font-size: 14px !important;
    }

    .category-nav{
        display: block !important;
        position: relative !important;
        top: auto !important;
        margin: 0 !important;
        padding: 12px 0 !important;
        background: #fff !important;
        z-index: 1 !important;
    }

    #category-list{
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 15px !important;
        padding: 0 15px !important;
    }

    #category-list::-webkit-scrollbar{
        display:none;
    }

    .main-content{
        padding: 30px 15px !important;
    }

    .product-grid{
        grid-template-columns: repeat(2,1fr) !important;
        gap: 15px !important;
    }

    .img-container{
        height: 170px !important;
    }

    .product-info{
        padding: 12px !important;
    }

    .product-name{
        font-size: 13px !important;
    }

    .price{
        font-size: 18px !important;
    }

    .btn-add-cart{
        font-size: 12px !important;
        padding: 10px !important;
    }
}

/* =========================================
   CORREÇÃO DEFINITIVA MOBILE M&G
   ========================================= */

html,
body{
    width:100%;
    max-width:100%;
    overflow-x:hidden !important;
}

*{
    box-sizing:border-box;
}

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

/* LOGO */

.brand-wrapper{
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.brand-logo-img{
    width:auto !important;
    max-width:220px !important;
    height:auto !important;
    display:block;
}

/* EVITA ESTOURO DE LARGURA */

.container,
.header-container,
.hero-content,
.main-content,
.product-grid{
    width:100%;
    max-width:100%;
}

/* MOBILE */

@media (max-width:768px){

    .main-header{
        padding:12px 0 !important;
    }

    .header-container{
        display:flex !important;
        flex-direction:column !important;
        align-items:center !important;
        gap:12px !important;
        padding:15px !important;
    }

    .brand-logo-img{
        max-width:140px !important;
    }

    .search-wrapper{
        width:100% !important;
        max-width:100% !important;
    }

    .search-wrapper input{
        width:100% !important;
    }

    .header-actions{
        width:100%;
        display:flex;
        justify-content:center;
    }

    .hero-section{
        min-height:220px !important;
        text-align:center;
    }

    .hero-content{
        padding:20px !important;
    }

    .hero-content h1{
        font-size:28px !important;
        line-height:1.2 !important;
    }

    .hero-content p{
        font-size:14px !important;
    }

    .category-nav{
        width:100%;
        overflow-x:auto;
        overflow-y:hidden;
    }

    .category-nav ul,
    #category-list{
        display:flex !important;
        flex-wrap:nowrap !important;
        overflow-x:auto !important;
        gap:12px !important;
        padding:10px !important;
        white-space:nowrap !important;
    }

    .category-nav ul::-webkit-scrollbar,
    #category-list::-webkit-scrollbar{
        display:none;
    }

    .main-content{
        padding:25px 15px !important;
    }

    .product-grid{
        grid-template-columns:repeat(2,1fr) !important;
        gap:15px !important;
    }

    .img-container{
        height:170px !important;
        display:flex;
        align-items:center;
        justify-content:center;
        background:#f9f9f9;
    }

    .img-container img{
        width:100% !important;
        height:100% !important;
        object-fit:contain !important;
        object-position:center !important;
    }

    .product-info{
        padding:12px !important;
    }

    .product-name{
        font-size:13px !important;
        line-height:1.3 !important;
    }

    .price{
        font-size:18px !important;
    }

    .btn-add-cart{
        padding:10px !important;
        font-size:12px !important;
    }

    .floating-whatsapp{
        right:15px !important;
        bottom:15px !important;
    }
}

/* CELULARES PEQUENOS */

@media (max-width:480px){

    .brand-logo-img{
        max-width:120px !important;
    }

    .hero-content h1{
        font-size:24px !important;
    }

    .product-grid{
        gap:12px !important;
    }

    .img-container{
        height:150px !important;
    }
}
