﻿.mobile-category-offcanvas {
    --bs-offcanvas-width: min(92vw, 390px);
    border-right: 0;
    background-color: #fff;
    box-shadow: 18px 0 45px rgba(15, 23, 42, 0.18);
}

    .mobile-category-offcanvas .offcanvas-body {
        padding: 0;
    }

.mobile-category-navigation {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background-color: #fff;
}

.mobile-category-navigation__header {
    position: relative;
    flex: 0 0 auto;
    border-bottom: 1px solid #e9ecef;
    background-color: #fff;
}

.mobile-category-navigation__header-main,
.mobile-category-navigation__header-detail {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 0.75rem 1rem;
}

.mobile-category-navigation__header-main {
    justify-content: space-between;
    gap: 1rem;
}

.mobile-category-navigation__header-detail {
    gap: 0.65rem;
}

    .mobile-category-navigation__header-detail[hidden] {
        display: none !important;
    }

.mobile-category-navigation__title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

    .mobile-category-navigation__title i {
        flex: 0 0 auto;
        color: var(--site-primary-color, #dc3545);
        font-size: 18px;
    }

.mobile-category-navigation__close,
.mobile-category-navigation__back {
    display: inline-flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background-color: #f6f7f8;
    color: #374151;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

    .mobile-category-navigation__close:hover,
    .mobile-category-navigation__close:focus-visible,
    .mobile-category-navigation__back:hover,
    .mobile-category-navigation__back:focus-visible {
        color: var(--site-primary-color, #dc3545);
        background-color: #eceff2;
    }

    .mobile-category-navigation__close:active,
    .mobile-category-navigation__back:active {
        transform: scale(0.96);
    }

.mobile-category-navigation__detail-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #1f2937;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-category-navigation__body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background-color: #f8f9fa;
}

.mobile-category-navigation__panels {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.mobile-category-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: #f8f9fa;
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.18s ease;
    scrollbar-width: thin;
    scrollbar-color: #c7ccd1 transparent;
    -webkit-overflow-scrolling: touch;
}

    .mobile-category-panel::-webkit-scrollbar {
        width: 6px;
    }

    .mobile-category-panel::-webkit-scrollbar-track {
        background: transparent;
    }

    .mobile-category-panel::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background-color: #c7ccd1;
    }

    .mobile-category-panel.is-active {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .mobile-category-panel.is-leaving-left {
        opacity: 0;
        transform: translateX(-22%);
        pointer-events: none;
    }

.mobile-category-panel--main {
    z-index: 1;
}

.mobile-category-panel--detail {
    z-index: 2;
}

.mobile-category-list,
.mobile-subcategory-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
}

.mobile-category-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-width: 0;
    min-height: 68px;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e8ebef;
    border-radius: 12px;
    background-color: #fff;
    color: #1f2937;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

    .mobile-category-item:hover,
    .mobile-category-item:focus-visible {
        border-color: #dfe3e8;
        color: var(--site-primary-color, #dc3545);
        background-color: #fff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
        transform: translateY(-1px);
    }

    .mobile-category-item:active {
        transform: scale(0.99);
    }

.mobile-category-item__image {
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    overflow: hidden;
    border: 1px solid #edf0f3;
    border-radius: 10px;
    background-color: #f7f8fa;
}

    .mobile-category-item__image img {
        display: block;
        width: 100%;
        height: 100%;
        padding: 4px;
        object-fit: contain;
    }

.mobile-category-item__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.mobile-category-item__name {
    display: block;
    overflow: hidden;
    color: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-category-item__count {
    display: block;
    margin-top: 0.2rem;
    color: #8a919b;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}

.mobile-category-item__arrow {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: auto;
    border-radius: 8px;
    background-color: #f5f6f7;
    color: #9ca3af;
    font-size: 11px;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.mobile-category-item:hover
.mobile-category-item__arrow,
.mobile-category-item:focus-visible
.mobile-category-item__arrow {
    color: var(--site-primary-color, #dc3545);
    background-color: #f1f2f4;
    transform: translateX(2px);
}

.mobile-subcategory-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 0.75rem 0.9rem;
    border: 1px solid #e8ebef;
    border-radius: 11px;
    background-color: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

    .mobile-subcategory-item:hover,
    .mobile-subcategory-item:focus-visible {
        border-color: #dfe3e8;
        color: var(--site-primary-color, #dc3545);
        background-color: #fff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
        transform: translateX(2px);
    }

.mobile-subcategory-item__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.mobile-subcategory-item i {
    flex: 0 0 auto;
    color: #a2a8b0;
    font-size: 10px;
}

.mobile-subcategory-item:hover i,
.mobile-subcategory-item:focus-visible i {
    color: var(--site-primary-color, #dc3545);
}

@media (min-width: 992px) {
    .mobile-category-offcanvas {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .mobile-category-offcanvas {
        --bs-offcanvas-width: 92vw;
    }

    .mobile-category-navigation__header-main,
    .mobile-category-navigation__header-detail {
        min-height: 60px;
        padding-right: 0.8rem;
        padding-left: 0.8rem;
    }

    .mobile-category-list,
    .mobile-subcategory-list {
        gap: 0.45rem;
        padding: 0.7rem;
    }

    .mobile-category-item {
        min-height: 64px;
        padding: 0.6rem 0.65rem;
    }

    .mobile-category-item__image {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .mobile-category-item__name {
        font-size: 13px;
    }

    .mobile-subcategory-item {
        min-height: 50px;
        padding: 0.7rem 0.8rem;
    }
}
