/**
 * WooCommerce Categories Mega Menu Widget CSS
 * Features:
 * - Category icon positioned above category name (clean, no border, no background, no shadow on hover)
 * - Interactive 3-Column Cascading Drilldown (Col 1: Level 1 -> Col 2: Level 2 -> Col 3: Level 3)
 * - Clean left overview banner
 * - Modern smooth transitions and custom scrollbars
 * - Mobile offcanvas drawer
 */

/* ==========================================================================
   1. MAIN WRAPPER & CONTAINER
   ========================================================================== */
.mct-wmm-wrap {
    position: relative !important;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    box-sizing: border-box;
    font-family: inherit;
    z-index: 990 !important;
}

.mct-wmm-container {
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

/* ==========================================================================
   2. TOP NAVIGATION BAR (Icons above category name - Clean, no border/bg/shadow)
   ========================================================================== */
.mct-wmm-navbar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 12px 0 14px 0;
    margin: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
}

.mct-wmm-navbar::-webkit-scrollbar {
    display: none;
}

.mct-wmm-nav-li {
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.mct-wmm-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    text-decoration: none !important;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

/* Icon Wrapper above category title - Clean look */
.mct-wmm-nav-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.mct-wmm-nav-icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.mct-wmm-nav-icon svg {
    width: 26px;
    height: 26px;
    transition: transform 0.25s ease;
}

/* Category Title below icon */
.mct-wmm-nav-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    line-height: 1.25;
    transition: color 0.2s ease;
    text-align: center;
}

/* Navbar Hover & Active States: No border, No background, No shadow */
.mct-wmm-nav-item:hover,
.mct-wmm-nav-item.is-active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.mct-wmm-nav-item:hover .mct-wmm-nav-icon,
.mct-wmm-nav-item.is-active .mct-wmm-nav-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #dc2626;
    transform: translateY(-3px);
}

.mct-wmm-nav-item:hover .mct-wmm-nav-icon img,
.mct-wmm-nav-item.is-active .mct-wmm-nav-icon img,
.mct-wmm-nav-item:hover .mct-wmm-nav-icon svg,
.mct-wmm-nav-item.is-active .mct-wmm-nav-icon svg {
    transform: scale(1.1);
}

.mct-wmm-nav-item:hover .mct-wmm-nav-title,
.mct-wmm-nav-item.is-active .mct-wmm-nav-title {
    color: #dc2626;
    font-weight: 700;
}

/* ==========================================================================
   3. MEGA DROPDOWN CONTAINER & BOX
   ========================================================================== */
.mct-wmm-dropdown-container {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 999999 !important;
    pointer-events: none;
}

.mct-wmm-mega-box {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: stretch;
    width: 100%;
    max-height: 480px;
    min-height: 480px;
    background: #ffffff;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.05);
    border: 1px solid #f1f5f9;
    border-top: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
    pointer-events: auto;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 999999 !important;
}

.mct-wmm-mega-box.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   4. LEFT OVERVIEW BANNER
   ========================================================================== */
.mct-wmm-left-banner {
    width: 250px;
    min-width: 230px;
    background: linear-gradient(180deg, #fef2f2 0%, #fff5f5 100%);
    border-right: 1px solid #fee2e2;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    box-sizing: border-box;
    flex-shrink: 0;
    align-self: stretch;
    height: auto;
    border-bottom-left-radius: 20px;
}

.mct-wmm-banner-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #dc2626;
    background-color: rgba(220, 38, 38, 0.1);
    padding: 3px 9px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.mct-wmm-banner-title {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 800;
    color: #dc2626;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.mct-wmm-banner-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
}

.mct-wmm-banner-media {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.mct-wmm-banner-img {
    max-width: 130px;
    max-height: 130px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(220, 38, 38, 0.15));
}

.mct-wmm-banner-svg-wrap {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.1);
}

