/* ==========================================================================
   NAVIGATION DROPDOWN MENU
   ========================================================================== */

.ep-nav-dropdown {
    position: relative;
    display: inline-flex;
}

.ep-nav-dropdown__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ep-nav-dropdown__icon {
    flex-shrink: 0;
}

.ep-nav-dropdown__chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ep-nav-dropdown:hover .ep-nav-dropdown__chevron {
    transform: rotate(180deg);
}

.ep-nav-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--ep-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.ep-nav-dropdown:hover .ep-nav-dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.ep-nav-dropdown__container {
    display: flex;
    align-items: stretch;
    width: 700px;
    position: relative;
}

/* Left panel: main categories */
.ep-nav-dropdown__categories {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    width: 300px;
    flex-shrink: 0;
    background: #fafafa;
    border-radius: 12px 0 0 12px;
    border-right: 1px solid var(--ep-border);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 450px;
}

/* Custom scrollbar for categories */
.ep-nav-dropdown__categories::-webkit-scrollbar {
    width: 4px;
}

.ep-nav-dropdown__categories::-webkit-scrollbar-track {
    background: transparent;
}

.ep-nav-dropdown__categories::-webkit-scrollbar-thumb {
    background: rgba(100, 160, 220, 0.4);
    border-radius: 4px;
}

.ep-nav-dropdown__categories::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 160, 220, 0.6);
}

/* Custom scrollbar for subcategories */
.ep-nav-dropdown__subcategories::-webkit-scrollbar {
    width: 4px;
}

.ep-nav-dropdown__subcategories::-webkit-scrollbar-track {
    background: transparent;
}

.ep-nav-dropdown__subcategories::-webkit-scrollbar-thumb {
    background: rgba(100, 160, 220, 0.4);
    border-radius: 4px;
}

.ep-nav-dropdown__subcategories::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 160, 220, 0.6);
}

.ep-nav-dropdown__category {
    position: static;
}

.ep-nav-dropdown__category-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ep-primary);
    background: #fff;
    border-radius: 6px;
    border: 1px solid var(--ep-border);
    flex-shrink: 0;
}

.ep-nav-dropdown__category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 0.875rem;
    color: var(--ep-text);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    gap: 8px;
}

.ep-nav-dropdown__category-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.ep-nav-dropdown__category-link:hover {
    background: #fff;
    color: var(--ep-primary);
}

.ep-nav-dropdown__category:hover .ep-nav-dropdown__category-link {
    background: #fff;
    color: var(--ep-primary);
}

.ep-nav-dropdown__arrow {
    opacity: 0.4;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.ep-nav-dropdown__category:hover .ep-nav-dropdown__arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* Right panel: subcategories */
.ep-nav-dropdown__subcategories {
    position: absolute;
    left: 300px;
    top: 0;
    bottom: 0;
    width: 400px;
    background: #fff;
    padding: 20px 24px;
    border-radius: 0 12px 12px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    overflow-y: auto;
    box-sizing: border-box;
    z-index: 10;
}

.ep-nav-dropdown__subcategories-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ep-border);
}

.ep-nav-dropdown__subcategories-header a {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ep-text);
    text-decoration: none;
}

.ep-nav-dropdown__subcategories-header a:hover {
    color: var(--ep-primary);
}

.ep-nav-dropdown__subcategories-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.ep-nav-dropdown__subcategory-item {
    position: relative;
}

.ep-nav-dropdown__subcategory-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--ep-text-soft);
    text-decoration: none;
    transition: color 0.15s ease, padding-left 0.15s ease;
    gap: 6px;
}

.ep-nav-dropdown__subcategory-link span {
    flex: 1;
    min-width: 0;
}

.ep-nav-dropdown__sub-arrow {
    opacity: 0.3;
    transition: opacity 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.ep-nav-dropdown__subcategory-item:hover > .ep-nav-dropdown__subcategory-link {
    color: var(--ep-primary);
    padding-left: 6px;
}

.ep-nav-dropdown__subcategory-item:hover .ep-nav-dropdown__sub-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* Third-level dropdown */
.ep-nav-dropdown__third-level {
    position: fixed;
    left: calc(50% - 350px + 700px);
    top: auto;
    min-width: 280px;
    max-width: 600px;
    background: #fff;
    border: 1px solid var(--ep-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 20px 24px;
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    transform: translateX(-10px);
    z-index: 1001;
    max-height: 450px;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Custom scrollbar for third-level */
.ep-nav-dropdown__third-level::-webkit-scrollbar {
    width: 4px;
}

.ep-nav-dropdown__third-level::-webkit-scrollbar-track {
    background: transparent;
}

.ep-nav-dropdown__third-level::-webkit-scrollbar-thumb {
    background: rgba(100, 160, 220, 0.4);
    border-radius: 4px;
}

.ep-nav-dropdown__third-level::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 160, 220, 0.6);
}

.ep-nav-dropdown__third-level-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ep-border);
}

.ep-nav-dropdown__third-level-header a {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ep-text);
    text-decoration: none;
}

.ep-nav-dropdown__third-level-header a:hover {
    color: var(--ep-primary);
}

.ep-nav-dropdown__third-level-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

/* Always single column */
.ep-nav-dropdown__third-level-list {
    grid-template-columns: 1fr;
}

.ep-nav-dropdown__third-level-list li a {
    display: block;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--ep-text-soft);
    text-decoration: none;
    transition: color 0.15s ease, padding-left 0.15s ease;
}

.ep-nav-dropdown__third-level-list li a:hover {
    color: var(--ep-primary);
    padding-left: 6px;
}

.ep-nav-dropdown__view-all {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ep-primary);
    background: transparent;
    border: 1px solid var(--ep-border);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ep-nav-dropdown__view-all:hover {
    background: var(--ep-primary-soft, #f0f7ff);
    border-color: var(--ep-primary);
}

.ep-nav-dropdown__empty {
    padding: 24px;
    color: var(--ep-text-soft);
    font-size: 0.875rem;
}

/* Mobile: hide dropdown, keep simple link */
@media (max-width: 980px) {
    .ep-nav-dropdown__menu {
        display: none !important;
    }

    .ep-nav-dropdown__chevron,
    .ep-nav-dropdown__icon {
        display: none;
    }
}
