/* ==============================================
   KESTIO - Layout
   Header, footer, responsive de base
   ============================================== */

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    z-index: 102;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-coral);
}

/* Hide mobile CTA on desktop */
.nav-links .mobile-cta {
    display: none;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.nav-dropdown-toggle::after {
    content: '';
    border: solid var(--color-text-light);
    border-width: 0 2px 2px 0;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s;
    margin-top: -3px;
}

.nav-dropdown:hover .nav-dropdown-toggle::after {
    transform: rotate(-135deg);
    margin-top: 3px;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    min-width: 320px;
    padding: 12px 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-top: 12px;
    list-style: none;
}

.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-menu li {
    padding: 0;
}

.nav-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--color-text);
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background-color: var(--color-bg-alt);
    color: var(--color-coral);
}

/* Footer */
.footer {
    padding: 48px 0 24px;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.footer-logo {
    height: 28px;
    width: auto;
}

.footer-brand p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-links a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--color-coral);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Mobile Menu Burger */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-navy);
    margin: 3px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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

/* Responsive Layout */
@media (max-width: 992px) {
    .logo {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .logo-img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: 32px;
        width: auto;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav .btn {
        display: none;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background-color: white;
        flex-direction: column;
        padding: 80px 24px 24px;
        gap: 0;
        box-shadow: -5px 0 20px rgba(0,0,0,0.15);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 100;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links > li {
        border-bottom: 1px solid var(--color-border);
    }

    .nav-links > li > a,
    .nav-dropdown-toggle {
        display: block;
        padding: 16px 0;
        font-size: 1.1rem;
    }

    /* Mobile dropdown */
    .nav-dropdown-toggle::after {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .nav-dropdown.open .nav-dropdown-toggle::after {
        transform: translateY(-50%) rotate(-135deg);
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        min-width: auto;
        padding: 0 0 8px 16px;
        margin-top: 0;
        display: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu a {
        padding: 12px 0;
        font-size: 1rem;
    }

    /* Mobile CTA in menu */
    .nav-links .mobile-cta {
        display: block;
        margin-top: 24px;
        padding-top: 24px;
        border-top: 1px solid var(--color-border);
        border-bottom: none;
    }

    .nav-links .mobile-cta .btn {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* Overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 99;
    }

    .mobile-overlay.active {
        display: block;
    }

    .footer-content {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}