/* When left banner is disabled */
.mct-wmm-mega-box.no-banner .mct-wmm-3col-drilldown {
    width: 100%;
}

/* ==========================================================================
   5. 3-COLUMN CASCADING DRILLDOWN (Headers removed)
   ========================================================================== */
.mct-wmm-3col-drilldown {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1.1fr;
    align-items: stretch;
    min-height: 460px;
    max-height: 460px;
    box-sizing: border-box;
    overflow: hidden;
}

.mct-wmm-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border-right: 1px solid #f1f5f9;
    box-sizing: border-box;
    background: #ffffff;
}

.mct-wmm-col:last-child {
    border-right: none;
    background: #fbfcfd;
}

/* Column Scrollable Content Area */
.mct-wmm-col-scroll {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px 18px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
    box-sizing: border-box;
}

.mct-wmm-col-scroll::-webkit-scrollbar {
    width: 6px;
}

.mct-wmm-col-scroll::-webkit-scrollbar-track {
    background: #f8fafc;
}

.mct-wmm-col-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}

.mct-wmm-col-scroll::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

/* Item List */
.mct-wmm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Level 2 & 3 Groups display control */
.mct-wmm-l2-group,
.mct-wmm-l3-group {
    display: none;
}

.mct-wmm-l2-group.is-active,
.mct-wmm-l3-group.is-active {
    display: flex;
    animation: mctFadeSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes mctFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shared Item Styles */
.mct-wmm-item {
    border-radius: 10px;
    transition: background-color 0.18s ease;
    cursor: pointer;
}

.mct-wmm-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    text-decoration: none !important;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
}

.mct-wmm-item-name {
    font-size: 13.5px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.35;
    transition: color 0.18s ease;
    flex-grow: 1;
}

