/* ============================================
   HORIZONTAL CATEGORY NAVIGATION - TRENDYOL STYLE
   ============================================ */

/* Fix banner width to match other sections - Override old sidebar layout CSS */
.__top-slider-images {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

.horizontal-category-section {
    position: relative;
    z-index: 99;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.horizontal-category-nav {
    position: static;
    padding: 0;
}

.horizontal-category-nav .container {
    position: static;
}

.horizontal-category-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.horizontal-category-item {
    position: relative;
    margin: 0;
    padding: 0;
}

.horizontal-category-item .category-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.horizontal-category-item .category-link:hover {
    color: #f58300;
    border-bottom-color: #f58300;
    background-color: #f8fafc;
}

.horizontal-category-item .category-link i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.horizontal-category-item.has-dropdown:hover .category-link i {
    transform: rotate(180deg);
}

/* View All Categories Item */
.horizontal-category-item.view-all-item {
    margin-left: auto;
}

.horizontal-category-item.view-all-item .category-link {
    color: #f58300;
    font-weight: 600;
}

.horizontal-category-item.view-all-item .category-link:hover {
    color: #d97000;
}

/* ============================================
   MEGA MENU DROPDOWN
   ============================================ */

.horizontal-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 98;
    border-top: 3px solid #f58300;
    display: none;
}

.horizontal-mega-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block;
}

.mega-menu-content {
    padding: 2rem 1.5rem;
}

.mega-menu-column {
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.mega-menu-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1e293b;
    border-bottom: 2px solid #f58300;
    padding-bottom: 0.5rem;
}

.mega-menu-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mega-menu-title a:hover {
    color: #f58300;
}

.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-list li {
    margin-bottom: 0.5rem;
}

.mega-menu-list li a {
    color: #64748b;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
    padding-left: 0;
}

.mega-menu-list li a:hover {
    color: #f58300;
    padding-left: 8px;
}

.mega-menu-list li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background-color: #f58300;
    transition: width 0.2s ease;
}

.mega-menu-list li a:hover::before {
    width: 4px;
}

/* ============================================
   RTL SUPPORT
   ============================================ */

.rtl .horizontal-category-menu {
    flex-direction: row-reverse;
}

.rtl .horizontal-category-item.view-all-item {
    margin-left: 0;
    margin-right: auto;
}

.rtl .mega-menu-list li a {
    padding-left: 0;
    padding-right: 0;
}

.rtl .mega-menu-list li a:hover {
    padding-left: 0;
    padding-right: 8px;
}

.rtl .mega-menu-list li a::before {
    left: auto;
    right: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 991px) {
    .horizontal-category-menu {
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 #f1f5f9;
    }

    .horizontal-category-menu::-webkit-scrollbar {
        height: 4px;
    }

    .horizontal-category-menu::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    .horizontal-category-menu::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .horizontal-category-item .category-link {
        padding: 0.875rem 1rem;
        font-size: 13px;
    }

    .horizontal-mega-menu {
        min-width: 600px;
        max-width: 800px;
    }

    .mega-menu-content {
        padding: 1.5rem 1rem;
    }

    .mega-menu-column {
        padding: 0 0.5rem;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .horizontal-category-section {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .horizontal-category-item .category-link {
        padding: 0.75rem 0.875rem;
        font-size: 12px;
    }

    .horizontal-mega-menu {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        min-width: 100%;
        max-width: 100%;
        border-radius: 0;
        max-height: 70vh;
        overflow-y: auto;
    }

    .mega-menu-content {
        padding: 1rem 0.75rem;
    }

    .mega-menu-column {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }

    .mega-menu-title {
        font-size: 14px;
        margin-bottom: 0.5rem;
        padding-bottom: 0.375rem;
    }

    .mega-menu-list li {
        margin-bottom: 0.375rem;
    }

    .mega-menu-list li a {
        font-size: 13px;
    }

    /* Hide view all on very small screens */
    .horizontal-category-item.view-all-item {
        display: none;
    }
}

/* Small mobile */
@media (max-width: 576px) {
    .horizontal-category-item .category-link {
        padding: 0.625rem 0.75rem;
        font-size: 11px;
    }

    .mega-menu-column {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ============================================
   STICKY NAVIGATION (OPTIONAL)
   ============================================ */

.horizontal-category-section.sticky {
    position: sticky;
    top: 0;
    z-index: 999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

.horizontal-category-menu.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.horizontal-category-item .category-link:focus {
    outline: 2px solid #f58300;
    outline-offset: 2px;
}

.mega-menu-list li a:focus {
    outline: 1px solid #f58300;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .horizontal-category-item .category-link {
        border: 1px solid currentColor;
    }

    .horizontal-mega-menu {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .horizontal-category-item .category-link,
    .horizontal-mega-menu,
    .mega-menu-list li a {
        transition: none;
    }

    .horizontal-category-item.has-dropdown:hover .category-link i {
        transform: none;
    }
}
