/**
 * Desktop Floating Navigation — Front Page Hero Overlay
 * Glassmorphism nav bar visible only on desktop (≥1024px).
 * Hidden on mobile where the hamburger toggle is used instead.
 *
 * @package TicketSystemTango
 */

/* ==========================================================================
   1. Base — hidden by default (mobile-first)
   ========================================================================== */

.tev-desktop-nav {
    display: none;
}

/* ==========================================================================
   2. Desktop layout (≥1024px)
   ========================================================================== */

@media (min-width: 1024px) {
    .tev-desktop-nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 2500;
        padding: 0 clamp(24px, 4vw, 60px);

        /* Glassmorphism — transparent initially */
        background: rgba(10, 10, 10, 0.35);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);

        /* Smooth transition when scrolling */
        transition:
            background-color 0.4s ease,
            border-color 0.4s ease,
            box-shadow 0.4s ease;
    }

    /* ── Scrolled state — more opaque ── */
    .tev-desktop-nav.is-scrolled {
        background: rgba(18, 18, 18, 0.92);
        border-bottom-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.45);
    }

    /* ── Inner flex container ── */
    .tev-desktop-nav__inner {
        display: flex;
        align-items: center;
        gap: 32px;
        max-width: 1440px;
        margin: 0 auto;
        height: 64px;
    }

    /* ==========================================================================
       3. Logo
       ========================================================================== */

    .tev-desktop-nav__logo {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        text-decoration: none;
        transition: opacity 0.2s ease;
    }

    .tev-desktop-nav__logo:hover {
        opacity: 0.85;
    }

    .tev-desktop-nav__logo img {
        height: 38px;
        width: auto;
        display: block;
    }

    /* ==========================================================================
       4. Menu items
       ========================================================================== */

    .tev-desktop-nav__menu {
        display: flex;
        align-items: center;
        gap: 4px;
        list-style: none;
        margin: 0;
        padding: 0;
        flex: 1;
    }

    .tev-desktop-nav__menu li {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .tev-desktop-nav__menu li a {
        display: inline-flex;
        align-items: center;
        padding: 8px 16px;
        border-radius: var(--ts-radius-sm, 4px);
        color: rgba(255, 255, 255, 0.78);
        font-family: var(--font-body, 'Inter', sans-serif);
        font-size: 0.85rem;
        font-weight: 500;
        letter-spacing: 0.03em;
        text-decoration: none;
        text-transform: none;
        white-space: nowrap;
        position: relative;
        transition:
            color 0.2s ease,
            background-color 0.2s ease;
    }

    /* Hover state */
    .tev-desktop-nav__menu li a:hover {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.06);
    }

    /* Gold underline on hover — slides in from center */
    .tev-desktop-nav__menu li a::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--ts-gold, #c6a664);
        border-radius: 1px;
        transition: width 0.3s ease, left 0.3s ease;
    }

    .tev-desktop-nav__menu li a:hover::after {
        width: calc(100% - 32px);
        left: 16px;
    }

    /* Current / active page */
    .tev-desktop-nav__menu li.current-menu-item a,
    .tev-desktop-nav__menu li.current_page_item a {
        color: var(--ts-gold, #c6a664);
    }

    .tev-desktop-nav__menu li.current-menu-item a::after,
    .tev-desktop-nav__menu li.current_page_item a::after {
        width: calc(100% - 32px);
        left: 16px;
        background: var(--ts-gold, #c6a664);
    }

    /* ==========================================================================
       5. Right-side actions (search + cart)
       ========================================================================== */

    .tev-desktop-nav__actions {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
        flex-shrink: 0;
    }

    /* Icon buttons (search, cart) */
    .tev-desktop-nav__icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0 !important;
        border: none !important;
        border-radius: 50% !important;
        background: transparent !important;
        color: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        position: relative;
        transition:
            color 0.2s ease,
            background-color 0.2s ease,
            transform 0.2s ease;
        text-decoration: none;
        box-shadow: none !important;
    }

    .tev-desktop-nav__icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .tev-desktop-nav__icon-btn:hover {
        color: var(--ts-gold, #c6a664);
        background: rgba(198, 166, 100, 0.1) !important;
        transform: scale(1.08);
    }

    .tev-desktop-nav__icon-btn:active {
        transform: scale(0.95);
    }

    /* Cart count badge */
    .tev-desktop-nav__cart-count {
        position: absolute;
        top: 2px;
        right: 2px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: var(--ts-gold, #c6a664);
        color: var(--ts-black, #0a0a0a);
        font-family: var(--font-body, 'Inter', sans-serif);
        font-size: 0.65rem;
        font-weight: 700;
        line-height: 18px;
        text-align: center;
    }

    /* ==========================================================================
       6. Inline search bar (expandable)
       ========================================================================== */

    .tev-desktop-nav__search {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition:
            max-height 0.35s ease,
            opacity 0.3s ease,
            padding 0.35s ease;
        padding: 0 clamp(24px, 4vw, 60px);
        background: rgba(18, 18, 18, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .tev-desktop-nav__search[aria-hidden="false"] {
        max-height: 80px;
        opacity: 1;
        padding-top: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tev-desktop-nav__search .search-form,
    .tev-desktop-nav__search .woocommerce-product-search {
        display: flex;
        align-items: center;
        max-width: 600px;
        margin: 0 auto;
        background: var(--ts-surface-2, #232323);
        border-radius: var(--ts-radius-pill, 999px);
        padding: 4px 8px 4px 20px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        transition: border-color 0.2s ease;
    }

    .tev-desktop-nav__search .search-form:focus-within,
    .tev-desktop-nav__search .woocommerce-product-search:focus-within {
        border-color: var(--ts-gold, #c6a664);
    }

    .tev-desktop-nav__search .search-field {
        flex: 1;
        background: transparent !important;
        border: none !important;
        color: var(--ts-lightgrey, #e0e0e0) !important;
        font-size: 0.95rem;
        padding: 8px 0 !important;
        box-shadow: none !important;
    }

    .tev-desktop-nav__search .search-field:focus {
        outline: none;
    }

    .tev-desktop-nav__search .search-submit,
    .tev-desktop-nav__search button[type="submit"] {
        background: var(--ts-gold, #c6a664) !important;
        border: none !important;
        border-radius: 50% !important;
        width: 36px;
        height: 36px;
        padding: 0 !important;
        margin-left: 8px;
        cursor: pointer;
        font-size: 0 !important;
        color: var(--ts-black, #0a0a0a) !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: none !important;
        transition: background-color 0.2s ease, transform 0.2s ease;
        /* Search icon via background SVG */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        background-size: 18px 18px !important;
    }

    .tev-desktop-nav__search .search-submit:hover,
    .tev-desktop-nav__search button[type="submit"]:hover {
        background-color: #E8C37E !important;
        transform: scale(1.08);
    }

    /* ==========================================================================
       7. Spacer — push hero content below the fixed nav
       ========================================================================== */

    /* The nav is 64px tall. We don't need a spacer because the hero is
       full-viewport and the nav overlays on top of it transparently. */
}

/* ==========================================================================
   8. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .tev-desktop-nav,
    .tev-desktop-nav__menu li a::after,
    .tev-desktop-nav__search,
    .tev-desktop-nav__icon-btn {
        transition: none !important;
    }
}
