/**
 * Header e Footer - Design System AlmeidaImob
 * Cabeçalho Slim, Discreto e Profissional
 */

/* ===== HEADER SLIM ===== */
.header-modern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.05);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo Compacto */
.logo-modern {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-modern:hover {
    opacity: 0.9;
}

.logo-modern img {
    height: 48px;
    width: auto;
}

/* Navegação Desktop - Compacta */
.nav-modern {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.nav-link-modern {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #4a5568;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link-modern:hover {
    color: #1a365d;
    background: rgba(0, 0, 0, 0.03);
}

.nav-link-modern.active {
    color: #1a365d;
    font-weight: 600;
}

/* Indicador discreto do item ativo */
.nav-link-modern.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 2px;
    background: #2b6cb0;
    border-radius: 2px;
    opacity: 0.7;
}

/* Header Actions - Compactos */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* Botões do Header - Slim */
.header-actions .btn {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.header-actions .btn-outline {
    background: transparent;
    color: #4a5568;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.header-actions .btn-outline:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.18);
    color: #1a365d;
}

.header-actions .btn-primary {
    background: #1a365d;
    color: #ffffff;
    border: 1px solid #1a365d;
}

.header-actions .btn-primary:hover {
    background: #2c5282;
    border-color: #2c5282;
}

/* Ícones menores nos botões */
.header-actions .btn i {
    font-size: 0.6875rem;
}

/* Mobile Toggle - Compacto */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mobile-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: #4a5568;
    border-radius: 1px;
    transition: all 0.3s ease;
}

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

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

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

/* ===== MOBILE MENU ===== */
.mobile-menu-modern {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 280px;
    height: 100vh;
    background: #ffffff;
    z-index: 1100;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-menu-modern.open {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-menu-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1a365d;
}

.mobile-nav-modern {
    padding: 1rem 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    background: rgba(0, 0, 0, 0.02);
    color: #1a365d;
}

.mobile-nav-link.active {
    color: #1a365d;
    background: rgba(26, 54, 93, 0.04);
    border-left: 2px solid #2b6cb0;
}

.mobile-nav-link i {
    width: 16px;
    text-align: center;
    color: #718096;
    font-size: 0.875rem;
}

.mobile-nav-link:hover i,
.mobile-nav-link.active i {
    color: #2b6cb0;
}

.mobile-nav-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0.75rem 1.25rem;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    z-index: 1050;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ===== FOOTER ELEGANTE ===== */
.footer-modern {
    background: #1a202c;
    color: #a0aec0;
    padding: 3.5rem 0 0;
    position: relative;
}

.footer-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-brand {
    max-width: 260px;
}

.footer-brand img {
    height: 38px;
    margin-bottom: 1.25rem;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-brand p {
    font-size: 0.8125rem;
    line-height: 1.7;
    color: #718096;
    margin-bottom: 1.25rem;
}

.footer-social {
    display: flex;
    gap: 0.5rem;
}

.footer-social a {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    color: #a0aec0;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.footer-social a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateY(-2px);
}

.footer-title {
    font-family: var(--font-display, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1.25rem;
    letter-spacing: 0.02em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #718096;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #ffffff;
    padding-left: 3px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.footer-contact-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #a0aec0;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.footer-contact-item span {
    font-size: 0.8125rem;
    color: #718096;
    line-height: 1.5;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-copyright {
    font-size: 0.75rem;
    color: #4a5568;
}

.footer-legal {
    display: flex;
    gap: 1.25rem;
}

.footer-legal a {
    font-size: 0.75rem;
    color: #4a5568;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: #a0aec0;
}

/* WhatsApp Flutuante */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.whatsapp-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25d366;
    color: #ffffff;
    border-radius: 50%;
    font-size: 1.375rem;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.3);
    transition: all 0.2s ease;
}

.whatsapp-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 14px rgba(37, 211, 102, 0.35);
    color: #ffffff;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 78px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a365d;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.75rem;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(26, 54, 93, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 998;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #2c5282;
    transform: translateY(-2px);
    color: #ffffff;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 991px) {
    .nav-modern {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .hide-mobile {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0.25rem 0;
    }

    .logo-modern img {
        height: 40px;
    }

    .footer-modern {
        padding: 2.5rem 0 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-brand {
        max-width: 100%;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .whatsapp-float {
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-btn {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .back-to-top {
        right: 68px;
        width: 32px;
        height: 32px;
    }
}

/* Espaçamento para conteúdo após header fixo */
main,
#main-content {
    padding-top: 56px;
}

@media (max-width: 768px) {

    main,
    #main-content {
        padding-top: 52px;
    }
}

/* Skip Link - Acessibilidade */
.skip-link {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a365d;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0 0 4px 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ===== MOBILE ENHANCEMENTS ===== */

/* Touch targets mínimos para mobile */
@media (max-width: 991px) {

    /* Mobile Toggle - Touch target adequado */
    .mobile-toggle {
        min-width: var(--touch-target-min, 44px);
        min-height: var(--touch-target-min, 44px);
        width: 44px;
        height: 44px;
        padding: 12px;
        display: flex;
        border-radius: 8px;
    }

    .mobile-toggle span {
        width: 20px;
        height: 2px;
    }

    .mobile-nav-link {
        min-height: var(--touch-target-min, 44px);
        padding: 0.875rem 1.25rem;
    }

    .mobile-menu-close {
        min-width: var(--touch-target-min, 44px);
        min-height: var(--touch-target-min, 44px);
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
    }

    .header-actions .btn {
        min-height: var(--touch-target-min, 44px);
        padding: 0.5rem 1rem;
    }

    /* Menu mobile - Melhorias visuais */
    .mobile-menu-modern {
        max-width: 320px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .mobile-menu-header {
        background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    /* Seção de contato rápido no menu */
    .mobile-contact-section {
        padding: 1rem 1.25rem;
        background: #f8fafc;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .mobile-contact-section p {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        color: #64748b;
        font-size: 0.875rem;
    }

    .mobile-contact-section p:last-child {
        margin-bottom: 0;
    }

    .mobile-contact-section i {
        color: #1a5f4a;
        width: 16px;
        text-align: center;
    }
}

/* Breakpoint 480px - Mobile Large */
@media (max-width: 480px) {
    .header-inner {
        padding: 0.25rem var(--mobile-padding-sm, 0.75rem);
    }

    .logo-modern img {
        height: 36px;
    }

    .mobile-toggle {
        width: 44px;
        height: 44px;
        padding: 10px;
    }

    .mobile-toggle span {
        width: 22px;
        height: 2px;
    }

    /* Mobile Menu Enhancements */
    .mobile-menu-modern {
        max-width: 100%;
        width: 100%;
    }

    .mobile-nav-link {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }

    .mobile-nav-link i {
        width: 24px;
        font-size: 1rem;
    }

    /* Footer mobile enhancements */
    .footer-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .footer-links a {
        font-size: 0.875rem;
        padding: 0.5rem 0;
        display: block;
    }

    .footer-contact-item {
        margin-bottom: 1rem;
    }

    .footer-contact-item span {
        font-size: 0.875rem;
    }

    .footer-legal {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    .footer-legal a {
        font-size: 0.8125rem;
        padding: 0.25rem 0;
    }
}

/* Breakpoint 375px - Mobile Small */
@media (max-width: 375px) {
    .logo-modern img {
        height: 32px;
    }

    .header-inner {
        gap: 0.75rem;
    }

    .mobile-menu-header {
        padding: 0.75rem 1rem;
    }

    .mobile-nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    .footer-brand p {
        font-size: 0.8125rem;
    }

    .footer-social a {
        width: 40px;
        height: 40px;
    }
}

/* Safe Areas para Notch Devices (iPhone X+) */
@supports (padding: env(safe-area-inset-bottom)) {
    .whatsapp-float {
        bottom: calc(16px + env(safe-area-inset-bottom));
        right: calc(16px + env(safe-area-inset-right));
    }

    .back-to-top {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .footer-bottom {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .mobile-menu-modern {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* Animação suave no menu mobile */
.mobile-menu-modern {
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Feedback visual de toque */
@media (hover: none) and (pointer: coarse) {
    .mobile-nav-link:active {
        background: rgba(26, 54, 93, 0.08);
    }

    .footer-links a:active,
    .footer-social a:active {
        opacity: 0.7;
    }

    .header-actions .btn:active {
        transform: scale(0.97);
    }
}

/* Melhor visibilidade do foco para acessibilidade */
@media (max-width: 768px) {
    .mobile-nav-link:focus-visible {
        outline: 2px solid #2b6cb0;
        outline-offset: -2px;
        border-radius: 4px;
    }

    .whatsapp-btn:focus-visible,
    .back-to-top:focus-visible {
        outline: 2px solid #1a365d;
        outline-offset: 2px;
    }
}