/* Chevron indicator for items with children */
.mct-wmm-chevron {
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.18s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Bullet indicator for level 3 items */
.mct-wmm-bullet {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #cbd5e1;
    margin-right: 10px;
    flex-shrink: 0;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

/* Product Count Badge */
.mct-wmm-item-count {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Active & Hover States */
.mct-wmm-item:hover,
.mct-wmm-item.is-active {
    background-color: #fef2f2;
}

.mct-wmm-item:hover .mct-wmm-item-name,
.mct-wmm-item.is-active .mct-wmm-item-name {
    color: #dc2626;
    font-weight: 600;
}

.mct-wmm-item:hover .mct-wmm-chevron,
.mct-wmm-item.is-active .mct-wmm-chevron {
    color: #dc2626;
    transform: translateX(3px);
}

.mct-wmm-item:hover .mct-wmm-bullet,
.mct-wmm-item.is-active .mct-wmm-bullet {
    background-color: #dc2626;
    transform: scale(1.4);
}

/* Empty State */
.mct-wmm-empty-state {
    padding: 30px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.mct-wmm-empty-state p {
    margin: 0 0 10px 0;
}

.mct-wmm-empty-btn {
    display: inline-block;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626 !important;
    background-color: #fee2e2;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background-color 0.18s ease;
}

.mct-wmm-empty-btn:hover {
    background-color: #fecaca;
}

/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1100px) {
    .mct-wmm-left-banner {
        width: 210px;
        min-width: 200px;
        padding: 20px 16px;
    }

    .mct-wmm-banner-title {
        font-size: 19px;
    }

    .mct-wmm-banner-img {
        max-width: 90px;
        max-height: 90px;
    }
}

/* Hide desktop mega-box on screens under 992px */
@media (max-width: 991px) {
    .mct-wmm-mega-box {
        display: none !important;
    }
}

/* ==========================================================================
   7. MOBILE OFFCANVAS DRAWER & SEARCH
   ========================================================================== */
.mct-wmm-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999998 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mct-wmm-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mct-wmm-mobile-offcanvas {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 90%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 999999 !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mct-wmm-mobile-offcanvas.is-open {
    transform: translateX(0);
}

body.mct-wmm-offcanvas-active {
    overflow: hidden !important;
}

.mct-wmm-offcanvas-header {
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    flex-shrink: 0;
}

.mct-wmm-offcanvas-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.mct-wmm-offcanvas-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.mct-wmm-offcanvas-close {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.mct-wmm-offcanvas-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.mct-wmm-offcanvas-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.mct-wmm-offcanvas-search-wrap .mct-wmm-search-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.mct-wmm-offcanvas-search-input {
    width: 100%;
    padding: 10px 14px 10px 42px !important;
    font-size: 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    outline: none !important;
    box-shadow: none !important;
    color: #0f172a !important;
    transition: border-color 0.2s ease, background 0.2s ease !important;
}

.mct-wmm-offcanvas-search-input:focus {
    border-color: #dc2626 !important;
    background: #ffffff !important;
}

.mct-wmm-offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
}

/* Offcanvas Mobile 3-Level Sliding Drilldown Navigation */
.mct-wmm-mob-view {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: mctMobSlideIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mct-wmm-mob-view.slide-back {
    animation: mctMobSlideBack 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes mctMobSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes mctMobSlideBack {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Back Button */
.mct-wmm-mob-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
    line-height: 1;
}

.mct-wmm-mob-back-btn:hover,
.mct-wmm-mob-back-btn:active {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Current Level Heading & View All */
.mct-wmm-mob-heading {
    padding: 8px 12px 14px 12px;
    margin-bottom: 8px;
    border-bottom: 1.5px solid #f1f5f9;
}

.mct-wmm-mob-title {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.mct-wmm-mob-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #dc2626 !important;
    text-decoration: none !important;
    transition: color 0.18s ease;
}

.mct-wmm-mob-all-link:hover {
    color: #b91c1c !important;
}

/* List of Items */
.mct-wmm-mob-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mct-wmm-mob-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none !important;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    box-sizing: border-box;
}

.mct-wmm-mob-item:hover,
.mct-wmm-mob-item:active {
    background-color: #fef2f2;
    color: #dc2626;
}

.mct-wmm-mob-item.is-link {
    color: #334155;
    font-weight: 500;
}

.mct-wmm-mob-item.level-3-link {
    font-size: 13.5px;
    padding: 10px 14px;
}

.mct-wmm-mob-item:hover.is-link,
.mct-wmm-mob-item:active.is-link {
    color: #dc2626;
}

.mct-wmm-mob-name {
    flex-grow: 1;
    line-height: 1.35;
}

.mct-wmm-mob-badge {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.mct-wmm-mob-arrow {
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.18s ease;
    flex-shrink: 0;
}

.mct-wmm-mob-item:hover .mct-wmm-mob-arrow,
.mct-wmm-mob-item:active .mct-wmm-mob-arrow {
    color: #dc2626;
    transform: translateX(3px);
}

.mct-wmm-mob-bullet {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #cbd5e1;
    margin-right: 10px;
    flex-shrink: 0;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.mct-wmm-mob-item:hover .mct-wmm-mob-bullet,
.mct-wmm-mob-item:active .mct-wmm-mob-bullet {
    background-color: #dc2626;
    transform: scale(1.3);
}

.mct-wmm-mob-empty {
    padding: 36px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.mct-wmm-mob-empty p {
    margin: 0;
}

/* Instant Search Results */
.mct-wmm-mob-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mct-wmm-mob-search-count {
    margin: 0 0 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.mct-wmm-mob-search-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    text-decoration: none !important;
    transition: all 0.18s ease;
}

.mct-wmm-mob-search-item:hover,
.mct-wmm-mob-search-item:active {
    background: #fef2f2;
    border-color: #fecaca;
}

.mct-wmm-mob-search-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    transition: color 0.18s ease;
}

.mct-wmm-mob-search-item:hover .mct-wmm-mob-search-title {
    color: #dc2626;
}

.mct-wmm-mob-search-trail {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.3;
}

