/* ===============================================================
   Buildbrand Hospitality Framework™
   Theme: Mohar Cottage
   File: header.css

   Description:
   Global site header layout and structure.

   Author: Sunil Chauhan
   Website: https://buildbrand.site
   =============================================================== */


/* ===============================================================
   SITE HEADER
   =============================================================== */

.site-header {

    position: sticky;

    top: 0;

    left: 0;

    width: 100%;

    z-index: var(--z-header);

    background: rgba(255, 252, 245, 0.92);

    backdrop-filter: blur(12px);

    -webkit-backdrop-filter: blur(12px);

    border-bottom: 1px solid rgba(0, 0, 0, .06);

}


/* ===============================================================
   HEADER INNER
   =============================================================== */

.site-header__inner {

    display: grid;

    grid-template-columns: auto 1fr auto;

    align-items: center;

    gap: var(--space-6);

    min-height: var(--header-height-mobile);

}


/* ===============================================================
   LOGO
   =============================================================== */

.site-header__logo {

    display: flex;

    align-items: center;

}

.site-header__logo img {

    display: block;

    width: auto;

    max-height: 72px;

}


/* ===============================================================
   SITE TITLE (Fallback)
   =============================================================== */

.site-title {

    color: var(--text-primary);

    font-family: var(--font-heading);

    font-size: var(--text-xl);

    font-weight: var(--font-bold);

    text-decoration: none;

}


/* ===============================================================
   NAVIGATION WRAPPER
   =============================================================== */

.site-header__navigation {

    display: flex;

    justify-content: center;

}


/* ===============================================================
   HEADER ACTIONS
   =============================================================== */

.site-header__actions {

    display: flex;

    align-items: center;

    gap: var(--space-3);

}


/* ===============================================================
   MOBILE TOGGLE
   =============================================================== */

.site-header__toggle {

    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 5px;

    width: 48px;

    height: 48px;

    padding: 0;

    border: 0;

    background: transparent;

    cursor: pointer;

}

.site-header__toggle span {

    display: block;

    width: 24px;

    height: 2px;

    background: var(--text-primary);

    transition: var(--transition-normal);

}


/* ===============================================================
   DESKTOP
   =============================================================== */

@media (min-width: 992px) {

    .site-header__inner {

        min-height: var(--header-height-desktop);

    }

    .site-header__toggle {

        display: none;

    }

}


/* ===============================================================
   MOBILE HEADER & NAVIGATION
   =============================================================== */

@media (max-width: 991px) {

    .site-header {
        position: sticky;
        z-index: var(--z-header);
    }

    .site-header__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.65rem;
        min-height: 76px;
        padding-block: 0.5rem;
    }

    .site-header__logo {
        min-width: 0;
    }

    .site-header__logo img {
        display: block;
        width: auto;
        max-width: 100%;
        max-height: 58px;
        object-fit: contain;
    }

    .site-header__actions {
        gap: 0.5rem;
        justify-content: flex-end;
        min-width: 0;
    }

    /* Compact booking CTA */
    .site-header__actions > .button {
        padding: 0.7rem 0.8rem;
        font-size: 0.8rem;
        line-height: 1.2;
        white-space: nowrap;
        text-align: center;
    }

    /* Hamburger tap target */
    .site-header__toggle {
        display: flex;
        flex: 0 0 44px;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 8px;
        gap: 5px;
        position: relative;
        z-index: 2;
    }

    .site-header__toggle span {
        width: 24px;
        transform-origin: center;
    }

    /* Animate hamburger into a close icon */
    .site-header.is-mobile-menu-open
    .site-header__toggle span:first-child {
        transform: translateY(7px) rotate(45deg);
    }

    .site-header.is-mobile-menu-open
    .site-header__toggle span:nth-child(2) {
        opacity: 0;
    }

    .site-header.is-mobile-menu-open
    .site-header__toggle span:last-child {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Mobile dropdown panel */
    .site-header__navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100dvh - 76px);
        overflow-y: auto;
        padding: 1rem 1.25rem 1.5rem;
        background: #FFFCF5;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 16px 28px rgba(0, 0, 0, 0.10);
    }

    .site-header.is-mobile-menu-open
    .site-header__navigation {
        display: block;
    }

    .site-header__navigation .site-menu {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .site-header__navigation .site-menu > .menu-item > a {
        display: flex;
        width: 100%;
        padding: 0.9rem 0;
        font-size: 1rem;
    }

    .site-header__navigation .site-menu > .menu-item > a::after {
        display: none;
    }
}

/* Narrow phones */
@media (max-width: 420px) {

    .site-header__inner {
        gap: 0.4rem;
    }

    .site-header__logo img {
        max-height: 48px;
    }

    .site-header__actions {
        gap: 0.3rem;
    }

    .site-header__actions > .button {
        padding: 0.65rem 0.55rem;
        font-size: 0.72rem;
    }

    .site-header__toggle {
        flex-basis: 42px;
        width: 42px;
        height: 44px;
    }
}
