/* ===== HAMBURGER MENU STYLES ===== */

/* Hide hamburger button on desktop */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    z-index: 10000;
    position: relative;
}

/* Hamburger icon styles */
.hamburger-icon {
    width: 25px;
    height: 3px;
    background-color: #333;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    top: 8px;
}

/* Animated hamburger when active */
.hamburger-btn.active .hamburger-icon {
    background-color: transparent;
}

.hamburger-btn.active .hamburger-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.hamburger-btn.active .hamburger-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Mobile navigation menu */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 9999;
    padding-top: 80px;
}

.mobile-nav.active {
    right: 0 !important;
    display: block !important;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav ul li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav ul li a {
    display: block;
    padding: 20px 30px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    transition: background-color 0.3s ease;
}

.mobile-nav ul li a:hover {
    background-color: #FF595A;
    color: white;
}

/* Close button in mobile menu */
.mobile-nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    padding: 10px;
}

/* ===== RESPONSIVE STYLES ===== */

/* Show hamburger menu on tablets and mobile */
@media (max-width: 1024px) {
    .hamburger-btn {
        display: block;
    }
    
    /* Hide desktop navigation on mobile */
    .navbar nav {
        display: none !important;
    }
    
    .mobile-nav {
        display: block !important;
    }
    
    /* Adjust nav container for hamburger button */
    .nav-container {
        justify-content: space-between !important;
    }
    
    /* Add logo space if needed */
    .nav-container .logo {
        flex: 1;
    }
}

/* Ensure proper stacking context */
@media (max-width: 1024px) {
    .navbar {
        position: relative;
        z-index: 10001;
    }
}

/* ===== LOGO STYLES FOR MOBILE ===== */
@media (max-width: 1024px) {
    .nav-container .logo {
        background-image: url('../Pagury_logo_icon.svg');
        background-repeat: no-repeat;
        background-position: center left;
        background-size: contain;
        width: 40px;
        height: 40px;
        margin-left: 20px;
    }
}

/* ===== INDEX.HTML SPECIFIC FIXES ===== */
/* Override conflicting styles from style.css only for index.html */
@media (max-width: 1024px) {
    /* Fix header conflicts */
    header {
        flex-direction: row !important;
        align-items: center !important;
        padding: 10px 20px !important;
    }
    
    /* Ensure nav container works properly */
    .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    /* Override any button width conflicts */
    .hamburger-btn {
        width: auto !important;
        flex-shrink: 0 !important;
    }
    
    /* Fix hero section z-index conflicts on index.html */
    .hero {
        position: relative !important;
        z-index: 1 !important;
    }
    
    .hero-right {
        z-index: 2 !important;
    }
    
    /* Ensure video doesn't interfere */
    .hero-right video {
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* CRITICAL: Fix mobile menu layout conflicts with style.css */
    .mobile-nav ul {
        display: block !important;
        flex-direction: column !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .mobile-nav ul li {
        display: block !important;
        width: 100% !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .mobile-nav ul li a {
        display: block !important;
        padding: 20px 30px !important;
        color: #333 !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        font-size: 18px !important;
        transition: background-color 0.3s ease !important;
    }
}

/* ===== EXTRA SMALL DEVICES FIXES (360px and below) ===== */
@media (max-width: 360px) {
    /* Override the conflicting styles from style.css for small screens */
    header {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding: 5px 10px !important;
        background: white !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10001 !important;
    }
    
    .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .navbar {
        background: white !important;
        padding: 10px 0 !important;
    }
    
    /* Ensure hamburger button is properly sized */
    .hamburger-btn {
        display: block !important;
        width: auto !important;
        padding: 8px !important;
    }
    
    .hamburger-icon {
        width: 20px !important;
        height: 2px !important;
    }
    
    .hamburger-icon::before,
    .hamburger-icon::after {
        width: 20px !important;
        height: 2px !important;
    }
    
    /* CRITICAL: Override navbar ul flex from style.css */
    .mobile-nav ul {
        display: block !important;
        flex-direction: column !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .mobile-nav ul li {
        display: block !important;
        width: 100% !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
}

/* ===== CONTATTI PAGE SPECIFIC FIXES ===== */
/* Override conflicting styles from contatti.css */
@media (max-width: 1024px) {
    /* Fix nav container layout for contatti page */
    .nav-container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0 !important;
    }
    
    /* Ensure nav ul doesn't interfere */
    nav ul {
        flex-direction: row !important;
        gap: 0 !important;
        align-items: center !important;
        display: none !important; /* Hide on mobile as intended */
    }
    
    /* Add logo styling for contatti page */
    .nav-container .logo {
        background-image: url('../Pagury_logo_icon.svg') !important;
        background-repeat: no-repeat !important;
        background-position: center left !important;
        background-size: contain !important;
        width: 40px !important;
        height: 40px !important;
        margin-left: 20px !important;
        flex-shrink: 0 !important;
    }
    
    /* Ensure hamburger button is positioned correctly */
    .hamburger-btn {
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }
}

/* ===== CONTATTI PAGE - SMALLER SCREENS ===== */
@media (max-width: 768px) {
    /* Override the problematic flex-direction: column from contatti.css */
    .nav-container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0 !important;
    }
    
    /* Keep logo visible on all screen sizes */
    .nav-container .logo {
        display: block !important;
        background-image: url('../Pagury_logo_icon.svg') !important;
        background-repeat: no-repeat !important;
        background-position: center left !important;
        background-size: contain !important;
        width: 35px !important;
        height: 35px !important;
        margin-left: 15px !important;
        flex-shrink: 0 !important;
    }
    
    /* Ensure hamburger stays on the right */
    .hamburger-btn {
        display: block !important;
        margin-left: auto !important;
        margin-right: 15px !important;
    }
}
