/* ========================================================
   🦁 LEVIA PROJECT - FOLHA DE ESTILOS GLOBAIS (UNIVERSAL)
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=Lato:wght@300;400;700&display=swap');

:root {
    --bordeaux: #5D101D;
    --gold: #C5A059;
    --ivory: #F7F5F0;
    --dark: #1a1a1a;
    --light-grey: #f0f0f0;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body { 
    font-family: 'Lato', sans-serif; 
    background-color: var(--ivory); 
    color: var(--dark); 
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.lock-scroll { 
    overflow: hidden; 
}

/* --- TOP BAR --- */
.top-bar { 
    background: var(--bordeaux); 
    color: white; 
    text-align: center; 
    padding: 10px; 
    font-size: 0.7rem; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    height: 35px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
#top-bar-text { 
    transition: opacity 0.5s ease-in-out; 
    opacity: 1; 
}

/* --- NAVBAR GERAL --- */
.navbar { 
    display: grid; 
    grid-template-columns: 1fr auto 1fr; 
    align-items: center; 
    padding: 25px 50px; 
    background: white; 
    border-bottom: 1px solid #eee; 
    z-index: 1000; 
    position: relative; 
}

.nav-links { 
    display: flex; 
    gap: 25px; 
    text-transform: uppercase; 
    font-size: 0.8rem; 
    font-weight: 700; 
    letter-spacing: 1px; 
}

.nav-links a { 
    text-decoration: none; 
    color: var(--dark); 
    transition: 0.3s; 
}

.nav-links a:hover,
.nav-links a.active, 
.mobile-nav-links a.active,
#cart-count.active { 
    color: var(--bordeaux) !important; 
}

.nav-logo { 
    font-family: 'Playfair Display', serif; 
    font-size: 2.2rem; 
    letter-spacing: 10px; 
    font-weight: 600; 
    text-decoration: none; 
    color: var(--dark); 
    justify-self: center; 
}

.nav-icons { 
    display: flex; 
    justify-content: flex-end; 
    gap: 20px; 
    align-items: center; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    font-weight: 700; 
    letter-spacing: 1px; 
}

.nav-icons a { 
    text-decoration: none; 
    color: var(--dark); 
    transition: 0.3s; 
}

.nav-icons a:hover { 
    color: var(--bordeaux); 
}

.lang-switch { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.lang-switch a.active-lang { 
    color: var(--bordeaux); 
    pointer-events: none; 
}

/* --- PESQUISA HOVER --- */
.search-container { 
    position: relative; 
    display: inline-block; 
    padding-bottom: 15px; 
    margin-bottom: -15px; 
}

.search-dropdown { 
    position: absolute; 
    top: 100%; 
    right: 0; 
    width: 300px; 
    background: white; 
    border: 1px solid #eee; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    padding: 15px 20px; 
    display: flex; 
    flex-direction: column; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(15px); 
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); 
    z-index: 1000; 
}

.search-container:hover .search-dropdown,
.search-dropdown:focus-within { 
    opacity: 1 !important; 
    visibility: visible !important; 
    transform: translateY(0) !important; 
}

.search-dropdown input { 
    flex: 1; 
    border: none; 
    border-bottom: 1px solid #ddd; 
    padding: 5px 0; 
    font-family: 'Lato', sans-serif; 
    font-size: 0.8rem; 
    outline: none; 
    transition: 0.3s; 
    background: transparent; 
}

.search-dropdown input:focus { 
    border-bottom-color: var(--bordeaux); 
}

.search-dropdown button { 
    background: none; 
    border: none; 
    font-size: 1rem; 
    cursor: pointer; 
    color: var(--dark); 
    transition: 0.3s; 
}

.search-dropdown button:hover { 
    transform: scale(1.1); 
    color: var(--bordeaux); 
}

.search-results-container { 
    max-height: 300px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    margin-top: 10px; 
}

.search-result-item { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    padding: 8px; 
    text-decoration: none; 
    color: var(--dark); 
    transition: 0.2s; 
    border-radius: 4px; 
}

