/**
 * One Elementor - Browse Product Category Menu
 * Main Stylesheet - Frontend Optimized
 */

/* ========================================
   RESET & BASE STYLES
======================================== */
.oe-browse-menu-wrapper * {
    box-sizing: border-box;
}

.oe-browse-menu-wrapper {
    position: relative;
    display: block;
    width: 100%;
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

/* ========================================
   MAIN TRIGGER BUTTON
======================================== */
.oe-browse-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 20px;
    background-color: #ef583a;
    color: #FFFFFF;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    border: none;
    border-radius: 0;
    transition: background-color 0.3s ease;
    user-select: none;
    width: 100%;
}

.oe-browse-menu-trigger:hover {
    background-color: #FB8C00;
}

.oe-browse-menu-trigger i,
.oe-browse-menu-trigger svg {
    margin-right: 10px;
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.oe-trigger-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   DROPDOWN CONTAINER
======================================== */
.oe-browse-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-top: none;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: visible; /* Changed from hidden to visible for submenu */
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

/* Hover behavior - default */
.oe-browse-menu-wrapper[data-hover-behavior="hover"]:hover .oe-browse-menu-dropdown,
.oe-browse-menu-wrapper[data-hover-behavior="hover"].active .oe-browse-menu-dropdown {
    max-height: 600px;
    opacity: 1;
    visibility: visible;
    overflow: visible;
}

/* Click only behavior */
.oe-browse-menu-wrapper[data-hover-behavior="click"].active .oe-browse-menu-dropdown {
    max-height: 600px;
    opacity: 1;
    visibility: visible;
    overflow: visible;
}

/* Legacy support (no data attribute) */
.oe-browse-menu-wrapper:not([data-hover-behavior]):hover .oe-browse-menu-dropdown,
.oe-browse-menu-wrapper:not([data-hover-behavior]).active .oe-browse-menu-dropdown {
    max-height: 600px;
    opacity: 1;
    visibility: visible;
    overflow: visible;
}

/* Auto-expanded state (for homepage) */
.oe-browse-menu-wrapper.auto-expanded .oe-browse-menu-dropdown {
    max-height: 600px;
    opacity: 1;
    visibility: visible;
    overflow: visible;
}

.oe-browse-menu-wrapper.auto-expanded .oe-browse-menu-trigger {
    border-radius: 0;
}

/* ========================================
   CATEGORY LIST
======================================== */
.oe-category-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ========================================
   CATEGORY ITEM
======================================== */
.oe-category-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E0E0E0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-height: 60px;
    z-index: 1;
}

.oe-category-item:last-child {
    border-bottom: none;
}

.oe-category-item:hover {
    background-color: #F5F5F5;
    z-index: 999;
}

/* Category Icon */
.oe-category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    background-color: #F5F5F5;
    border-radius: 0;
    margin-right: 15px;
    font-size: 18px;
    color: #ef583a;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.oe-category-icon i,
.oe-category-icon svg {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oe-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.oe-category-item:hover .oe-category-icon {
    background-color: #ef583a;
    color: #FFFFFF;
}

/* Category Name */
.oe-category-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.oe-category-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.oe-category-name a:hover,
.oe-category-name a:focus {
    color: #ef583a;
    outline: none;
}

.oe-category-item:hover .oe-category-name {
    color: #ef583a;
}

/* Category Arrow */
.oe-category-arrow {
    font-size: 14px;
    color: #999999;
    margin-left: 10px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.oe-category-item:hover .oe-category-arrow {
    color: #ef583a;
    transform: translateX(3px);
}

/* ========================================
   SUBMENU PANEL
======================================== */
.oe-submenu-panel {
    position: absolute;
    left: calc(100% - 1px); /* Overlap border with main menu */
    top: -1px; /* Align perfectly with category item */
    min-width: 250px;
    max-width: 300px;
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-left: none; /* Remove left border to merge with main menu */
    border-radius: 0;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.3s ease;
    z-index: 1000;
}

/* Show submenu on hover */
.oe-category-item:hover .oe-submenu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* Keep submenu visible when hovering over it */
.oe-submenu-panel:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Ensure submenu stays visible during transition */
.oe-category-item:hover > .oe-submenu-panel,
.oe-category-item .oe-submenu-panel:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* Add hover area extension to prevent gap issues */
.oe-category-item::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 0;
    width: 5px; /* Invisible hover bridge */
    height: 100%;
    background: transparent;
    z-index: 999;
}

/* Submenu Items */
.oe-submenu-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.oe-submenu-item:hover,
.oe-submenu-item:focus {
    color: #ef583a;
    padding-left: 0;
    outline: none;
}

.oe-submenu-item i,
.oe-submenu-item svg {
    margin-right: 0;
    font-size: 12px;
    color: #999999;
    transition: color 0.3s ease;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

.oe-submenu-item:hover i,
.oe-submenu-item:hover svg {
    color: #ef583a;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .oe-browse-menu-wrapper {
        max-width: 280px;
    }

    .oe-category-icon {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 16px;
    }

    .oe-category-name {
        font-size: 14px;
    }

    .oe-submenu-panel {
        min-width: 220px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .oe-browse-menu-wrapper {
        max-width: 100%;
    }

    .oe-browse-menu-trigger {
        padding: 12px 15px;
        font-size: 15px;
        border-radius: 0;
    }

    .oe-browse-menu-dropdown {
        border-radius: 0;
        margin-top: 5px;
        position: relative;
        top: 0;
    }

    .oe-category-item {
        padding: 10px 15px;
        min-height: 52px;
    }

    .oe-category-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 14px;
        margin-right: 12px;
    }

    .oe-category-name {
        font-size: 13px;
    }

    /* Mobile: Show submenu below instead of flyout */
    .oe-submenu-panel {
        position: relative;
        left: auto;
        top: auto;
        margin-left: 0;
        margin-top: 10px;
        transform: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid #E0E0E0;
        border-radius: 0;
        padding: 10px 0 10px 47px;
        max-height: 0;
        overflow: hidden;
        pointer-events: auto;
    }

    .oe-category-item:hover .oe-submenu-panel,
    .oe-category-item.active .oe-submenu-panel {
        max-height: 500px;
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .oe-submenu-item {
        padding: 6px 0;
        font-size: 13px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .oe-browse-menu-trigger {
        padding: 10px 12px;
        font-size: 14px;
    }

    .oe-category-item {
        padding: 8px 12px;
        min-height: 48px;
    }

    .oe-category-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 12px;
        margin-right: 10px;
    }

    .oe-category-name {
        font-size: 12px;
    }

    .oe-submenu-item {
        font-size: 12px;
    }
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ========================================
   ACCESSIBILITY
======================================== */
.oe-category-item:focus,
.oe-submenu-item:focus {
}

.oe-browse-menu-trigger:focus {
    outline: 2px solid #FFFFFF;
    outline-offset: -2px;
}

.oe-category-item:focus-visible,
.oe-submenu-item:focus-visible {
    outline: 2px solid #ef583aef583a;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .oe-browse-menu-wrapper {
        display: none;
    }
}