/* 2_header-navigation.css - UPDATED (Floating Glass Pill) */
/* ========= HEADER ========= */
.main-header {
    /* FLOATING PILL DESIGN */
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    height: 80px;
    /* FIXED HEIGHT - INCREASED for better spacing */

    /* GLASS STYLE DEFAULT */
    background: rgba(30, 27, 24, 0.4);
    /* Setup base for glass */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(247, 242, 236, 0.08);
    border-radius: 50px;
    /* PILL SHAPE */

    z-index: 100 !important;
    transition: all var(--transition-smooth);
    /* Smooth resize/restyle */

    /* Shadow for depth */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 0;
    /* Remove padding as height is fixed */
}

/* Scrolled state: slightly more opaque or different shadow, but SAME SHAPE/SIZE */
.main-header.scrolled {
    background: rgba(30, 27, 24, 0.85);
    /* Darker/Warmer when scrolled */
    border-color: rgba(247, 242, 236, 0.15);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
    /* No height change to prevent layout shift */
}

.main-header:not(.scrolled) {
    /* Optional: Make it slightly more transparent at top if desired, 
       but "Floating Pill" usually looks consistent. 
       Let's keep it consistent but maybe slightly lighter background. */
    background: rgba(30, 27, 24, 0.6);
}

.main-header .container {
    display: flex;
    /* Changed from Grid to Flex for better control */
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    /* Explicit padding for the container */
}

/* Ensure logo container is flex to remove line-height issues */
.main-header .logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.main-header .logo img {
    max-height: 55px;
    /* Adjusted for new navbar height */
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-micro);
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.main-nav {
    /* ABSOLUTE POSITIONING FOR PERFECT CENTERING */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    justify-content: center;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.main-header .logo img {
    max-height: 70px;
    transition: transform var(--transition-micro);
    /* UPDATED */
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.main-header .logo img:hover {
    transform: scale(1.05);
}

.main-nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 8px;
    position: relative;
    transition: color var(--transition-micro), transform var(--transition-micro);
    /* UPDATED */
}

.main-nav ul li a:hover {
    color: var(--primary-red);
    transform: translateY(-2px);
}

/* LINK ATTIVO: SEMPRE ROSSO */
.main-nav ul li a.active {
    background-color: var(--primary-red) !important;
    color: var(--text-light) !important;
    box-shadow: 0 2px 10px rgba(216, 67, 21, 0.4);
    /* UPDATED: Refined shadow color */
    border-bottom: none !important;
}

/* ========= DESKTOP NAV VISIBILITY STATES ========= */
/* Hide navigation links when showing price toggle */
.main-header.show-desktop-toggle .desktop-nav-links {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0);
    transform-origin: center;
    transition: opacity var(--transition-smooth), visibility var(--transition-smooth), transform var(--transition-smooth);
    /* Force hardware acceleration for Safari */
    -webkit-transform: scale(0);
    will-change: transform, opacity;
}

/* Force remove all shadows on hidden nav links (Safari fix) */
.main-header.show-desktop-toggle .desktop-nav-links * {
    box-shadow: none !important;
    text-shadow: none !important;
    opacity: 0 !important;
}

/* Show desktop price toggle in navbar when scrolling to menu */
.main-header .desktop-nav-switch {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.main-header.show-desktop-toggle .desktop-nav-switch {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger-icon {
    width: 30px;
    height: 20px;
    position: relative;
}

.hamburger-icon span {
    background-color: var(--text-light);
    height: 3px;
    width: 100%;
    position: absolute;
    left: 0;
    transition: all var(--transition-smooth);
    /* UPDATED */
}

.hamburger-icon span:nth-child(1) {
    top: 0;
}

.hamburger-icon span:nth-child(2) {
    top: 8px;
}

.hamburger-icon span:nth-child(3) {
    top: 16px;
}

.hamburger-menu.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg);
    top: 8px;
}

.hamburger-menu.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg);
    top: 8px;
}

