/* ==================== BASE: HIDE NAVBAR BY DEFAULT ==================== */
.navbar-floating {
    display: none !important;
}

/* ==================== DESKTOP FLOATING GLASS NAVBAR (≥1025px) ==================== */
@media (min-width: 1025px) {

    /* Hide old navbar on desktop */
    .main-header {
        display: none !important;
    }

    /* Floating Glass Navbar */
    .navbar-floating {
        display: flex !important;
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 80px);
        max-width: 1200px;
        height: 70px;
        z-index: 100;

        background: rgba(43, 37, 32, 0.12);
        backdrop-filter: blur(15px) saturate(1.8);
        border: 1.5px solid rgba(247, 242, 236, 0.1);
        border-radius: 50px;

        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.3),
            inset 0 1px 2px rgba(255, 255, 255, 0.05);

        padding: 0 30px;
        align-items: center;
        justify-content: space-between;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .navbar-floating:hover {
        box-shadow:
            0 12px 48px rgba(0, 0, 0, 0.4),
            0 0 24px rgba(216, 67, 21, 0.12),
            inset 0 1px 2px rgba(255, 255, 255, 0.08);
        transform: translateX(-50%) translateY(-2px);
    }

    /* Logo Section */
    .navbar-logo {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .navbar-logo img {
        height: 50px;
        width: auto;
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
        transition: transform 0.3s ease;
    }

    .navbar-logo img:hover {
        transform: scale(1.05) rotate(-2deg);
    }

    .navbar-logo-text {
        display: flex;
        flex-direction: column;
        line-height: 1;
    }

    .navbar-logo-text .brand-name {
        font-size: 18px;
        font-weight: 700;
        color: var(--primary-red);
        letter-spacing: 1px;
    }

    .navbar-logo-text .brand-location {
        font-size: 10px;
        font-weight: 600;
        color: rgba(247, 242, 236, 0.6);
        letter-spacing: 2px;
        margin-top: 2px;
    }

    /* Center Box (Animated Container) */
    .navbar-center-box {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(247, 242, 236, 0.05);
        padding: 6px;
        border-radius: 40px;
        position: relative;
        width: 299px;
        /* Ridotto del 5% da 315px */
        height: 51.5px;
        /* Aumentato del 3% da 50px */
        /* Shrinks after text fades (0.2s delay) */
        transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s;
        will-change: width;
    }

    .navbar-center-box.compact {
        width: 230px;
    }

    /* Navigation Links (Default State) */
    .nav-links-container {
        display: flex;
        gap: 8px;
        opacity: 1;
        visibility: visible;
        transform: scale(1);
        position: absolute;
        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0s linear 0s;
    }

    .nav-links-container.hidden {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.95);
        pointer-events: none;
        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0s linear 0.25s;
    }

    .nav-links-container a {
        color: var(--text-light);
        text-decoration: none;
        padding: 10px 22px;
        border-radius: 32px;
        font-size: 15px;
        font-weight: 500;
        letter-spacing: 0.5px;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

    .nav-links-container a:hover {
        background: rgba(247, 242, 236, 0.08);
        color: var(--text-light);
    }

    .nav-links-container a.active {
        background: linear-gradient(135deg, var(--primary-red), #FF6F42);
        color: white;
        box-shadow: 0 4px 16px rgba(216, 67, 21, 0.4);
    }

    /* Price Toggle (Hidden by default) */
    .price-toggle-navbar {
        display: flex;
        align-items: center;
        gap: 15px;
        opacity: 0;
        visibility: hidden;
        transform: scale(0.95);
        position: absolute;
        pointer-events: none;
        transition:
            opacity 0.3s ease,
            transform 0.3s ease,
            visibility 0s linear 0.3s;
    }

    .price-toggle-navbar.visible {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
        pointer-events: auto;
        transition:
            opacity 0.3s ease,
            transform 0.3s ease,
            visibility 0s linear 0s;
    }

    .price-toggle-navbar .toggle-label {
        font-weight: 600;
        font-size: 15px;
        color: rgba(247, 242, 236, 0.6);
        transition: color 0.3s ease;
        user-select: none;
    }

    .price-toggle-navbar .toggle-label.active {
        color: var(--text-light);
    }

    .price-toggle-navbar .switch {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 32px;
        flex-shrink: 0;
    }

    .price-toggle-navbar .switch input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

    .price-toggle-navbar .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--text-secondary);
        transition: background-color 0.4s ease;
        border-radius: 34px;
    }

    .price-toggle-navbar .slider:before {
        position: absolute;
        content: "";
        height: 24px;
        width: 24px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .price-toggle-navbar input:checked+.slider {
        background-color: var(--primary-red);
    }

    .price-toggle-navbar input:checked+.slider:before {
        transform: translateX(28px);
    }

    /* Keep existing btn-primary styles or ensure they work */
    .navbar-floating .btn-primary {
        background: linear-gradient(135deg, var(--primary-red), #FF6F42);
        color: white;
        padding: 12px 26px;
        border-radius: 40px;
        text-decoration: none;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 6px 20px rgba(216, 67, 21, 0.35);
        transition: all 0.3s ease;
        font-size: 15px;
    }

    .navbar-floating .btn-primary:hover {
        box-shadow: 0 8px 28px rgba(216, 67, 21, 0.5);
        transform: translateY(-2px);
    }

    /* Accessibility */
    .nav-links-container a:focus-visible,
    .navbar-floating .btn-primary:focus-visible {
        outline: 2px solid var(--primary-red);
        outline-offset: 2px;
    }
}

/* ==================== MOBILE: ENSURE OLD NAVBAR IS VISIBLE ==================== */
@media (max-width: 1024px) {

    /* Show old navbar on mobile */
    .main-header {
        display: flex !important;
    }

    /* Extra safety: ensure floating navbar stays hidden */
    .navbar-floating {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}