/* ===================================
   CLOUD TOP G — Shared Components
   (Navbar, Footer, WhatsApp FAB)
   =================================== */

/* ====================================
   NAVBAR
   ==================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.navbar--scrolled {
    background: rgba(255, 255, 255, 0.97);
    border-bottom-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
}

.navbar__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar__logo {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.navbar__logo-icon {
    width: 36px;
    height: auto;
}

.navbar__logo-text {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.navbar--dark .navbar__logo-text {
    color: var(--white);
}

.navbar--dark .navbar__hamburger span {
    background: var(--white);
}

.navbar__nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navbar__link {
    font-size: 15px;
    font-weight: 500;
    color: var(--dark);
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.navbar__link:hover {
    color: var(--red);
}

.navbar__link svg {
    transition: transform var(--transition);
}

.navbar__link:hover svg {
    transform: rotate(180deg);
}

.navbar__dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--white);
    border-radius: 8px;
    padding: 12px 0;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 100;
}

.navbar__dropdown:hover .navbar__dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.navbar__dropdown-item {
    display: block;
    padding: 10px 24px;
    color: var(--dark);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition), background-color var(--transition);
}

.navbar__dropdown-item:hover {
    color: var(--red);
    background-color: #f9f9f9;
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar__login {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    transition: color var(--transition);
}

.navbar__login:hover {
    color: var(--red);
}

/* Hamburger */
.navbar__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    z-index: 1001;
}

.navbar__hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: all var(--transition);
}

.navbar__hamburger--active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.navbar__hamburger--active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ====================================
   FOOTER
   ==================================== */
.footer {
    background: var(--dark);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 64px 0 48px;
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1.5fr repeat(4, 1fr);
    gap: 40px;
}

.footer__brand {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer__logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer__logo-icon {
    width: 36px;
    height: auto;
}

.footer__logo-text {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
}

.footer__social {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.footer__social-link {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.footer__social-link:hover {
    background: var(--red);
    transform: translateY(-2px);
}

.footer__social-link img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.footer__heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__list a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    /* Dimmed slightly to not clash with headings */
    transition: color var(--transition);
}

.footer__list a:hover {
    color: var(--white);
}

.footer__contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.footer__contact-item:last-child {
    margin-bottom: 0;
}

.footer__contact-item img {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.footer__contact-item span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.60);
    /* Improved visibility */
}

/* ====================================
   WHATSAPP FAB
   ==================================== */
.whatsapp-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all var(--transition);
    animation: whatsappPulse 2s infinite;
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
}

.whatsapp-fab img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}

/* ====================================
   COMPONENT RESPONSIVE
   ==================================== */
@media (max-width: 1024px) {
    .footer__inner {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    :root {
        --section-padding: 60px 0;
        --nav-height: 64px;
    }

    .navbar__hamburger {
        display: flex;
    }

    .navbar__hamburger--active {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .navbar__nav {
        /* Base hidden state */
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: var(--dark);
        flex-direction: column;
        padding: calc(var(--nav-height) + 20px) 40px 40px;
        gap: 32px;
        border-bottom: none;
        box-shadow: none;
        /* Fixed edge gradient issue by removing shadow */
        overflow-y: auto;
        z-index: 1000;
        /* Slide animation */
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        /* Always flex, handled by transform instead of display: none */
    }

    .navbar__nav--open {
        transform: translateX(0);
    }

    .navbar__link {
        font-size: 1.2rem;
        color: var(--white);
        justify-content: flex-start;
        width: 100%;
        text-align: left;
    }

    .navbar__dropdown {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        width: 100%;
    }

    .navbar__dropdown>.navbar__link {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .navbar__dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: none;
        padding: 16px 0 0 16px;
        /* Indent the sub-items slightly */
        background: transparent;
        width: 100%;
        text-align: left;
        /* Keep left alignment */
    }

    .navbar__dropdown-item {
        color: rgba(255, 255, 255, 0.7);
        padding: 12px 0;
        display: block;
        /* Ensure it takes full width for easy tapping without shifting text */
        transition: color 0.2s ease;
    }

    .navbar__dropdown-item:hover {
        background: transparent;
        color: var(--white);
    }

    .navbar__dropdown:hover .navbar__dropdown-menu {
        transform: none;
        /* Nullify desktop hover transform so it won't shift */
    }

    .navbar__dropdown--open .navbar__dropdown-menu {
        display: block;
    }

    .navbar__dropdown--open .navbar__link svg {
        transform: rotate(180deg);
    }

    .navbar__nav--open {
        display: flex;
    }

    .navbar__actions {
        /* Hide by default, revealed via .navbar__actions--open class added by JS */
        display: none;
        position: static;
        background: transparent;
        flex-direction: column;
        padding: 20px 0 0 0;
        gap: 16px;
        align-items: stretch;
        z-index: auto;
        transform: none;
        transition: none;
    }

    .navbar__actions--open {
        /* No longer needed since it's flowing inside the nav */
        display: flex;
    }

    .navbar__actions::before {
        display: none;
    }

    .navbar__actions .btn {
        justify-content: center;
    }

    .navbar__login {
        text-align: center;
        color: var(--white);
        padding: 12px;
    }

    .footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .navbar__inner {
        padding: 0 20px;
    }

    .footer__inner {
        padding-left: 20px;
        padding-right: 20px;
        grid-template-columns: 1fr;
    }
}

/* Temporary CSS Fix for Mobile Hover Shift */
@media (max-width: 1024px) {
    .navbar__dropdown-item:hover {
        padding: 12px 0;
        /* Override any unwanted padding overrides that shift text */
        transform: none;
    }
}

/* Fullscreen Mobile Menu Overrides */
@media (max-width: 1024px) {
    .navbar__nav {
        width: 100%;
        max-width: 100%;
        padding: 24px;
        align-items: center;
        gap: 20px;
        /* Compact items so Login/Apply remain in view when dropdown opens */
    }

    .navbar__link {
        text-align: center;
        justify-content: center;
        font-size: 1.3rem;
        /* Slightly smaller to fit with dropdown open */
    }

    .navbar__dropdown>.navbar__link {
        justify-content: center;
        gap: 8px;
    }

    .navbar__dropdown-menu {
        text-align: center;
        padding: 16px 0 0 0;
    }

    .navbar__dropdown {
        align-items: center;
        /* Center the Resources container itself */
    }

    /* Removed bottom pinning on .navbar__actions so buttons stick to FAQs */
    /* Mobile Menu Header for Logo and Close button */
    .mobile-menu-header {
        display: flex;
        /* Dynamically added via JS */
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 40px;
    }

    .mobile-menu-close {
        background: none;
        border: none;
        color: #fff;
        font-size: 2.5rem;
        cursor: pointer;
        line-height: 0.5;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-family: Arial, sans-serif;
        /* Fallback for consistent cross character */
    }
}