/* Main Menu Container */
.cmb-menu-container {
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Menu Toggle Button */
.cmb-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #fff;
    color: #000;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    width: 44px;
    height: 44px;
    transition: background-color 0.2s, border-color 0.2s;
    border-radius: 4px;
}

.cmb-menu-toggle:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.cmb-menu-toggle:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.cmb-menu-toggle[aria-expanded="true"] {
    background: #f5f5f5;
}

.cmb-menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
    height: 18px;
    justify-content: center;
}

.cmb-menu-toggle-line {
    display: block;
    width: 100%;
    height: 2px;
    background: #000;
    transition: all 0.3s ease;
    transform-origin: center;
}

.cmb-menu-toggle[aria-expanded="true"] .cmb-menu-toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.cmb-menu-toggle[aria-expanded="true"] .cmb-menu-toggle-line:nth-child(2) {
    opacity: 0;
}

.cmb-menu-toggle[aria-expanded="true"] .cmb-menu-toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}


.cmb-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 9999;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
}

.cmb-menu.active {
    display: flex;
    visibility: visible;
    opacity: 1;
}

.cmb-menu.show {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    display: flex;
}

.cmb-menu-header {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 20px;
    position: relative;
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    min-height: 60px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.cmb-menu-close-button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 0;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #333;
    transition: background-color 0.2s, border-color 0.2s;
    border-radius: 6px;
    line-height: 1;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
}

.cmb-menu-close-button:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

.cmb-menu-close-icon {
    font-size: 28px;
    line-height: 1;
    font-weight: 400;
    display: block;
}

.cmb-menu-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cmb-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
}

.cmb-menu-item {
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    display: list-item;
}

/* Ensure submenu overlays inside menu items don't affect layout */
.cmb-menu-item > .cmb-submenu-overlay,
.cmb-menu-item > .cmb-mega-menu-overlay {
    position: fixed;
    display: none;
}

.cmb-menu-item:last-child {
    border-bottom: none;
}

.cmb-menu-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: #000;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.cmb-menu-link:hover {
    background-color: #f5f5f5;
}

.cmb-menu-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.cmb-menu-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cmb-menu-icon i {
    font-size: 24px;
    color: #666;
}

.cmb-menu-label {
    flex: 1;
}

.cmb-menu-arrow {
    margin-left: auto;
    font-size: 24px;
    color: #999;
    font-weight: normal;
}

/* No arrow for submenu items - they're already inside an overlay */
.cmb-submenu-link .cmb-submenu-arrow {
    display: none;
}

/* Submenu Overlay */
.cmb-submenu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #fff;
    z-index: 9999;
    display: none !important;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
}

.cmb-submenu-overlay.active {
    display: flex !important;
    visibility: visible;
    opacity: 1;
}

.cmb-submenu-overlay.show {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    display: flex !important;
}

.cmb-submenu-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cmb-submenu-header.scrolled {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cmb-back-button {
    background: none;
    border: none;
    padding: 8px 12px;
    margin-right: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #000;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.cmb-back-button:hover {
    background-color: #f5f5f5;
}

.cmb-back-icon {
    font-size: 28px;
    line-height: 1;
    font-weight: normal;
}

.cmb-submenu-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    padding-right: 50px; /* Compensate for back button width */
}

.cmb-submenu-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.cmb-shortcode-content {
    width: 100%;
    padding: 20px;
}

.cmb-shortcode-content * {
    max-width: 100%;
}

/* Mega Menu Overlay Specific Styles */
.cmb-mega-menu-overlay .cmb-submenu-content {
    padding: 20px;
}

.cmb-mega-menu-overlay .cmb-mega-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 0;
}

/* Regular submenu list padding */
.cmb-submenu-overlay:not(.cmb-mega-menu-overlay) .cmb-submenu-content {
    padding: 0;
}

.cmb-submenu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cmb-submenu-item {
    border-bottom: 1px solid #d0d0d0 !important;
    position: relative;
    margin: 0;
    padding: 0;
}

.cmb-submenu-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #d0d0d0;
    display: block;
}

.cmb-submenu-item:last-child {
    border-bottom: none;
}

.cmb-submenu-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: #000;
    transition: background-color 0.2s;
    cursor: pointer;
}

.cmb-submenu-link:hover {
    background-color: #f5f5f5;
}

.cmb-submenu-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #f5f5f5;
    border-radius: 4px;
}

.cmb-submenu-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cmb-submenu-icon i {
    font-size: 24px;
    color: #666;
}

.cmb-submenu-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cmb-submenu-label {
    font-weight: 600;
    font-size: 16px;
}

.cmb-item-count {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

/* Overlay Backdrop */
.cmb-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cmb-overlay-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Main Menu Backdrop */
.cmb-main-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cmb-main-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when overlay is open */
body.cmb-overlay-open {
    overflow: hidden;
}

/* Featured Products Section (if needed) */
.cmb-featured-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e5e5e5;
}

.cmb-featured-title {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    background: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cmb-menu-link,
    .cmb-submenu-link {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .cmb-submenu-icon {
        width: 40px;
        height: 40px;
    }
    
    .cmb-submenu-title {
        font-size: 16px;
    }
}

/* Animation for smooth transitions */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Loading state (if needed) */
.cmb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
}

/* Empty state */
.cmb-empty-menu {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}
