/* --- Variáveis e Reset Moderno --- */
:root {
    --color-bg: #66030c;
    --color-text: #f7f4ef;
    --color-border: rgba(247, 244, 239, 0.15);
    --color-accent: rgba(247, 244, 239, 0.08);
    --color-shadow: rgba(0, 0, 0, 0.15);
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

/* 1. Pintamos o fundo no HTML para não sobrepor a imagem no Android */
html {
    background-color: var(--color-bg);
}

body {
    /* Retiramos a cor de fundo daqui para ficar transparente */
    color: var(--color-text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative; 
}

/* 2. O Pattern volta com o Multiply e mais opacidade */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; 
    background-image: url('./assets/pattern-fundo.png');
    background-repeat: repeat;
    background-size: 400px;
    z-index: -1; /* Agora fica sanduichado perfeitamente entre o HTML e o conteúdo */
    
    /* --- A MÁGICA DO CONTRASTE VOLTOU --- */
    opacity: 0.5; /* Aumentamos de 0.15 para 0.5 para dar destaque */
    mix-blend-mode: multiply; /* Devolve aquele contraste luxuoso que você tinha criado */
    
    pointer-events: none;
}

/* --- Tipografia Refinada --- */
h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 400;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(84, 3, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    height: 100px;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    height: 95px;
    object-fit: contain;
    max-width: 60vw;
}

.logo-text {
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.cart-btn {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.6rem;
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--color-text);
    color: var(--color-bg);
    font-size: 0.75rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spacer {
    width: 48px;
}

/* --- Hero Section --- */
.hero {
    margin-top: 100px;
    padding: 3rem 1rem;
    text-align: center;
}

/* --- Banner de Confiança --- */
.trust-banner {
    background-color: var(--color-accent);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
}

.trust-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 300;
    opacity: 0.9;
}

.trust-item i {
    font-size: 1.5rem;
    color: var(--color-text);
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.hero p {
    font-size: 1.05rem;
    font-weight: 300;
    opacity: 0.85;
    max-width: 450px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Catálogo (Cards com Sombra e Arredondados) --- */
.catalog-container {
    padding: 1.5rem 1rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.product-grid {
    display: grid;
    /* Começa com colunas responsivas para desktop */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    background-color: #5d030b;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px var(--color-shadow);
}

.product-card:active {
    transform: scale(0.98);
}

/* --- CORREÇÃO DO "BURACO" NAS IMAGENS --- */
.product-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Força um quadrado perfeito */
    overflow: hidden;
    background-color: #ffffff; /* Fundo branco consistente */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* Margem interna */
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mostra a foto inteira sem cortar */
    transition: transform 0.3s ease;
}

.product-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.product-info h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-body);
    font-weight: 400;
}

.product-info .price {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

/* --- Botões --- */
.btn-outline {
    width: 100%;
    padding: 0.9rem;
    background: transparent;
    border: 1px solid var(--color-text);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary {
    width: 100%;
    padding: 1.1rem;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary:active {
    opacity: 0.9;
}

/* --- Overlay & Modais --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 92vh;
    background-color: var(--color-bg);
    z-index: 300;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

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

.close-btn {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    background: rgba(84, 3, 10, 0.9);
    border: none;
    color: var(--color-text);
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 310;
}

.modal-content {
    display: flex;
    flex-direction: column;
}

.modal-image-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg);
}

.main-image-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1rem;
}

.main-image-container > img {
    width: 100%;
    max-height: 350px;
    object-fit: contain; 
}

.modal-gallery {
    display: flex;
    gap: 0.8rem;
    padding: 1rem 0;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
}

.modal-gallery::-webkit-scrollbar {
    height: 6px; 
}
.modal-gallery::-webkit-scrollbar-thumb {
    background: #5a0c13;
    border-radius: 4px;
}

.thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: var(--transition);
    flex-shrink: 0;
}

.thumbnail:hover {
    opacity: 0.9;
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--color-text);
}

.modal-details-panel {
    padding: 2rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
}

.modal-details-panel h2 {
    font-size: 1.9rem;
    margin-bottom: 0.5rem;
}

.modal-details-panel .modal-price {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: block;
}

.modal-details-panel p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* --- Sidebar (Carrinho) --- */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh; /* Altura dinâmica mobile */
    background-color: var(--color-bg);
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--color-border);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-header .close-btn {
    position: static;
    background: transparent;
    width: auto;
    height: auto;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    background-color: var(--color-accent);
    padding: 0.75rem;
    border-radius: var(--border-radius);
}

.cart-item img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.cart-item-info p {
    font-weight: 700;
    font-size: 1.05rem;
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--color-text);
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.5rem;
}

.sidebar-footer {
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 24px)); /* Respiro iPhone */
    border-top: 1px solid var(--color-border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.checkout-btn {
    width: 100%;
    padding: 1.1rem;
    background: #25D366;
    color: #fff;
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    border-radius: var(--border-radius);
}

/* --- Botão Flutuante WhatsApp --- */
.whatsapp-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--color-text);
    color: var(--color-bg);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 150; 
    text-decoration: none;
    transition: var(--transition);
}

.whatsapp-floating-btn:active {
    transform: scale(0.92);
    opacity: 0.9;
}

/* --- Form de Checkout --- */
.checkout-content {
    padding: 2.5rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
}

.checkout-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.checkout-subtitle {
    font-size: 0.95rem;
    opacity: 0.7;
    margin-bottom: 2rem;
}

#checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: none;
}

.form-group label, .form-group legend {
    font-size: 0.95rem;
    font-weight: 700;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 1rem;
    background-color: var(--color-accent);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--color-text);
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: var(--color-text);
    opacity: 0.4;
}

.form-group select option {
    background-color: var(--color-bg);
    color: var(--color-text);
}

.input-row {
    display: flex;
    gap: 0.8rem;
    margin: 0.8rem 0;
}

.checkout-submit-btn {
    background: #25D366;
    color: #fff;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

/* --- Filtros de Categoria --- */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: rgba(247, 244, 239, 0.15);
    border-color: var(--color-text);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
    font-weight: 700;
}

/* --- Rodapé Institucional --- */
.footer {
    background-color: rgba(74, 2, 8, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--color-border);
    padding: 4rem 1rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 3rem;
}

.footer-brand p {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-top: 1rem;
    line-height: 1.6;
    max-width: 300px;
}

.footer-logo {
    height: 60px;
    object-fit: contain;
}

.footer-links, .footer-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.footer a {
    color: var(--color-text);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    font-size: 0.95rem;
    width: fit-content;
}

.footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
    font-size: 0.95rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-icons a {
    font-size: 1.5rem;
    opacity: 0.8;
}

.social-icons a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    opacity: 0.6;
    font-size: 0.85rem;
}

/* --- Banner de Cookies LGPD --- */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 150%);
    width: 90%;
    max-width: 800px;
    background-color: rgba(42, 2, 6, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    color: var(--color-text);
    z-index: 9999;
    padding: 1.2rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.show {
    transform: translate(-50%, 0);
}

.cookie-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    text-align: center;
}

.cookie-content p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.9;
}

.cookie-content a {
    color: var(--color-text) !important;
    text-decoration: underline;
    font-weight: 700;
}

.cookie-btn {
    width: max-content !important; 
    padding: 0.7rem 2rem !important;
    border-radius: 30px !important;
    background-color: var(--color-text) !important;
    color: var(--color-bg) !important;
    border: none !important;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* --- Estilos do Modal de Informação (Textos) --- */
.info-content {
    padding: 3rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.info-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    width: 100%;
}

.info-content h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.info-content p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    opacity: 0.9;
    width: 100%;
}

.info-content ul {
    width: 100%;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

/* --- CARROSSEL INFINITO --- */
.best-sellers-section {
    margin: 2rem auto 3rem auto;
    max-width: 1200px;
    overflow: hidden;
    padding: 0 1rem;
}

.section-title {
    text-align: center;
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: scroll 25s linear infinite; 
}

.carousel-track:hover {
    animation-play-state: paused;
}

.carousel-card {
    width: 220px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.carousel-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.carousel-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.carousel-info {
    padding: 1rem;
    text-align: center;
}

.carousel-info h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-info p {
    color: #e0b0ff;
    font-weight: bold;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 0.75rem)); } 
}

/* --- BARRA FLUTUANTE MOBILE (MODAL) --- */
.floating-buy-bar {
    width: 100%;
    margin-top: 1.5rem;
}

/* --- MEDIA QUERIES (RESPONSIVIDADE) --- */

/* Ajustes para Tablets e Desktop */
@media (min-width: 768px) {
    .trust-content {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
    }

    .modal {
        max-width: 900px;
        max-height: 80vh;
        left: 50%;
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -40%) scale(0.95);
        border-radius: var(--border-radius);
        opacity: 0;
        visibility: hidden;
    }

    .modal.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        visibility: visible;
    }

    .modal-content {
        flex-direction: row;
    }

    .modal-image-panel {
        flex: 1.1;
        aspect-ratio: auto;
    }

    .modal-details-panel {
        flex: 1;
        padding: 3rem 2.5rem;
        justify-content: center;
    }

    .cookie-content {
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
    }
    
    .cookie-content p {
        max-width: 70%;
    }
}

/* --- CORREÇÕES ESPECÍFICAS PARA MOBILE (SMARTPHONES) --- */
@media (max-width: 768px) {
    .trust-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: max-content;
    }

    /* FORÇA 2 COLUNAS E CORRIGE BURACOS NO CHROME ANDROID */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem;
        padding: 0 0.5rem;
    }

    .floating-buy-bar {
        position: sticky;
        bottom: -1px;
        background: var(--color-bg); /* Fundo totalmente sólido e escuro */
        padding: 1rem 0;
        z-index: 100;
        /* A linha 'border-top' foi completamente apagada daqui */
    }
}

/* --- COMPORTAMENTO DE SCROLL HORIZONTAL DOS FILTROS (MOBILE) --- */
@media (max-width: 768px) {
    .category-filters {
        display: flex !important;
        justify-content: flex-start !important;
        overflow-x: auto !important; /* Ativa a rolagem para o lado */
        white-space: nowrap !important; /* Impede os botões de quebrarem linha */
        padding: 0.5rem 1rem !important;
        gap: 0.6rem !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch; /* Deixa o deslizar super suave no iPhone */
        scrollbar-width: none; /* Esconde a barra de rolagem no Firefox */
    }

    /* Esconde a barra de rolagem no Chrome, Safari e Android */
    .category-filters::-webkit-scrollbar {
        display: none; 
    }

    .filter-btn {
        flex-shrink: 0; /* Impede o navegador de esmagar o tamanho dos botões */
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}