/* ==========================================
   IMPROVED MOBILE RESPONSIVE NAVBAR
   ========================================== */

/* Tablet and below */
@media screen and (max-width: 1024px) {
  .navbar {
    padding: 15px 20px;
  }

  .menu {
    font-size: 14px;
  }

  .menu-item {
    padding: 0 15px;
  }
}

/* Mobile devices */
@media screen and (max-width: 768px) {
  
  /* Show hamburger menu */
  .hamburger-menu {
    display: block !important;
    font-size: 26px;
    color: #2B1400;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
    transition: transform 0.3s ease;
  }

  .hamburger-menu:hover {
    transform: scale(1.1);
  }

  .hamburger-menu.active i {
    transform: rotate(90deg);
  }

  /* Hide main navigation by default */
  .menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: linear-gradient(180deg, #2B1400 0%, #1a0a00 100%);
    flex-direction: column;
    padding: 80px 0 20px 0;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1000;
  }

  /* Show menu when active */
  .menu.active {
    right: 0;
  }

  /* Menu items */
  .menu-item {
    width: 100%;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
  }

  .menu-item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 25px;
    color: #F4DE8A;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
  }

  .menu-item > a:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #D4AF37;
    padding-left: 30px;
  }

  /* Add arrow indicator for dropdowns */
  .menu-item:has(.dropdown) > a::after {
    content: '\f107'; /* FontAwesome down arrow */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
    transition: transform 0.3s ease;
    color: #D4AF37;
  }

  .menu-item.active > a::after {
    transform: rotate(180deg);
  }

  /* Dropdown styling */
  .menu-item .dropdown {
    position: static;
    display: none;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  .menu-item.active .dropdown {
    display: block;
    max-height: 500px;
  }

  .dropdown a {
    display: block;
    padding: 14px 35px;
    color: #E7C97A;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
  }

  .dropdown a:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #D4AF37;
    padding-left: 40px;
  }

  /* Sub-dropdown */
  .sub-item {
    position: relative;
  }

  .sub-item.has-submenu > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sub-item.has-submenu > a::after {
    content: '\f105'; /* FontAwesome right arrow */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #D4AF37;
  }

  .sub-item.active > a::after {
    transform: rotate(90deg);
  }

  .sub-dropdown {
    position: static;
    display: none;
    background: rgba(0, 0, 0, 0.3);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  .sub-item.active .sub-dropdown {
    display: block;
    max-height: 400px;
  }

  .sub-dropdown a {
    padding: 12px 45px;
    font-size: 13px;
    color: #E7C97A;
  }

  .sub-dropdown a:hover {
    background: rgba(212, 175, 55, 0.1);
    padding-left: 50px;
  }

  /* Cart link styling */
  .menu-item:not(:has(.dropdown)) a {
    color: #F4DE8A;
  }

  /* Account dropdown adjustments */
  .account-dropdown {
    width: 100%;
    padding: 20px 25px;
    border-top: 2px solid rgba(212, 175, 55, 0.3);
    margin-top: 10px;
  }

  .account-button,
  .account-button-logged {
    width: 100%;
    justify-content: center;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid #D4AF37;
    border-radius: 8px;
    padding: 12px 16px;
    color: #F4DE8A;
    transition: all 0.3s ease;
  }

  .account-button:hover,
  .account-button-logged:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
  }

  .dropdown-menu,
  .dropdown-menu-logged {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    z-index: 1002;
  }

  /* Navbar logo adjustments */
  .only-logo {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .logo {
    font-size: 18px;
  }

  .logo img {
    max-height: 35px;
  }

  /* Close button for mobile menu */
  .menu::before {
    content: '\f00d'; /* FontAwesome X */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #D4AF37;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
  }

  .menu::before:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: rotate(90deg);
  }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
  .navbar {
    padding: 12px 15px;
  }

  .hamburger-menu {
    font-size: 24px;
  }

  .menu {
    width: 90%;
  }

  .logo {
    font-size: 16px;
  }

  .logo img {
    max-height: 30px;
  }

  .menu-item > a {
    font-size: 15px;
    padding: 16px 20px;
  }

  .dropdown a {
    font-size: 13px;
    padding: 12px 30px;
  }

  .sub-dropdown a {
    font-size: 12px;
    padding: 10px 40px;
  }
}

/* Overlay for mobile menu */
@media screen and (max-width: 768px) {
  body.menu-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(2px);
  }
}

/* Desktop - hide hamburger */
@media screen and (min-width: 769px) {
  .hamburger-menu {
    display: none;
  }
  
  .menu {
    display: flex !important;
  }
}

/* Smooth scrollbar for mobile menu */
@media screen and (max-width: 768px) {
  .menu::-webkit-scrollbar {
    width: 6px;
  }

  .menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
  }

  .menu::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 10px;
  }

  .menu::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
  }
}