/* =========================================================
   FM HAIRSTYLE - TOP BAR / NAVIGATION
   Stable Desktop + Mobile Architecture
========================================================= */

:root {
    --fm-black: #120F10;
    --fm-espresso: #24191A;

    --fm-rose-gold: #D98C6B;
    --fm-rose-gold-dark: #C47A5A;
    --fm-rose-gold-light: #E8A88A;

    --fm-dusty-pink: #D96A8A;
    --fm-dusty-pink-light: #E88AA4;
    --fm-dusty-pink-dark: #C45A7A;

    --fm-ivory: #F8F1EC;
    --fm-warm-gray: #BEB2AE;
    --fm-warm-gray-dark: #9A8E8A;

    --fm-white: #FFFFFF;

    --fm-border-subtle: rgba(217, 140, 107, 0.15);
}


/* =========================================================
   GLOBAL HEADER SAFETY
========================================================= */

.fm-topbar,
.fm-header,
.fm-header *,
.fm-topbar * {
    box-sizing: border-box;
}

.fm-topbar,
.fm-header {
    width: 100%;
    max-width: 100%;
}


/* =========================================================
   DESKTOP UTILITY BAR
========================================================= */

.fm-topbar {
    position: relative;
    z-index: 1001;

    background: var(--fm-black);
    color: var(--fm-ivory);

    font-family: 'Inter', sans-serif;
    font-size: 13px;

    border-bottom: 1px solid var(--fm-border-subtle);
}

.topbar-content {
    min-height: 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}


/* Contact */

.topbar-contact {
    display: flex;
    align-items: center;
    gap: 20px;

    min-width: 0;
}

.topbar-contact a {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--fm-ivory);
    text-decoration: none;

    font-size: 13px;

    opacity: 0.85;

    transition:
        color 0.25s ease,
        opacity 0.25s ease;
}

.topbar-contact a:hover {
    color: var(--fm-rose-gold);
    opacity: 1;
}

.topbar-contact a i {
    color: var(--fm-rose-gold);
    font-size: 13px;
}


/* Right side */

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;

    flex-shrink: 0;
}


/* Social icons */

.topbar-social {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-social .social-link {
    color: var(--fm-ivory);

    font-size: 14px;
    text-decoration: none;

    opacity: 0.65;

    transition:
        color 0.25s ease,
        opacity 0.25s ease,
        transform 0.25s ease;
}

.topbar-social .social-link:hover {
    color: var(--fm-rose-gold);
    opacity: 1;
    transform: translateY(-2px);
}


/* Language */

.language-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 3px 12px;

    color: var(--fm-ivory);
    background: transparent;

    border: 1px solid rgba(248, 241, 236, 0.2);
    border-radius: 4px;

    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;

    text-decoration: none;

    transition:
        color 0.25s ease,
        background-color 0.25s ease,
        border-color 0.25s ease;
}

.language-btn:hover {
    background: var(--fm-rose-gold);
    border-color: var(--fm-rose-gold);
    color: var(--fm-black);
}

.language-btn i {
    font-size: 11px;
}


/* =========================================================
   MAIN HEADER
========================================================= */

.fm-header {
    position: sticky;
    top: 0;

    z-index: 1000;

    background: var(--fm-espresso);

    border-bottom: 1px solid var(--fm-border-subtle);

    box-shadow:
        0 2px 20px rgba(18, 15, 16, 0.30);
}


/* =========================================================
   NAVBAR - DESKTOP
========================================================= */

.fm-header .navbar {
    min-height: 85px;
    padding: 6px 0;

    transition:
        min-height 0.3s ease,
        padding 0.3s ease;
}

.fm-header .navbar > .container {
    min-width: 0;
}


/* =========================================================
   LOGO
========================================================= */

.navbar-brand {
    padding: 0;
    margin-right: 40px;

    flex-shrink: 0;
}

.fm-logo {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 65px;

    object-fit: contain;

    transition: max-height 0.3s ease;
}


/* =========================================================
   DESKTOP SCROLLED HEADER
========================================================= */

.fm-header.scrolled {
    background: rgba(36, 25, 26, 0.98);

    box-shadow:
        0 4px 25px rgba(18, 15, 16, 0.35);
}

