/*
 * Agoogi full-width responsive navigation fix
 * Keeps every top-menu label visible for signed-in and signed-out visitors.
 * Load this file AFTER style.css and shop-marketplace.css.
 */

@media (min-width: 901px) {
    /* The general .container rule is intentionally narrow for page content.
       The navigation needs the full browser width instead. */
    .header-nav-row {
        overflow: visible !important;
    }

    .header-nav-row .nav-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding-inline: clamp(12px, 1.4vw, 28px) !important;
        justify-content: center !important;
    }

    .header-nav-row .nav {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        column-gap: clamp(4px, 0.55vw, 12px) !important;
        row-gap: 8px !important;
        padding: 8px 0 !important;
        overflow: visible !important;
    }

    .header-nav-row .nav > a,
    .header-nav-row .nav .dropdown-toggle,
    .header-nav-row .nav .nav-link-button {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        padding: 8px clamp(6px, 0.55vw, 11px) !important;
        font-size: clamp(13px, 0.86vw, 17px) !important;
        line-height: 1.2 !important;
    }

    .header-nav-row .nav-dropdown,
    .header-nav-row .header-currency-form,
    .header-nav-row .nav-inline-form {
        flex: 0 0 auto !important;
        min-width: 0 !important;
    }

    .header-nav-row .header-search-wrap {
        width: auto !important;
        flex: 1 1 210px !important;
        min-width: 175px !important;
        max-width: 310px !important;
    }

    .header-nav-row .header-search {
        width: 100% !important;
        min-width: 0 !important;
    }

    .header-nav-row .header-search input {
        width: auto !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .header-nav-row .nav-inline-form {
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
    }

    .header-nav-row .nav-link-button {
        appearance: none !important;
        border: 0 !important;
        background: transparent !important;
        color: #0f172a !important;
        font: inherit !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        border-radius: 10px !important;
    }

    .header-nav-row .nav-link-button:hover,
    .header-nav-row .nav-link-button:focus-visible {
        background: #f1f5f9 !important;
        color: #0369a1 !important;
    }
}

/*
 * On narrower laptops and tablets, keep the six business-area links first.
 * Search, currency, payment and account links may move to a clean second row
 * instead of being clipped off either side of the screen.
 */
@media (min-width: 901px) and (max-width: 1450px) {
    .header-nav-row .header-search-wrap {
        order: 20 !important;
        flex: 1 1 320px !important;
        max-width: 460px !important;
    }

    .header-nav-row .header-currency-form {
        order: 21 !important;
    }

    .header-nav-row .nav > a[href="/pay-online"] {
        order: 22 !important;
    }

    .header-nav-row .nav > a[href="/dashboard"],
    .header-nav-row .nav > a[href="/my-session-registrations"],
    .header-nav-row .nav > a[href="/cart"],
    .header-nav-row .nav > a[href="/login"],
    .header-nav-row .nav-inline-form {
        order: 23 !important;
    }
}

/* Keep the Logout control visually consistent in the existing mobile menu. */
@media (max-width: 900px) {
    .header-nav-row .nav-inline-form {
        width: 100% !important;
        margin: 0 !important;
    }

    .header-nav-row .nav-link-button {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 18px 26px !important;
        border: 1px solid var(--border) !important;
        border-radius: 18px !important;
        background: #ffffff !important;
        color: #0f172a !important;
        font-size: 22px !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        text-align: left !important;
        cursor: pointer !important;
    }
}
