/* ============================================================
   Category mega menu — sidebar + featured panel
   Toggled on via website setting `category_menu_style = mega`.
   ============================================================ */

.category-mega-menu-wrapper {
    position: static !important;
}

.category-mega-menu {
    width: min(960px, 96vw);
    padding: 0 !important;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    background: #fff;
    overflow: hidden;
    margin-top: 0 !important;
}

.category-mega-menu__inner {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 360px;
}

/* Sidebar */
.category-mega-menu__sidebar {
    background: #f7f7f8;
    border-right: 1px solid #eaeaea;
    margin: 0;
    padding: 8px 0;
    max-height: 480px;
    overflow-y: auto;
}

.category-mega-menu__sidebar-item {
    border-left: 3px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.category-mega-menu__sidebar-item:hover,
.category-mega-menu__sidebar-item.is-active {
    background: #fff;
    border-left-color: #ff5722;
}

.category-mega-menu__sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: #222;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.category-mega-menu__sidebar-link:hover {
    color: #ff5722;
    text-decoration: none;
}

.category-mega-menu__chevron {
    font-size: 12px;
    opacity: 0.6;
}

/* Right panel(s) */
.category-mega-menu__panels {
    position: relative;
    padding: 20px 24px;
    max-height: 480px;
    overflow-y: auto;
}

.category-mega-menu__panel {
    display: none;
}

.category-mega-menu__panel.is-active {
    display: block;
}

.category-mega-menu__banner {
    display: block;
    position: relative;
    margin: 0 0 16px;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: #eee;
    aspect-ratio: 16 / 5;
    max-height: 180px;
}

.category-mega-menu__banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-mega-menu__banner-label {
    position: absolute;
    left: 16px;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.category-mega-menu__children {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px 20px;
}

.category-mega-menu__child-title {
    display: block;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
    text-decoration: none;
    font-size: 14px;
}

.category-mega-menu__child-title:hover {
    color: #ff5722;
}

.category-mega-menu__grandchildren {
    margin: 0;
    padding: 0;
}

.category-mega-menu__grandchildren li a {
    display: block;
    padding: 3px 0;
    color: #555;
    font-size: 13px;
    text-decoration: none;
}

.category-mega-menu__grandchildren li a:hover {
    color: #ff5722;
}

/* RTL flip */
[dir="rtl"] .category-mega-menu__sidebar {
    border-right: 0;
    border-left: 1px solid #eaeaea;
}

[dir="rtl"] .category-mega-menu__sidebar-item {
    border-left: 0;
    border-right: 3px solid transparent;
}

[dir="rtl"] .category-mega-menu__sidebar-item:hover,
[dir="rtl"] .category-mega-menu__sidebar-item.is-active {
    border-right-color: #ff5722;
}

[dir="rtl"] .category-mega-menu__chevron {
    transform: rotate(180deg);
}

[dir="rtl"] .category-mega-menu__banner-label {
    left: auto;
    right: 16px;
}

/* Tablet — narrower sidebar */
@media (max-width: 1199.98px) {
    .category-mega-menu {
        width: min(800px, 96vw);
    }
    .category-mega-menu__inner {
        grid-template-columns: 200px 1fr;
    }
}

/* Hide on mobile — mobile uses the offcanvas accordion instead */
@media (max-width: 991.98px) {
    .category-mega-menu {
        display: none !important;
    }
}

/* ============================================================
   Mega menu mobile accordion (inside offcanvas)
   ============================================================ */

.category-mega-accordion .mega-accordion-header {
    cursor: pointer;
}

.category-mega-accordion .mega-accordion-thumb {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

[dir="rtl"] .category-mega-accordion .mega-accordion-thumb {
    margin-right: 0;
    margin-left: 8px;
}

.category-mega-accordion .mega-accordion-caret {
    transition: transform 0.2s ease;
    padding: 0 10px;
}

.category-mega-accordion .mega-accordion-header[aria-expanded="true"] .mega-accordion-caret {
    transform: rotate(180deg);
}

.category-mega-accordion .mega-accordion-children {
    padding-left: 20px;
}

[dir="rtl"] .category-mega-accordion .mega-accordion-children {
    padding-left: 0;
    padding-right: 20px;
}