.search-result-item:hover { 
    background: #f9f9f9; 
}

.search-result-img { 
    width: 40px; 
    height: 50px; 
    object-fit: cover; 
    background: #eee; 
}

.search-result-info h4 { 
    font-family: 'Playfair Display', serif; 
    font-size: 0.9rem; 
    margin-bottom: 2px; 
}

.search-result-info p { 
    font-size: 0.65rem; 
    color: #888; 
    text-transform: uppercase; 
}

.search-container:hover .desktop-text, .search-container:hover .mobile-icon { 
    color: var(--bordeaux) !important; 
}

.search-icon-svg { 
    width: 18px; 
    height: 18px; 
    color: var(--dark); 
    transition: all 0.3s ease; 
    display: inline-block; 
    vertical-align: middle; 
}

.search-container:hover .search-icon-svg, .btn-search-svg:hover .search-icon-svg { 
    color: var(--bordeaux); 
    transform: scale(1.05); 
}

.btn-search-svg { 
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 5px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* --- OVERLAYS DO MENU MOBILE --- */
.mobile-menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    cursor: pointer; 
    color: var(--dark); 
    padding: 0; 
}

.mobile-icon { 
    display: none !important; 
    font-size: 1.1rem; 
    text-decoration: none; 
}

.mobile-menu-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100vh; 
    background: var(--ivory); 
    z-index: 9999; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateX(-100%); 
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); 
}

.mobile-menu-overlay.active { 
    opacity: 1; 
    visibility: visible; 
    transform: translateX(0); 
}

.close-mobile { 
    position: absolute; 
    top: 30px; 
    left: 30px; 
    background: none; 
    border: none; 
    font-size: 2rem; 
    color: var(--dark); 
    cursor: pointer; 
}

.mobile-nav-links { 
    display: flex; 
    flex-direction: column; 
    gap: 40px; 
    text-align: center; 
}

.mobile-nav-links a { 
    font-family: 'Playfair Display', serif; 
    font-size: 2.5rem; 
    color: var(--dark); 
    text-decoration: none; 
}

.mobile-lang-switch { 
    margin-top: 30px; 
    font-family: 'Lato', sans-serif; 
    font-size: 1.2rem; 
}

.mobile-lang-switch a { 
    text-decoration: none; 
    color: var(--dark); 
}

.mobile-lang-switch a.active-lang { 
    color: var(--bordeaux); 
    font-weight: bold; 
    pointer-events: none; 
}

/* ========================================================
   🎬 REVELAÇÃO DE IMAGENS CINEMÁTICA (PRESTIGE REVEAL)
   ======================================================== */
.reveal-img {
    opacity: 0;
    will-change: transform, opacity, filter; 
}

.reveal-img.visible {
    animation: revelarImagemPrestige 1.0s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes revelarImagemPrestige {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(6px); 
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0); 
    }
}

.seo-h1-hidden { 
    position: absolute; 
    width: 1px; 
    height: 1px; 
    padding: 0; 
    margin: -1px; 
    overflow: hidden; 
    clip: rect(0, 0, 0, 0); 
    border: 0; 
}

/* --- MEDIA QUERIES NAVBAR --- */
@media (max-width: 768px) {
    .navbar { 
        display: grid !important; 
        grid-template-columns: 1fr auto 1fr !important; 
        align-items: center !important; 
        padding: 15px 20px !important; 
    }
    .nav-links, .desktop-text { 
        display: none !important; 
    }
    .mobile-menu-toggle { 
        display: block !important; 
        justify-self: start; 
    }
    .nav-logo { 
        font-size: 1.5rem; 
        letter-spacing: 4px; 
        position: static; 
        transform: none; 
        justify-self: center; 
    }
    .nav-icons { 
        gap: 12px; 
        justify-self: end; 
    }
    .mobile-icon { 
        display: block !important; 
        font-size: 1.1rem; 
    }
    #cart-count { 
        font-size: 0.75rem; 
    }

    /* 🎯 POSICIONAMENTO DA LUPA: Distanciamento de luxo de 105px preservado */
    .search-container { 
        position: absolute !important; 
        left: 105px !important; 
        top: 0 !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
        z-index: 1001;
    }
    .search-container:hover .search-dropdown { 
        opacity: 0; 
        visibility: hidden; 
        transform: translateY(15px); 
    }
    .search-dropdown.active-search { 
        opacity: 1 !important; 
        visibility: visible !important; 
        transform: translateY(0) !important; 
    }

    /* 🎯 CAIXA DE PESQUISA MOBILE: Compensa os 105px exatos para colar à esquerda */
    .search-dropdown {
        position: absolute !important;
        top: 100% !important; 
        left: -105px !important; 
        width: 100vw !important;
        background: white !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
        padding: 15px 20px !important;
        z-index: 9999 !important;
        box-sizing: border-box !important;
    }
}