.fm-header.scrolled .navbar {
    min-height: 60px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.fm-header.scrolled .fm-logo {
    max-height: 45px;
}


/* =========================================================
   NAVIGATION
========================================================= */

.fm-header .navbar-collapse {
    min-width: 0;
}

.fm-header .navbar-nav {
    min-width: 0;
}

.fm-header .nav-link {
    position: relative;

    margin-left: 18px;

    padding-top: 10px;
    padding-bottom: 10px;

    color: var(--fm-ivory);

    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;

    text-decoration: none;

    opacity: 0.85;

    transition:
        color 0.25s ease,
        opacity 0.25s ease;
}

.fm-header .nav-link:hover,
.fm-header .nav-link.active {
    color: var(--fm-dusty-pink);
    opacity: 1;
}


/* Desktop underline */

.fm-header .nav-link::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 2px;

    width: 0;
    height: 2px;

    background: var(--fm-dusty-pink);

    transform: translateX(-50%);

    border-radius: 2px;

    transition: width 0.25s ease;
}

.fm-header .nav-link:hover::after,
.fm-header .nav-link.active::after {
    width: 60%;
}


/* Manage appointment */

.fm-header .nav-link.manage-link {
    color: var(--fm-ivory);
    font-weight: 500;
    opacity: 0.85;
}

.fm-header .nav-link.manage-link:hover,
.fm-header .nav-link.manage-link.active {
    color: var(--fm-dusty-pink);
    opacity: 1;
}


/* =========================================================
   DESKTOP BOOKING CTA
========================================================= */

.book-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    margin-left: 20px;

    padding: 6px 20px;

    background: var(--fm-dusty-pink);
    color: var(--fm-black);

    border: 2px solid transparent;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 700;

    letter-spacing: 0.8px;
    text-transform: uppercase;

    text-decoration: none;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.book-cta-btn:hover {
    background: var(--fm-dusty-pink-dark);
    color: var(--fm-ivory);

    transform: translateY(-2px);

    box-shadow:
        0 8px 25px rgba(217, 106, 138, 0.35);
}

.book-cta-btn:active {
    transform: translateY(0);
}


/* =========================================================
   MOBILE CONTROLS
========================================================= */

.mobile-nav-controls {
    display: none;

    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    flex-shrink: 0;
}

.mobile-nav-controls .navbar-toggler {
    display: none;
}


/* Language */

.mobile-language-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 4px 10px;

    color: var(--fm-ivory);
    background: transparent;

    border: 1px solid rgba(248, 241, 236, 0.2);
    border-radius: 4px;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;

    transition:
        color 0.25s ease,
        border-color 0.25s ease;
}

.mobile-language-btn:hover {
    color: var(--fm-rose-gold);
    border-color: var(--fm-rose-gold);
}


/* Booking icon */

.mobile-book-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 4px 8px;

    color: var(--fm-rose-gold);

    font-size: 1.1rem;

    text-decoration: none;

    transition: color 0.25s ease;
}

.mobile-book-btn:hover {
    color: var(--fm-dusty-pink);
}


/* =========================================================
   HAMBURGER
========================================================= */

.navbar-toggler {
    border: none;
    padding: 4px 6px;

    box-shadow: none !important;
}

.navbar-toggler:focus,
.navbar-toggler:active {
    outline: none;
    box-shadow: none;
}

