/* ===================================================
   Header Theme 5 — Logo Centered + Menu Below
   Desktop: [Topbar] → [Search | Logo(centered) | Icons] → [Menu centered]
   Mobile: [Logo | Actions | Hamburger]
   Fashion/Editorial aesthetic.
   =================================================== */

/* --- Wrapper --- */
.ms-header-template-5 {
    background: var(--ms-color-white);
    width: 100%;
}

.ms-header-template-5 .ms-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Topbar --- */
.ms-header-template-5 .header-topbar {
    border-bottom: 1px solid var(--ms-color-border);
    padding: 6px 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.ms-header-template-5 .topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ms-header-template-5 .topbar-left,
.ms-header-template-5 .topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Desktop Layout --- */
.ms-header-template-5 .header-main {
    padding: 12px 0 0;
}

.ms-header-template-5 .main-inner-desktop {
    display: block;
}

/* Top Row: Search | Logo | Actions */
.ms-header-template-5 .top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    min-height: 50px;
}

.ms-header-template-5 .center-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.ms-header-template-5 .corner-left,
.ms-header-template-5 .corner-right {
    display: flex;
    gap: 16px;
    align-items: center;
    flex: 0 0 auto;
    min-width: 120px;
}

.ms-header-template-5 .corner-right {
    justify-content: flex-end;
}

/* Bottom Row: Menu full-width centered */
.ms-header-template-5 .bottom-row {
    border-top: 1px solid var(--ms-color-border);
    padding: 12px 0;
    display: flex;
    justify-content: center;
}

.ms-header-template-5 .bottom-row .ms-block-menu .ms-navbar-list {
    flex-wrap: nowrap;
}

/* Hamburger hidden desktop */
.ms-header-template-5 .ms-block-menu > .ms-navbar-btn {
    display: none;
}

/* ===================================================
   Responsive (< 992px)
   =================================================== */
@media (max-width: 991px) {
    /* Hide desktop, show mobile */
    .ms-header-template-5 .desktop-only-flex {
        display: none !important;
    }

    .ms-header-template-5 .mobile-only-flex {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
    }

    .ms-header-template-5 .header-topbar {
        display: none;
    }

    .ms-header-template-5 .header-main {
        padding: 14px 0;
    }

    /* Mobile layout */
    .ms-header-template-5 .mobile-logo {
        flex: 0 0 auto;
    }

    .ms-header-template-5 .mobile-actions {
        margin-left: auto;
        display: flex;
        gap: 14px;
        margin-right: 12px;
        align-items: center;
    }

    .ms-header-template-5 .mobile-menu {
        flex: 0 0 auto;
        position: static;
    }

    /* Hamburger */
    .ms-header-template-5 .ms-block-menu > .ms-navbar-btn {
        display: block;
        cursor: pointer;
    }

    /* Mobile menu dropdown */
    .ms-header-template-5 .ms-block-menu .ms-navbar-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--ms-color-white);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
        z-index: 999;
        gap: 0;
        border-top: 1px solid var(--ms-color-border);
    }

    .ms-header-template-5 .ms-block-menu .ms-navbar-list.ms-navbar-open {
        display: flex !important;
    }

    .ms-header-template-5 .ms-block-menu .ms-navbar-list > li {
        width: 100%;
        border-bottom: 1px solid var(--ms-color-border);
    }

    .ms-header-template-5 .ms-block-menu .ms-navbar-list > li:last-child {
        border-bottom: none;
    }

    .ms-header-template-5 .ms-block-menu .ms-navbar-list > li > a:not([class*="ms-btn"]) {
        padding: 14px 20px;
        font-size: 15px;
        width: 100%;
    }

    /* Submenu mobile */
    .ms-header-template-5 .ms-block-menu .sub-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        opacity: 1;
        transform: none;
        display: none;
        background-color: var(--ms-color-light);
    }

    .ms-header-template-5 .ms-block-menu .sub-menu li a {
        padding-left: 40px;
    }


}

/* --- Small Mobile --- */
@media (max-width: 480px) {
    .ms-header-template-5 .mobile-actions {
        gap: 10px;
    }
}

/* --- Desktop visibility utilities (scoped) --- */
@media (min-width: 992px) {
    .ms-header-template-5 .mobile-only-flex {
        display: none !important;
    }

    .ms-header-template-5 .desktop-only-flex {
        display: block !important;
    }
}