/* Main mega menu styles */
.mmc-mega-menu {
    background: transparent;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.mmc-desktop-version .mmc-series-column h4 a.mmc-series-title-link
 {
    color: #e74c3c !important;
}


/* Brands menu */
.mmc-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 14px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: transparent;
}

.mmc-brand-item {
    position: relative;
    display: inline-block;
}

/* Hide the actual radio buttons */
.mmc-brand-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mmc-brand-label {
    display: inline-block;
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    color: #444;
    padding: 8px 0;
    font-size: 13px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    user-select: none;
}

.mmc-brand-label:hover {
    color: #e74c3c;
}

/* Active state for label */
.mmc-brand-checkbox:checked + .mmc-brand-label {
    color: #e74c3c;
}

.mmc-brand-checkbox:checked + .mmc-brand-label::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e74c3c;
}

/* Series container */
.mmc-series-container {
    position: relative;
    min-height: 200px;
}

/* Series grid - hide all by default */
.mmc-series-grid {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show active series grid */
.mmc-series-grid-active,
.mmc-brand-checkbox:checked ~ .mmc-series-container .mmc-series-grid:target,
.mmc-brand-checkbox:focus ~ .mmc-series-container .mmc-series-grid {
    opacity: 1;
    visibility: visible;
    position: relative;
    height: auto;
    overflow: visible;
}

/* Series columns */
.mmc-series-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 350px;
    overflow-y: auto;
    border: 1px solid rgb(229 231 235 / 1);
    padding: 10px;
}

/* Scrollbar styles */
.mmc-series-column::-webkit-scrollbar-thumb {
    background: rgb(247 112 51);
}

.mmc-series-column::-webkit-scrollbar-track {
    border-radius: 10px;
}

.mmc-series-column::-webkit-scrollbar {
    width: 4px;
}

.mmc-childless-column {
    gap: 8px;
}

/* Series groups (categories with children) */
.mmc-series-group {
    margin-bottom: 15px;
}