/* Full-Screen Navigation Menu */
.fullscreen-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--surface-dark);
    /* Uses new warm taupe */
    z-index: 200;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity var(--transition-macro), transform var(--transition-macro);
    /* UPDATED */
}

.fullscreen-nav.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.fullscreen-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.fullscreen-nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 24px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: color var(--transition-micro), background-color var(--transition-micro);
    /* UPDATED */
}

.fullscreen-nav ul li a:hover {
    color: var(--primary-red);
    background-color: rgba(229, 57, 53, 0.1);
}

/* ========= BOTTONE "ORDINA ORA" ========= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    /* UPDATED: Gradient Warm Red */
    background: linear-gradient(135deg, #D84315, #FF6F42);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    border: none;
    /* UPDATED: Refined shadow */
    box-shadow: 0 6px 20px rgba(216, 67, 21, 0.35);
    transition: all var(--transition-smooth);
    /* UPDATED */
    cursor: pointer;
    white-space: nowrap;
    will-change: transform;
    /* UPDATED: Optimize paint */
}

.btn-icon-img {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-micro);
    /* UPDATED */
}

.btn-primary:hover {
    /* UPDATED: Elevated shadow on hover */
    box-shadow: 0 8px 28px rgba(216, 67, 21, 0.5);
    transform: translateY(-2px);
}

.btn-primary:hover .btn-icon-img {
    transform: rotate(15deg) scale(1.1);
}

/* ========= BOTTONE SECONDARIO ========= */
/* ========= BOTTONE SECONDARIO (CHI SIAMO) - Liquid Glass Style ========= */
.btn-secondary {
    color: var(--text-light);
    /* Changed to light for better contrast on glass */
    text-decoration: none;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 50px;
    transition: all var(--transition-smooth);

    /* Liquid Glass Effect (Matching Mobile Navbar) */
    background: rgba(30, 27, 24, 0.3);
    /* Slightly stronger base for visibility */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1.5px solid rgba(247, 242, 236, 0.15);
    /* Warm subtle border */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: var(--primary-green);
    color: var(--text-light);
    border-color: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 139, 87, 0.4);
}

/* ========= RESPONSIVE MOBILE ========= */
@media (max-width: 1024px) {
    .main-header {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .main-header {
        height: 112px;
        padding: 20px 0;
    }

    .main-header .container {
        grid-template-columns: auto 1fr auto;
        gap: 15px;
        align-items: center;
    }

    .main-header .logo {
        display: none;
    }

    .main-nav {
        display: none;
    }

    .hamburger-menu {
        display: block;
    }

    /* ORDINA ORA VISIBILE SU MOBILE */
    .btn-primary {
        display: inline-flex !important;
        padding: 10px 18px;
        font-size: 15px;
        gap: 8px;
    }

    .btn-icon-img {
        width: 20px;
        height: 20px;
    }

    .main-header.scrolled {
        height: 96px;
        padding: 16px 0;
    }
}

/* ========= ORDER MODAL ========= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-macro);
    /* UPDATED */
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--surface-dark);
    /* New warm taupe */
    padding: 40px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform var(--transition-smooth);
    /* UPDATED */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    transition: color var(--transition-micro);
    /* UPDATED */
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary-red);
}

.modal-content h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--text-light);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 16px;
}

.modal-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px 25px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    transition: all var(--transition-smooth);
    /* UPDATED */
    border: 2px solid transparent;
}

.btn-call {
    background-color: rgba(255, 255, 255, 0.05);
    /* Slightly transparent white on surface */
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-call:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-light);
    transform: translateY(-3px);
}

.btn-justeat {
    /* UPDATED: Gradient */
    background: linear-gradient(135deg, var(--primary-red), #FF5F5A);
    color: white;
    box-shadow: 0 5px 15px rgba(216, 67, 21, 0.3);
    /* UPDATED */
}

.btn-justeat:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(216, 67, 21, 0.5);
    /* UPDATED */
}

.modal-icon-img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}