﻿.desktop-category-navigation {
    position: relative;
    z-index: 1020;
    display: block;
    width: 100%;
    border-top: 1px solid #eceff3;
    border-bottom: 1px solid #e4e7eb;
    background-color: #fff;
}

    .desktop-category-navigation .site-container {
        position: static;
    }

.desktop-category-list {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.desktop-category-item {
    position: static;
    flex: 1 1 0;
    min-width: 0;
}

.desktop-category-item--all {
    flex: 0 0 170px;
    min-width: 170px;
}

.desktop-category-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 105px;
    padding: 0.7rem 0.45rem;
    border: 0;
    background: transparent;
    color: #222;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}
.desktop-category-link__image {
    display: flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 1px solid #edf0f3;
    border-radius: 11px;
    background-color: #f8f9fa;
}

    .desktop-category-link__image img {
        display: block;
        width: 100%;
        height: 100%;
        padding: 3px;
        object-fit: contain;
    }

.desktop-category-item.is-open
.desktop-category-link__image,
.desktop-category-item:focus-within
.desktop-category-link__image {
    border-color: #e1e5e9;
    background-color: #fff;
}

.desktop-category-link__text {
    display: -webkit-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
}

.desktop-category-link::after {
    position: absolute;
    right: 50%;
    bottom: 0;
    left: 50%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background-color: var( --site-primary-color, #dc3545 );
    content: "";
    transition: right 0.18s ease, left 0.18s ease;
}

.desktop-category-link--button {
    gap: 0.55rem;
}

    .desktop-category-link--button > i:first-child {
        position: static;
        font-size: 22px;
        opacity: 0.75;
    }

.desktop-category-item.is-open
.desktop-category-link,
.desktop-category-item:focus-within
.desktop-category-link {
    color: var( --site-primary-color, #dc3545 );
    background-color: #fafafa;
}

    .desktop-category-item.is-open
    .desktop-category-link::after,
    .desktop-category-item:focus-within
    .desktop-category-link::after {
        right: 12px;
        left: 12px;
    }

.desktop-category-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    visibility: hidden;
    width: 100%;
    border-top: 1px solid #eceff3;
    border-bottom: 1px solid #e2e5e9;
    background-color: rgba(255, 255, 255, 0.99);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

.desktop-category-item.is-open
.desktop-category-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.desktop-category-dropdown__inner {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
}

.desktop-category-dropdown-body {
    max-height: min( 360px, calc(100vh - 190px) );
    padding: 1rem 1.25rem 1.25rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #c7ccd1 transparent;
}

    .desktop-category-dropdown-body::-webkit-scrollbar {
        width: 7px;
    }

    .desktop-category-dropdown-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .desktop-category-dropdown-body::-webkit-scrollbar-thumb {
        border-radius: 10px;
        background-color: #c7ccd1;
    }

        .desktop-category-dropdown-body::-webkit-scrollbar-thumb:hover {
            background-color: #aeb4bc;
        }

.desktop-category-subcategory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem 0.75rem;
}

.desktop-category-subcategory {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

    .desktop-category-subcategory span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .desktop-category-subcategory i {
        flex: 0 0 auto;
        margin-left: auto;
        color: #9ca3af;
        font-size: 10px;
    }

    .desktop-category-subcategory:hover,
    .desktop-category-subcategory:focus-visible {
        border-color: #e6e8eb;
        color: var( --site-primary-color, #dc3545 );
        background-color: #f8f9fa;
        transform: translateX(2px);
    }

.desktop-all-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}

.desktop-all-category-group {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid #eceff3;
    border-radius: 10px;
    background-color: #fff;
}

.desktop-all-category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #edf0f3;
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

    .desktop-all-category-title span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .desktop-all-category-title i {
        flex: 0 0 auto;
        margin-left: auto;
        color: #9ca3af;
        font-size: 10px;
    }

    .desktop-all-category-title:hover,
    .desktop-all-category-title:focus-visible {
        color: var( --site-primary-color, #dc3545 );
    }

.desktop-all-category-subcategories {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-height: 210px;
    margin-top: 0.6rem;
    padding-right: 0.25rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c7ccd1 transparent;
}

    .desktop-all-category-subcategories::-webkit-scrollbar {
        width: 6px;
    }

    .desktop-all-category-subcategories::-webkit-scrollbar-track {
        background: transparent;
    }

    .desktop-all-category-subcategories::-webkit-scrollbar-thumb {
        border-radius: 10px;
        background-color: #c7ccd1;
    }

    .desktop-all-category-subcategories a {
        display: block;
        padding: 0.35rem 0.25rem;
        color: #59616d;
        font-size: 12px;
        line-height: 1.35;
        text-decoration: none;
        overflow-wrap: anywhere;
    }

        .desktop-all-category-subcategories a:hover,
        .desktop-all-category-subcategories a:focus-visible {
            color: var( --site-primary-color, #dc3545 );
        }

@media (max-width: 1199.98px) {

    .desktop-category-item {
        min-width: 120px;
    }

    .desktop-category-link {
        min-height: 58px;
        padding-right: 0.55rem;
        padding-left: 0.55rem;
        font-size: 12px;
    }

    .desktop-category-link__image {
        display: none;
    }

    .desktop-category-item--all {
        flex-basis: 155px;
        min-width: 155px;
    }

    .desktop-category-subcategory-grid,
    .desktop-all-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .desktop-category-navigation {
        display: none;
    }
}
