/**
 * JBSkin Mega Menu Styles
 * Desktop: Hover-based mega menu (1920px container, 1320px content)
 * Mobile: Click-based navigation with slide animation
 */

/* ============================================
   DESKTOP MEGA MENU
   ============================================ */

.jbskin-mega-menu-desktop {
    width: 100%;
    background: #fff;
}

.mega-menu-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
}

/* Single Dropdown with 3 Horizontal Columns */
.mega-menu-dropdown {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dropdown-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    min-height: 450px;
}

/* Each Column */
.column {
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    max-height: 600px;
}

.column:last-child {
    border-right: none;
}

/* Column-specific styling */
.column-parents {
    background: #f8f9fa;
}

.column-children,
.column-subchildren {
    background: #fff;
}

/* Hide groups by default (JS controls visibility) */
.children-group {
    display: none;
}

.children-group.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.subchildren-group {
    display: none;
}

.subchildren-group.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Category Items */
.category-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px;
    margin-bottom: 4px;
}

.category-item:hover {
    background-color: #f5f5f5;
}

.category-item.active {
    background-color: #e3f2fd;
}

.category-item a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    flex: 1;
    display: block;
}

.category-item a:hover {
    color: #007bff;
}

.category-item .has-children {
    color: #999;
    font-size: 18px;
    margin-left: 8px;
    font-weight: 300;
}

/* Different styles for hierarchy levels */
.parent-item a {
    font-weight: 500;
    font-size: 15px;
}

.child-item a {
    font-size: 14px;
}

.subchild-item a {
    font-size: 13px;
    color: #666;
}

/* Special Items */
.mega-menu-item.special-item .parent-category {
    color: #d9534f;
    font-weight: 700;
}

.mega-menu-item.special-item .parent-category:hover {
    color: #c9302c;
}

/* ============================================
   MOBILE MEGA MENU
   ============================================ */

.jbskin-mega-menu-mobile {
    display: none;
    width: 100%;
    background: #fff;
}

.mobile-menu-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.mobile-back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    font-weight: 600;
}

.mobile-back-button .back-arrow {
    font-size: 20px;
}

.mobile-menu-content {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.mobile-column {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    background: #fff;
    transition: left 0.3s ease;
    padding: 10px 0;
}

.mobile-column.active {
    left: 0;
}

.mobile-column.slide-left {
    left: -100%;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-item .mobile-category-link {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 15px;
}

.mobile-menu-item strong {
    font-weight: 600;
}

.mobile-arrow {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}

/* Special Items Mobile */
.mobile-menu-item.special-item .mobile-category-link {
    color: #d9534f;
    font-weight: 700;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 768px) {
    /* Hide desktop menu */
    .jbskin-mega-menu-desktop {
        display: none;
    }
    
    /* Show mobile menu */
    .jbskin-mega-menu-mobile {
        display: block;
    }
}

@media (min-width: 769px) {
    /* Ensure mobile menu is hidden on desktop */
    .jbskin-mega-menu-mobile {
        display: none !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.mega-menu-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.mega-menu-error {
    text-align: center;
    padding: 20px;
    color: #d9534f;
}
