/**
 * Site Publico — Layout (grid, containers, responsive)
 * Subsistema: site/css
 * Carregado por: style.css (hub)
 */
/* ============================================
   Layout — Header, Mobile Nav, Footer,
   Post-Footer, WhatsApp Float, Popups
   ============================================ */

/* ── Header ── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: all var(--duration-normal) var(--ease-out);
    background: transparent;
}

.header.scrolled {
    background: rgba(250, 247, 242, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    height: 70px;
}

/* LP header: white text over hero, dark on scroll */
.header--lp .header__logo-text { color: #fff; transition: color var(--duration-normal) var(--ease-out); }
.header--lp .header__logo-text span { color: rgba(255,255,255,0.6); transition: color var(--duration-normal) var(--ease-out); }
.header--lp.scrolled .header__logo-text { color: var(--color-text); }
.header--lp.scrolled .header__logo-text span { color: var(--color-text-muted); }

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header__logo-img {
    height: 45px;
    width: auto;
}

.header__logo-text {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.1;
}

.header__logo-text span {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.header__nav a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-soft);
    letter-spacing: 0.5px;
    position: relative;
    padding: var(--space-xs) 0;
}

.header__nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transition: width var(--duration-normal) var(--ease-out);
}

.header__nav a:hover {
    color: var(--color-gold-dark);
}

.header__nav a:hover::after {
    width: 100%;
}

.header__cta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Mobile Menu Toggle */
.header__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    cursor: pointer;
    z-index: 1001;
}

.header__toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--duration-normal) var(--ease-out);
    transform-origin: center;
}

.header__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header__toggle.active span:nth-child(2) {
    opacity: 0;
}

.header__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav Overlay */
.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(250, 247, 242, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-slow) var(--ease-out);
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav a {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    color: var(--color-text);
    font-weight: 500;
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--duration-normal) var(--ease-out);
}

.mobile-nav.active a {
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav.active a:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav.active a:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav.active a:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav.active a:nth-child(4) { transition-delay: 0.25s; }
.mobile-nav.active a:nth-child(5) { transition-delay: 0.3s; }
.mobile-nav.active a:nth-child(6) { transition-delay: 0.35s; }
.mobile-nav.active a:nth-child(7) { transition-delay: 0.4s; }
.mobile-nav.active a:nth-child(8) { transition-delay: 0.45s; }

/* ── Footer ── */
.footer {
    background: var(--color-bg-warm);
    padding: var(--space-4xl) 0 var(--space-xl);
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-3xl);
}

.footer__brand p {
    color: var(--color-text-soft);
    font-size: var(--text-sm);
    line-height: 1.8;
    margin-top: var(--space-md);
    max-width: 300px;
}

.footer__social {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.footer__social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-gold-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gold);
    transition: all var(--duration-fast);
}

.footer__social a:hover {
    background: var(--color-gold);
    color: var(--color-white);
    transform: translateY(-2px);
}

.footer__col h5 {
    font-size: var(--text-base);
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

.footer__col a {
    display: block;
    color: var(--color-text-soft);
    font-size: var(--text-sm);
    padding: var(--space-xs) 0;
    transition: color var(--duration-fast);
}

.footer__col a:hover {
    color: var(--color-gold);
}

.footer__bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-align: center;
}

/* ── Post-Footer (Créditos) ── */
.post-footer {
    background: var(--color-black);
    padding: var(--space-md) 0;
    text-align: center;
}

.post-footer p {
    color: var(--color-white);
    font-size: var(--text-xs);
    letter-spacing: 1px;
}

.post-footer a {
    color: var(--color-gold);
    font-weight: 600;
}

.post-footer a:hover {
    color: var(--color-gold-light);
}

/* ── WhatsApp Float Button ── */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 998;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all var(--duration-normal) var(--ease-out);
    animation: whatsapp-pulse 3s ease-in-out infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: white;
}

@keyframes whatsapp-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1); }
}

/* ── Popup / Modal ── */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
}

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

.popup {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: 100%;
    padding: var(--space-3xl);
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all var(--duration-normal) var(--ease-spring);
    box-shadow: var(--shadow-xl);
}

.popup-overlay.active .popup {
    transform: translateY(0) scale(1);
}

.popup__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.popup__close:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.popup h3 {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.popup p {
    text-align: center;
    color: var(--color-text-soft);
    font-size: var(--text-sm);
    margin-bottom: var(--space-xl);
}

.popup-form .form-group { margin-bottom: var(--space-md); }

.popup-form .form-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text);
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast);
    outline: none;
    box-sizing: border-box;
}

.popup-form .form-input:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px var(--color-gold-glow);
    background: var(--color-white);
}

.popup-form .form-input::placeholder {
    color: var(--color-text-light);
}

.popup-form .form-input.error { border-color: var(--color-coral, #e74c3c); }

.popup-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    text-decoration: none;
}

.popup-form .btn--primary {
    background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold));
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.popup-form .btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.popup__success { text-align: center; padding: var(--space-xl) 0; }
.popup__success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--color-green, #16a34a); color: white; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-lg); }
.popup__success-msg { font-size: var(--text-sm); color: var(--color-text-soft); line-height: 1.6; }

/* ── Popup Icon ── */
.popup__icon {
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--color-gold);
}

.popup__icon svg {
    width: 48px;
    height: 48px;
}

/* ── Layout Responsive ── */
@media (max-width: 1024px) {
    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2xl);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    .header__nav {
        display: none;
    }
    
    .header__toggle {
        display: flex;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .footer__bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .whatsapp-float {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }
    
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
    
    .popup {
        padding: var(--space-2xl);
        margin: var(--space-md);
    }
    
    .popup__icon svg {
        width: 36px;
        height: 36px;
    }
}