.mmc-series-group h4 {
    color: #e74c3c;
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

/* Childless categories title */
.mmc-childless-title {
    color: #e74c3c;
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 24px; /* Match h4 height */
}

.mmc-childless-title-spacer {
    min-height: 24px; /* Match h4 height */
    margin-bottom: 8px;
}

/* Models list */
.mmc-models-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mmc-models-list li {
    margin-bottom: 4px;
}

/* Childless categories (without h4) */
.mmc-childless-category {
    margin-bottom: 6px;
}

.mmc-models-list a,
.mmc-childless-category a {
    color: #333;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    font-size: 13px;
    line-height: 1.5;
    padding: 3px 0;
}

.mmc-models-list a:hover,
.mmc-childless-category a:hover {
    color: #e74c3c;
    text-decoration: underline;
    padding-left: 5px;
}

/* =========================================== */
/* MOBILE ACCORDION STYLES */
/* =========================================== */

.mmc-mobile-accordion .mmc-brands-list {
    display: flex;
    flex-direction: column;
}

/* Brand Option */
.mmc-mobile-accordion .mmc-brand-option {
    border-bottom: 1px solid #e5e5e5;
}

.mmc-mobile-accordion .mmc-brand-option:last-child {
    border-bottom: none;
}

/* Brand Header */
.mmc-mobile-accordion .mmc-brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mmc-mobile-accordion .mmc-brand-header:hover {
    background: #f9f9f9;
}

.mmc-mobile-accordion .mmc-brand-option.active .mmc-brand-header {
    background: #f0f0f0;
    border-left: 3px solid #e74c3c;
}

.mmc-mobile-accordion .mmc-brand-header span {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.mmc-mobile-accordion .mmc-brand-option.active .mmc-brand-header span {
    color: #e74c3c;
}

/* Brand Icon */
.mmc-mobile-accordion .mmc-brand-icon {
    transition: transform 0.3s ease;
    color: #999;
}

.mmc-mobile-accordion .mmc-brand-option.active .mmc-brand-icon {
    transform: rotate(90deg);
    color: #e74c3c;
}

/* Brand Panel */
.mmc-mobile-accordion .mmc-brand-panel {
    display: none;
    padding: 0 16px 16px 16px;
    background: transparent;
    animation: slideDown 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.mmc-mobile-accordion .mmc-brand-option.active .mmc-brand-panel {
    display: block;
    max-height: 2000px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

/* Series Section */
.mmc-mobile-accordion .mmc-series-section {
    margin-bottom: 0;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mmc-mobile-accordion .mmc-series-section:last-child {
    border-bottom: none;
}

/* Series Title */
.mmc-mobile-accordion .mmc-series-title {
    color: #e74c3c;
    margin: 0 0 0 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    user-select: none;
}

.mmc-mobile-accordion .mmc-series-title span {
    flex: 1;
}

.mmc-mobile-accordion .mmc-series-title .mmc-brand-icon {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.mmc-mobile-accordion .mmc-series-section.active .mmc-series-title .mmc-brand-icon {
    transform: rotate(90deg);
}

/* Models Grid */
.mmc-mobile-accordion .mmc-models-grid {
    display: none;
    grid-template-columns: repeat(1, 1fr);
    gap: 0;
    transition: max-height 0.3s ease;
     overflow-y: auto;
    border: 1px solid rgb(229 231 235 / 1);
}

.mmc-mobile-accordion .mmc-series-section.active .mmc-models-grid {
    display: grid;
    max-height: 300px;
   
    padding: 10px;
}
/* Scrollbar styles */
.mmc-mobile-accordion .mmc-models-grid::-webkit-scrollbar-thumb {
    background: rgb(247 112 51);
}

.mmc-mobile-accordion .mmc-models-grid::-webkit-scrollbar-track {
    border-radius: 10px;
}

.mmc-mobile-accordion .mmc-models-grid::-webkit-scrollbar {
    width: 4px;
}

/* Childless categories (without series title) */
.mmc-mobile-accordion .mmc-series-section:not(:has(.mmc-series-title)) .mmc-models-grid {
    display: grid !important;
    margin-top: 8px;
}

.mmc-mobile-accordion .mmc-series-section:not(:has(.mmc-series-title)) {
    border-bottom: none;
    padding-bottom: 0;
    padding-top: 8px;
}

/* Model Item */
.mmc-mobile-accordion .mmc-model-item {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    line-height: 1.4;
    text-align: left;
}

.mmc-mobile-accordion .mmc-model-item:last-child {
    border-bottom: none;
}

.mmc-mobile-accordion .mmc-model-item:hover {
    color: #e74c3c;
    background: #f8f9fa;
    padding-left: 8px;
}

/* Only one column on very small screens */
@media (max-width: 360px) {
    .mmc-mobile-accordion .mmc-models-grid {
        grid-template-columns: 1fr;
    }
    
    .mmc-mobile-accordion .mmc-model-item {
        font-size: 13px;
    }
}

/* =========================================== */
/* RESPONSIVE STYLES */
/* =========================================== */

/* Show desktop version on desktop, mobile on mobile */
@media (min-width: 769px) {
    .mmc-desktop-version {
        display: block !important;
    }
    .mmc-mobile-accordion {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .mmc-desktop-version {
        display: none !important;
    }
    .mmc-mobile-accordion {
        display: block !important;
    }
}

/* Responsive desktop styles */
@media (max-width: 1200px) {
    .mmc-brands {
        gap: 15px;
        padding: 12px 20px;
    }
    
    .mmc-series-grid {
        padding: 20px;
        gap: 20px;
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (max-width: 992px) {
    .mmc-brands {
        padding: 10px 15px;
        gap: 12px;
    }
    
    .mmc-brand-label {
        font-size: 13px;
        padding: 6px 0;
    }
    
    .mmc-series-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        padding: 15px;
        gap: 15px;
    }
    
    .mmc-series-group h4,
    .mmc-childless-title {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .mmc-childless-title-spacer {
        min-height: 22px;
        margin-bottom: 6px;
    }
    
    .mmc-models-list a,
    .mmc-childless-category a {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .mmc-brands {
        flex-wrap: wrap;
        justify-content: center;
        padding: 8px 12px;
        gap: 10px;
    }
    
    .mmc-brand-label {
        font-size: 12px;
        padding: 4px 0;
    }
    
    .mmc-series-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        padding: 12px;
        gap: 12px;
    }
    
    .mmc-series-column {
        gap: 12px;
    }
    
    .mmc-series-group,
    .mmc-childless-category {
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .mmc-series-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .mmc-brands {
        gap: 8px;
    }
    
    .mmc-brand-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .mmc-series-grid {
        grid-template-columns: 1fr !important;
    }
    
    .mmc-brands {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

/* States and messages */
.mmc-no-series,
.mmc-error,
.mmc-no-category,
.mmc-no-brands {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 13px;
    background: #f9f9f9;
    border-radius: 4px;
    margin: 10px 0;
}

.mmc-no-series strong {
    color: #e74c3c;
}

/* Accessibility */
.mmc-brand-checkbox:focus + .mmc-brand-label {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

.mmc-models-list a:focus,
.mmc-childless-category a:focus,
.mmc-mobile-accordion .mmc-model-item:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* Keyboard navigation support */
.mmc-brand-checkbox:focus-visible + .mmc-brand-label {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}