/**
 * Mega Menu Styles
 * Purpose: Category mega menu dropdown styling
 *
 * Architecture:
 * - Two-column layout (parents | children)
 * - Smooth fade/slide animations
 * - Custom scrollbar styling
 * - Mobile responsive
 *
 * WHY extracted: Eliminates duplicate CSS, improves maintainability
 */

/* ========================================
   MEGA MENU CONTAINER
   ======================================== */

#categoryMegaMenu {
    min-width: 750px;
    max-width: 100%;
    height: 300px;
    overflow: hidden;
    /* WHY fixed height: Consistent dropdown size, prevents layout shifts */
}

/* ========================================
   PARENT CATEGORIES COLUMN (Right Side)
   ======================================== */

.category-parents {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    direction: ltr;
    /* WHY direction ltr: Makes scrollbar appear on right side in RTL layout */
}

.category-parent-item {
    color: #1f7373;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.category-parent-item:hover {
    background-color: #f5f5f5;
}

.category-parent-item.active {
    background-color: #1f7373;
    color: #ffffff;
    font-weight: 600;
}

/* ========================================
   CHILDREN CATEGORIES COLUMN (Left Side)
   ======================================== */

.category-children {
    height: 100%;
    overflow-y: auto;
    padding: 0.5rem;
}

.category-children .row {
    display: flex;
    flex-wrap: wrap;
}

.category-children .col-child {
    width: 50%;
    padding: 0.25rem 0.5rem;
    text-align: right;
    /* WHY 50% width: Two-column layout for better space utilization */
}

.category-children .child-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 14px;
}

.category-children .child-link:hover {
    background-color: #e9ecef;
    color: #1f7373;
}

/* ========================================
   ANIMATIONS
   WHY: Visual feedback when switching categories
   ======================================== */

.fade-slide {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.25s ease;
}

.fade-slide.active {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   CUSTOM SCROLLBAR
   WHY: Better visual integration with theme
   ======================================== */

.category-parents::-webkit-scrollbar,
.category-children::-webkit-scrollbar {
    width: 6px;
}

.category-parents::-webkit-scrollbar-thumb,
.category-children::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.category-parents::-webkit-scrollbar-thumb:hover,
.category-children::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Firefox scrollbar */
.category-parents,
.category-children {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    #categoryMegaMenu {
        min-width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 500px;
    }

    .category-parents,
    .category-children {
        max-height: 200px;
    }

    .category-children .col-child {
        width: 100%;
        /* WHY: Single column on mobile for better readability */
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.category-parent-item:focus,
.category-children .child-link:focus {
    outline: 2px solid #1f7373;
    outline-offset: -2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .fade-slide,
    .category-parent-item,
    .category-children .child-link {
        transition: none;
    }
}