/* --- FOOTER PREMIUM UNIVERSAL --- */
.footer-premium { 
    background: var(--dark); 
    color: white; 
    padding: 80px 50px 20px; 
    font-family: 'Lato', sans-serif; 
    margin-top: auto; 
    /* Mantemos o posicionamento flexível padrão para segurança do layout */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.4s ease-in-out !important;
}

/* 🎯 REVELAÇÃO CINEMATOGRÁFICA CALIBRADA: Adicionamos um delay de 0.6s.
   O rodapé preto só começa a aparecer quando as imagens terminaram de empurrar o layout para baixo.
   Isto elimina a 100% o efeito visual de "elevador" ou saltos! */
body.prestige-ready .footer-premium {
    opacity: 1 !important;
    visibility: visible !important;
    transition-delay: 0.6s !important;
}


.footer-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 40px; 
    margin-bottom: 60px; 
    max-width: 1200px; 
    margin-left: auto; 
    margin-right: auto; 
}

.footer-col h4 { 
    font-family: 'Playfair Display', serif; 
    font-size: 1.2rem; 
    margin-bottom: 25px; 
    color: var(--gold); 
    font-weight: 400; 
    letter-spacing: 1px; 
}

.footer-col a { 
    display: block; 
    color: #aaa; 
    text-decoration: none; 
    font-size: 0.85rem; 
    margin-bottom: 12px; 
    transition: 0.3s; 
}

.footer-col a:hover { 
    color: white; 
    transform: translateX(5px); 
}

.footer-bottom { 
    text-align: center; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 25px; 
    font-size: 0.7rem; 
    color: #666; 
    letter-spacing: 2px; 
}

@media (max-width: 768px) { 
    .footer-premium { padding: 50px 20px 20px !important; } 
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; } 
}

/* --- SWATCHES CORES GRIFO (OTIMIZADO PARA TELEMÓVEL) --- */
.swatch {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    touch-action: manipulation; /* Elimina o atraso de 300ms do toque no telemóvel */
    min-width: 26px; /* Garante uma área de toque perfeita para a ponta do dedo */
    min-height: 26px;
}

.swatch-inner {
    width: 65%; 
    height: 65%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.3s ease;
    pointer-events: none !important; /* 🎯 CRUCIAL: Impede que a imagem interna bloqueie o toque no telemóvel */
}

.swatch.active .swatch-inner {
    transform: scale(1.1);
}

/* ========================================================
   🏛️ MOTOR DE TRANSIÇÃO DO CABEÇALHO PRESTIGE LEVIA (V6)
   ======================================================== */
body {
    padding-top: 105px !important; 
}

.main-header-holder {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
    background: transparent !important;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.main-header-holder .navbar {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #eee;
    padding: 15px 50px !important; 
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

.main-header-holder.scrolled {
    transform: translateY(-35px);
}

.main-header-holder.scrolled .navbar {
    background-color: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.04);
}

/* ========================================================
   🎬 CORTINA CINEMATOGRÁFICA LEVIA (PRESTIGE TRANSITION V5)
   ======================================================== */
.levia-prestige-curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--ivory); 
    z-index: 999999;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.levia-prestige-curtain.page-revealed {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}