.navbar-toggler-icon {
    position: relative;

    display: block;

    width: 26px;
    height: 20px;

    background-image: none !important;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after,
.navbar-toggler-icon span {
    content: '';

    position: absolute;

    left: 0;

    width: 100%;
    height: 2.5px;

    background: var(--fm-ivory);

    border-radius: 2px;

    transition:
        transform 0.25s ease,
        top 0.25s ease,
        bottom 0.25s ease,
        opacity 0.2s ease;
}

.navbar-toggler-icon::before {
    top: 0;
}

.navbar-toggler-icon span {
    top: 50%;
    transform: translateY(-50%);
}

.navbar-toggler-icon::after {
    bottom: 0;
}

.navbar-toggler[aria-expanded="true"]
.navbar-toggler-icon::before {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"]
.navbar-toggler-icon span {
    opacity: 0;
}

.navbar-toggler[aria-expanded="true"]
.navbar-toggler-icon::after {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}


/* =========================================================
   MOBILE CONTACT INFORMATION
========================================================= */

.mobile-contact-info {
    width: 100%;
    min-width: 0;

    margin-top: 10px;

    padding: 0 16px !important;
}

.mobile-divider {
    width: 50px;

    margin: 16px auto 12px;

    border: none;
    border-top: 2px solid var(--fm-rose-gold);

    opacity: 0.4;
}

.mobile-contact-items {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 10px;

    padding: 8px 0;
}

.mobile-contact-items a {
    display: flex;
    align-items: center;

    max-width: 100%;

    gap: 10px;

    padding: 4px 0;

    color: var(--fm-ivory) !important;

    font-size: 14px;

    text-decoration: none;

    opacity: 0.75;

    overflow-wrap: anywhere;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.mobile-contact-items a:hover {
    opacity: 1;
    color: var(--fm-rose-gold) !important;
}

.mobile-contact-items a i {
    width: 20px;

    flex: 0 0 20px;

    color: var(--fm-rose-gold);

    text-align: center;
}


/* =========================================================
   MOBILE SOCIAL ICONS
========================================================= */

.mobile-social-icons {
    display: flex;
    justify-content: center;

    gap: 18px;

    margin-top: 4px;

    padding: 16px 0 8px;

    border-top:
        1px solid rgba(190, 178, 174, 0.15);
}

.mobile-social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    color: var(--fm-warm-gray);

    background:
        rgba(248, 241, 236, 0.06);

    border-radius: 50%;

    font-size: 1.1rem;

    text-decoration: none;

    transition:
        color 0.25s ease,
        background-color 0.25s ease;
}

.mobile-social-icons a:hover {
    color: var(--fm-ivory);
    background: var(--fm-rose-gold);
}


/* =========================================================
   MOBILE FULL-WIDTH CTA
========================================================= */

.mobile-cta-full {
    display: block;

    width: 100%;

    margin: 16px 0 8px;

    padding: 8px 14px;

    background: var(--fm-dusty-pink);
    color: var(--fm-black);

    border-radius: 8px;

    font-size: 14px;
    font-weight: 700;

    letter-spacing: 0.8px;
    text-transform: uppercase;

    text-align: center;
    text-decoration: none;

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}

.mobile-cta-full:hover {
    background: var(--fm-dusty-pink-dark);
    color: var(--fm-ivory);
}


/* =========================================================
   TABLET / MOBILE
   991px AND BELOW

   IMPORTANT:
   Mobile header NEVER changes physical dimensions on scroll.
   The logo/header row NEVER moves when menu opens/closes.
========================================================= */

@media (max-width: 991px) {

    /* -----------------------------------------
       Utility bar
    ----------------------------------------- */

    .fm-topbar {
        display: none;
    }


    /* -----------------------------------------
       Main header
    ----------------------------------------- */

    .fm-header,
    .fm-header.scrolled {
        background: var(--fm-espresso);

        /* Avoid Safari compositing instability. */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;

        box-shadow:
            0 3px 18px rgba(18, 15, 16, 0.30);
    }


    /* =====================================================
       NAVBAR - ABSOLUTE STABILITY
       The 65px header row NEVER moves.
    ===================================================== */

    .fm-header .navbar,
    .fm-header.scrolled .navbar {
        position: relative;

        display: flex;
        align-items: flex-start;

        min-height: 65px;

        padding-top: 0;
        padding-bottom: 0;

        transition: none !important;
    }


    /* Bootstrap container - also fixed height */

    .fm-header .navbar > .container {
        position: relative;

        display: flex;
        align-items: center;
        flex-wrap: wrap;

        min-height: 65px;

        padding-top: 0;
        padding-bottom: 0;
    }


    /* =====================================================
       LOGO - Locked inside the 65px top row
    ===================================================== */

    .fm-header .navbar-brand {
        display: flex;
        align-items: center;

        height: 65px;

        padding: 0;
        margin-top: 0;
        margin-bottom: 0;

        align-self: flex-start;
    }

    .fm-header .fm-logo,
    .fm-header.scrolled .fm-logo {
        display: block;

        width: auto;
        height: auto;

        max-height: 45px;

        margin: 0;
        padding: 0;

        transform: none !important;
        transition: none !important;
    }


    /* =====================================================
       RIGHT-SIDE MOBILE CONTROLS
       Same locked 65px row as logo
    ===================================================== */

    .mobile-nav-controls {
        display: flex;

        align-items: center;
        justify-content: flex-end;

        height: 65px;

        margin-left: auto;

        align-self: flex-start;
    }

    .mobile-nav-controls .navbar-toggler {
        display: flex !important;

        align-items: center;
        justify-content: center;
    }


    /* =====================================================
       COLLAPSIBLE MENU

       Gets its OWN row below the logo.
       NEVER affects the 65px header row.
    ===================================================== */

    .fm-header .navbar-collapse {
        flex-basis: 100%;
        width: 100%;

        margin: 0;

        background: var(--fm-espresso);

        padding: 10px 0 18px;

        border-top:
            1px solid rgba(217, 140, 107, 0.10);

        border-radius:
            0 0 12px 12px;

        box-shadow:
            0 12px 30px rgba(18, 15, 16, 0.35);

        /*
           Do not let the expanded menu alter the
           vertical alignment of the 65px header row.
        */
        align-self: flex-start;

        /*
           Avoid 80vh here.
           Safari changes viewport height as browser
           chrome appears/disappears.
        */
        max-height: calc(100dvh - 65px);

        overflow-x: hidden;
        overflow-y: auto;

        overscroll-behavior: contain;
    }


    /* Bootstrap's collapsing animation */

    .fm-header .collapsing {
        flex-basis: 100%;
        width: 100%;

        transition: height 0.25s ease !important;
    }


    /* =====================================================
       MOBILE NAVIGATION LINKS
    ===================================================== */

    .fm-header .nav-link,
    .fm-header .nav-link.manage-link {
        margin-left: 0;

        padding: 11px 16px;

        color: var(--fm-ivory);

        border-bottom:
            1px solid rgba(248, 241, 236, 0.06);

        font-size: 14px;

        opacity: 0.9;
    }

    .fm-header .nav-link:hover,
    .fm-header .nav-link.active,
    .fm-header .nav-link.manage-link:hover,
    .fm-header .nav-link.manage-link.active {
        color: var(--fm-dusty-pink);
        opacity: 1;
    }


    /* No animated underline on mobile */

    .fm-header .nav-link::after {
        display: none;
    }


    /* =====================================================
       DESKTOP CTA disappears
    ===================================================== */

    .book-cta-btn {
        display: none !important;
    }
}


/* =========================================================
   FALLBACK FOR OLDER MOBILE BROWSERS WITHOUT DVH
========================================================= */

@supports not (height: 100dvh) {

    @media (max-width: 991px) {

        .fm-header .navbar-collapse {
            max-height: calc(100vh - 65px);
        }
    }
}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 576px) {

    /*
       IMPORTANT:
       Logo remains 45px.
       Do NOT shrink it again during scroll.
    */

    .fm-logo,
    .fm-header.scrolled .fm-logo {
        max-height: 45px;
    }

    .navbar-brand {
        margin-right: 8px;
    }

    .mobile-nav-controls {
        gap: 7px;
    }

    .mobile-language-btn {
        padding: 3px 8px;

        font-size: 11px;
    }

    .mobile-book-btn {
        padding: 4px 6px;

        font-size: 1rem;
    }

    .mobile-contact-items a {
        font-size: 13px;
    }

    .fm-header .nav-link,
    .fm-header .nav-link.manage-link {
        padding: 10px 14px;

        font-size: 14px;
    }
}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 380px) {

    .fm-logo,
    .fm-header.scrolled .fm-logo {
        max-height: 41px;
    }

    .mobile-nav-controls {
        gap: 5px;
    }

    .mobile-language-btn {
        padding: 3px 6px;

        font-size: 10px;
    }

    .mobile-book-btn {
        padding-left: 4px;
        padding-right: 4px;
    }
}