/* ============================================================
   RESPONSIVE BURGER MENU - FLUID DESIGN WITH CLAMP()
   Modern approach without complex media queries
   ============================================================ */

/* Hide burger menu on desktop screens */
@media screen and (min-width: 769px) {
  .burgermenu_navbar,
  .burgermenu_nav-container,
  .burgermenu_nav-container .checkbox,
  .burgermenu_nav-container .hamburger-lines,
  .burgermenu_navbar .burgermenu_menu-items {
    display: none !important;
  }
}

/* Show burger menu on mobile, hide desktop menu */
@media screen and (max-width: 768px) {
  .header-wrapper {
    display: none;
  }

  .burgermenu_navbar {
    display: block !important;
  }

  .burgermenu_nav-container {
    display: flex !important;
  }

  .burgermenu_nav-container .checkbox,
  .burgermenu_nav-container .hamburger-lines {
    display: block !important;
  }
}

/* Assicura che il menu desktop sia visibile su schermi grandi */
@media screen and (min-width: 769px) {
  .header-wrapper {
    display: block;
  }
  .nav-menu {
    display: flex !important;
  }
}

/* ============================================================
   MOBILE BURGER MENU - FLUID RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 768px) {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .main-container {
    flex-direction: column;
    width: 100%;
    padding-left: 0;
    /*padding-top: 2rem;*/
  }

  /* HEADER AND FOOTER */
  .header-bar {
    display: none;
  }

  .header-menu-icons {
    background-color: var(--secondary-color-darkgray);
    margin-left: 12rem;
  }

  .nav-menu {
    display: none;
  }

  .footer {
    flex-direction: column;
    justify-content: space-between;
  }

  .footer ul {
    flex-direction: row;
  }

  .footer-box-logo-claim,
  .footer-box-copy {
    margin-top: 2rem;
    margin-bottom: 2rem;
    margin-left: 2rem;
  }

  .footer-box-copy {
    margin-right: 0;
  }

  .footer-social-menu {
    display: flex;
    align-items: center;
    margin: 0;
  }
  /* END HEADER AND FOOTER */

  /* TOP MENU 
  .top-bar {
    flex-direction: column;
    align-items: center;
  }

  .menu ul {
    flex-direction: column;
    align-items: center;
  }

  .menu ul li {
    padding: 0.5rem 0;
  }

  .header-icons a {
    font-size: 0.8rem;
  }

  .header-icons img {
    width: 24px;
    height: 24px;
  }

  .small-profile {
    width: 28px;
    height: 28px;
  }

  .banner-section {
    padding: 0;
  }

  .banner-img {
    height: 150px;
  }*/
  /* END TOP MENU */

  /* ============================================================
     BURGER MENU - FLUID RESPONSIVE WITH CLAMP()
     ============================================================ */
  .header-burger-menu-icon {
    display: inline;
    color: var(--secondary-color-darkgray);
  }

  .header-burger-menu-icon a {
    text-decoration: none;
  }

  .burgermenu_navbar {
    display: inline;
    width: 100%;
    box-shadow: 0 1px 4px rgb(146 161 176 / 15%);
  }

  .burgermenu_container {
    max-width: 1050px;
    width: clamp(90%, 95vw, 100%);
    margin: auto;
    z-index: 1000; /* Higher z-index for proper stacking */
  }

  /* Navigation Container - Fluid responsive */
  .burgermenu_nav-container {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    height: clamp(60px, 10vh, 75px);
    width: 100%;
    max-width: 100%;
    padding: 0 clamp(0.75rem, 3vw, 1.5rem);
    position: relative;
  }

  /* Logo - Centered with fluid sizing */
  .burgermenu_nav-container .logo {
    max-width: clamp(100px, 25vw, 140px);
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
  }

  .burgermenu_nav-container .logo img {
    max-width: 100%;
    height: auto;
  }

  /* Checkbox (invisible clickable area) - Moved to left */
  .burgermenu_nav-container .checkbox {
    position: absolute;
    display: block;
    height: clamp(36px, 8vw, 42px);
    width: clamp(36px, 8vw, 42px);
    top: 50%;
    left: clamp(0.75rem, 3vw, 1.5rem);
    transform: translateY(-50%);
    z-index: 10001; /* Higher than menu to allow closing */
    opacity: 0;
    cursor: pointer;
  }

  /* Hamburger lines - Moved to left */
  .burgermenu_nav-container .hamburger-lines {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(6px, 1.5vw, 8px); /* Add explicit gap between lines */
    height: auto; /* Let height be determined by content + gap */
    width: clamp(28px, 6vw, 34px);
    position: absolute;
    top: 50%;
    left: clamp(0.75rem, 3vw, 1.5rem);
    transform: translateY(-50%);
    z-index: 10000; /* Below checkbox, above menu items */
  }

  .burgermenu_nav-container .hamburger-lines .line {
    display: block;
    height: clamp(4px, 0.7vw, 4px); /* Slightly thicker lines */
    width: 100%;
    border-radius: 10px;
    background: #0e2431;
    transition: transform 0.4s ease-in-out;
    margin: 0; /* Remove any default margin */
    margin-bottom: 5px;
  }

  .burgermenu_nav-container .hamburger-lines .line1 {
    transform-origin: 0% 0%;
  }

  .burgermenu_nav-container .hamburger-lines .line2 {
    transition: transform 0.2s ease-in-out;
  }

  .burgermenu_nav-container .hamburger-lines .line3 {
    transform-origin: 0% 100%;
  }

  /* Menu Items - Fluid overlay */
  .burgermenu_navbar .burgermenu_menu-items {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding-top: clamp(100px, 20vh, 300px);
    padding-bottom: 0;
    background-color: rgba(231, 28, 91, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    padding-left: 0;
    transform: translate(-150%);
    transition: transform 0.5s ease-in-out;
    text-align: center;
    z-index: 9999; /* High z-index to appear above all content */
    overflow-y: auto;
  }

  .burgermenu_navbar .burgermenu_menu-items li {
    margin-bottom: clamp(1rem, 3vh, 1.5rem);
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 500;
    list-style: none;
  }

  .burgermenu_navbar .burgermenu_nav-container a {
    text-decoration: none;
    color: var(--white);
    font-weight: 500;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    padding: clamp(0.5rem, 2vw, 0.7rem);
  }

  .burgermenu_navbar .burgermenu_nav-container a:hover {
    font-weight: bolder;
  }

  /* Menu open state */
  .burgermenu_nav-container input[type="checkbox"]:checked ~ .burgermenu_menu-items {
    transform: translateX(0);
  }

  .burgermenu_nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line1 {
    transform: rotate(45deg);
  }

  .burgermenu_nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line2 {
    transform: scaleY(0);
  }

  .burgermenu_nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line3 {
    transform: rotate(-45deg);
  }

  .burgermenu_nav-container input[type="checkbox"]:checked ~ .logo {
    display: none;
  }

  .burgermenu_nav-container input[type="checkbox"]:checked ~ .mobile-header-icons {
    display: none;
  }

  /* Mobile Header Icons - Right side */
  .mobile-header-icons {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 0.75rem);
    position: relative;
    z-index: 999;
    margin-left: auto; /* Allinea a destra */
  }

  .mobile-header-icon {
    position: relative;
    color: #0e2431; /* Stesso colore del burger menu */
    font-size: clamp(1.2rem, 4.5vw, 1.4rem);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(32px, 7vw, 38px);
    height: clamp(32px, 7vw, 38px);
    color: var(--text-dark) !important;
  }

  .mobile-header-icon:active {
    opacity: 0.7;
  }

  .unread-badge-mobile {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 50%;
    min-width: 16px;
    text-align: center;
    border: 2px solid white;
  }

  /* Mobile Sub-Menu - 4 icons */
  .mobile-sub-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: white;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: clamp(0.5rem, 2vw, 0.75rem) 0;
    position: sticky;
    top: 0;
    z-index: 998; /* Below burger menu overlay */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .mobile-sub-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.25rem, 1vw, 0.5rem);
    text-decoration: none;
    color: var(--gray-600);
    transition: all 0.2s ease;
    padding: clamp(0.25rem, 1vw, 0.5rem);
    min-width: 60px;
  }

  .mobile-sub-menu-item i {
    font-size: clamp(1.2rem, 4.5vw, 1.5rem);
    color: var(--pink-primary);
  }

  .mobile-sub-menu-item span {
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    font-weight: 500;
    color: var(--gray-700);
  }

  .mobile-sub-menu-item:hover,
  .mobile-sub-menu-item:active {
    background: rgba(231, 28, 91, 0.05);
    border-radius: 8px;
  }

  .mobile-sub-menu-profile-img {
    width: clamp(28px, 6vw, 34px);
    height: clamp(28px, 6vw, 34px);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--pink-primary);
  }

  /* END BURGER MENU */
}

/* Hide mobile sub-menu on desktop */
@media screen and (min-width: 769px) {
  .mobile-sub-menu {
    display: none !important;
  }
}
