/*
  High-End Component Styles
  Oriental Medical Clinic - MH-003
*/

/* Navigation & Logo Color Sync */
#header .logo a,
#header .nav-link {
    color: var(--c-white) !important;
    transition: color 0.6s var(--transition-slow);
}

#header.scrolled .logo a,
#header.scrolled .nav-link {
    color: var(--c-primary) !important;
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition:
        background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        backdrop-filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        z-index 0s;
}

#header.menu-active {
    z-index: 4000;
    /* Below overlay but above page content */
}

#header.scrolled {
    padding: 20px 0;
    /* Keep same as default */
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--c-primary);
    /* Dark text when scrolled */
}

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

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-primary);
}

.nav-desktop {
    display: flex;
    gap: 50px;
}

.nav-link {
    text-decoration: none;
    color: var(--c-text-main);
    font-weight: 600;
    font-size: 1.05rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--c-accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--c-accent);
}

/* Footer Overhaul */
#footer {
    background: #2D2623;
    color: rgba(255, 255, 255, 0.7);
    padding: 100px 0 50px;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 100px;
    padding-bottom: 80px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-brand h4 {
    color: var(--c-white);
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-family: var(--font-serif);
    word-break: keep-all;
}

.footer-header {
    color: var(--c-white);
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: 0.1em;
}

.footer-menu-item {
    list-style: none;
    margin-bottom: 15px;
}

.footer-menu-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu-item a:hover {
    color: var(--c-accent);
}

#footer .footer-bottom {
    padding-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.footer-policy-links a {
    color: inherit;
    text-decoration: none;
    margin-left: 30px;
}

/* Mobile Navigation Overlay */
.nav-mobile-overlay {
    position: fixed;
    inset: 0;
    background-color: #FBF9F7 !important;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    padding: 60px 40px 60px;
    /* Shift content even higher */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--bezier), visibility 0.5s var(--bezier);
}

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

.nav-mobile-title {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--c-accent);
    margin-bottom: 40px;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-mobile-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Increased for better balance */
    list-style: none;
    padding: 0;
}

.nav-mobile-item {
    margin-bottom: 0;
    /* removed to use gap exclusively */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--bezier);
}

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

/* Staggered entry */
.nav-mobile-overlay.active .nav-mobile-item:nth-child(1) {
    transition-delay: 0.1s;
}

.nav-mobile-overlay.active .nav-mobile-item:nth-child(2) {
    transition-delay: 0.15s;
}

.nav-mobile-overlay.active .nav-mobile-item:nth-child(3) {
    transition-delay: 0.2s;
}

.nav-mobile-overlay.active .nav-mobile-item:nth-child(4) {
    transition-delay: 0.25s;
}

.nav-mobile-overlay.active .nav-mobile-item:nth-child(5) {
    transition-delay: 0.3s;
}

.nav-mobile-overlay.active .nav-mobile-item:nth-child(6) {
    transition-delay: 0.35s;
}

.nav-mobile-link {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--c-primary) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.nav-mobile-link::before {
    content: attr(data-num);
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--c-accent);
    margin-top: 5px;
}

.nav-mobile-footer {
    margin-top: auto;
    padding-top: 40px;
    border-top: 1px solid var(--c-border);
}

.nav-mobile-contact {
    font-size: 0.9rem;
    color: var(--c-text-sub);
    line-height: 1.8;
}

.mobile-toggle {
    display: none;
    width: 30px;
    height: 20px;
    position: fixed;
    right: 20px;
    top: 25px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 9999;
}

.mobile-toggle span {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--c-white);
    left: 0;
    transition: var(--transition-slow);
}

#header.scrolled .mobile-toggle span {
    background: var(--c-primary);
}

.mobile-toggle span:nth-child(1) {
    top: 0;
}

.mobile-toggle span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.mobile-toggle span:nth-child(3) {
    bottom: 0;
}

.mobile-toggle.active span:nth-child(1) {
    top: 50%;
    transform: rotate(45deg);
}

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

.mobile-toggle.active span:nth-child(3) {
    bottom: 50%;
    transform: rotate(-45deg);
}

@media (max-width: 1024px) {

    .nav-desktop,
    #header .btn-primary {
        display: none !important;
    }

    .mobile-toggle {
        display: block !important;
        position: fixed;
        right: 20px;
        top: 25px;
        z-index: 9999;
    }

    #header {
        height: 70px;
        padding: 0 !important;
        display: flex;
        align-items: center;
        width: 100vw;
        max-width: 100%;
    }

    .header-inner {
        width: 100%;
        padding: 0 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo-wrap {
        font-size: 1.25rem;
    }

    /* Fix mobile toggle colors explicitly for mobile */
    .mobile-toggle span {
        background: var(--c-white);
    }

    #header.scrolled .mobile-toggle span {
        background: var(--c-primary);
    }

    .mobile-toggle.active span {
        background: var(--c-primary) !important;
    }

    /* Footer Mobile Adjustments */
    .footer-main {
        grid-template-columns: 1fr;
        gap: 60px;
        padding-bottom: 60px;
        text-align: center;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-brand h4 {
        font-size: 1.5rem;
        word-break: keep-all;
        white-space: normal;
    }

    .footer-brand p {
        margin: 0 auto;
        max-width: 100%;
    }

    #footer .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-policy-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .footer-policy-links a {
        margin: 0;
    }
}