/* ============================================
   RESET & GLOBAL STYLES
   ============================================ */
.nav * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* ============================================
   NAVIGATION HEADER
   ============================================ */
.nav {
    background-color: #ffffff;
    position: relative;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    text-decoration: none;
}

/* ============================================
   HAMBURGER MENU (Mobile Only)
   ============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    background: none;
    border: none;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #000;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translateY(12px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-12px);
}

/* Hamburger icon styles */
.hamburger i,
.hamburger svg {
    font-size: 24px;
    color: inherit;
    transition: all 0.3s ease;
}

.hamburger .hamburger-custom-text {
    font-size: 24px;
    line-height: 1;
    transition: all 0.3s ease;
}

.hamburger.active i,
.hamburger.active svg,
.hamburger.active .hamburger-custom-text {
    transform: rotate(180deg);
}

/* ============================================
   MAIN MENU (Parent Level)
   ============================================ */
.menu {
    display: flex;
    list-style: none;
    gap: 0;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 23px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
    border-bottom: 3px solid transparent;
}

.menu-link:hover {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.menu-link.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

/* Arrow indicator for items with submenus */
/*.menu-link.has-submenu::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    margin-left: 8px;
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
}*/

/* ============================================
   MEGA MENU PANEL (Dropdown)
   ============================================ */
.mega-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    max-width: 90vw;
    height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #f0f0f0;
    box-shadow: none;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
}

.mega-menu.active {
    width: auto;
    min-width: 300px;
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    z-index: 10000;
}

/* Close button for mega menu - small black X, top right */
.mega-menu-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    font-size: 18px;
    color: #000;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 1001;
    background-color: transparent;
    margin: 0;
}

.mega-menu-close:hover {
    color: #333;
}

/* Close button icon styles */
.mega-menu-close i,
.mega-menu-close svg,
.sub-submenu-close i,
.sub-submenu-close svg {
    font-size: inherit;
    color: inherit;
    display: inline-block;
    line-height: 1;
}

.mega-menu-close svg,
.sub-submenu-close svg {
    width: 1em;
    height: 1em;
}

.mega-menu-content {
    padding: 24px 24px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ============================================
   SUBMENU CATEGORIES
   ============================================ */
.submenu-category {
    position: relative;
}

/* Main category header - larger, bold */
.submenu-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    text-transform: none;
    letter-spacing: 0;
    padding-bottom: 0;
    display: block;
}

.submenu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.submenu-item {
    position: relative;
    padding: 0;
    line-height: 1;
}

.submenu-link {
    font-size: 15px;
    font-weight: 400;
    color: #000;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.submenu-link:hover {
    color: #333;
}

/* Arrow for items with sub-submenu */
.submenu-link-has-arrow .submenu-arrow {
    font-size: 18px;
    color: #000;
    margin-left: 8px;
}

/* Icon styling for menu items */
.menu-icon {
    width: 20px;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #999;
    flex-shrink: 0;
}

/* ============================================
   SUB-SUBMENU (3rd Level)
   ============================================ */
.sub-submenu {
    position: fixed;
    left: 300px;
    top: 0;
    width: 0;
    min-width: 0;
    max-width: 90vw;
    height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #f0f0f0;
    box-shadow: none;
    overflow: hidden;
    transform: translateX(-20px);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s 0.35s;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
}

.sub-submenu.active {
    width: 300px;
    min-width: 300px;
    overflow-y: auto;
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s 0s;
    z-index: 10001;
}

.sub-submenu-content {
    padding: 24px 24px 30px;
    position: relative;
}

/* Close button for sub-submenu - small black X, top right */
.sub-submenu-close {
    position: absolute;
    top: 17px;
    right: 24px;
    background: none;
    border: none;
    font-size: 18px;
    color: #000;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 1001;
    background-color: transparent;
    margin: 0;
}

.sub-submenu-close:hover {
    color: #333;
}

.sub-submenu-back {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #000;
    cursor: pointer;
    margin-bottom: 24px;
    padding-top: 50px;
    transition: color 0.2s ease;
    display: none;
}

.sub-submenu-back:hover {
    color: #333;
}

/* Hide mega menu close button when sub-submenu is active (body class and wrap class for reliability) */
body.submenu-open .mega-menu-close,
.mega-menu-widget-wrap.has-sub-submenu-open .mega-menu-close {
    display: none !important;
}

/* ============================================
   MENU OVERLAY
   ============================================ */
.mega-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
    pointer-events: none;
    z-index:9;
}

.mega-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* ============================================
   RESPONSIVE DESIGN - DESKTOP
   ============================================ */
/* Menu close button - hidden on desktop, shown on mobile */
.menu-mobile-close-wrap {
    display: none;
}

/* Mobile styles are applied via JS + .mega-menu-mobile-view class (breakpoint from widget settings) */

/* ============================================
   ACCESSIBILITY
   ============================================ */
.menu-link:focus,
.submenu-link:focus,
.hamburger:focus {
    outline: none;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .hamburger,
    .mega-menu,
    .sub-submenu {
        display: none !important;
    }

    .menu {
        display: flex !important;
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* ============================================
   SCROLLBAR STYLING (for mega menus)
   ============================================ */
.mega-menu::-webkit-scrollbar,
.sub-submenu::-webkit-scrollbar {
    width: 8px;
}

.mega-menu::-webkit-scrollbar-track,
.sub-submenu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mega-menu::-webkit-scrollbar-thumb,
.sub-submenu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.mega-menu::-webkit-scrollbar-thumb:hover,
.sub-submenu::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   RTL SUPPORT
   ============================================ */
[dir="rtl"] .mega-menu {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid #e0e0e0;
    transform: translateX(100%);
}

[dir="rtl"] .mega-menu.active {
    transform: translateX(0);
}

[dir="rtl"] .sub-submenu {
    left: auto;
    right: 350px;
    border-right: none;
    border-left: 1px solid #e0e0e0;
    transform: translateX(-20px);
}

[dir="rtl"] .sub-submenu.active {
    transform: translateX(0);
}

/* ============================================
   ANIMATION UTILITIES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.mega-menu.active .mega-menu-content {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   BRANDS MEGA MENU - ALPHABET FILTER
   ============================================ */
.mega-menu-brands .mega-menu-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    grid-template-columns: none;
}

.brands-mega-content {
    width: 100%;
    padding: 0;
}

.brands-mega-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin-bottom: 24px;
    text-transform: none;
}

.brands-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
    padding-left: 0;
}

.brands-nav-links .brands-nav-link {
    font-size: 15px;
    font-weight: 400;
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.brands-nav-links .brands-nav-link:hover {
    color: #333;
}

.brands-nav-chevron {
    font-size: 18px;
    color: #000;
}

.brands-nav-featured-wrap {
    display: block;
}

.alphabet-filter {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px 20px;
}

.alphabet-filter-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    color: #000000;
    text-decoration: none;
    transition: color 0.2s ease;
}

.alphabet-filter-link:hover {
    color: #0066cc;
}
