/**
 * Category Drawer Styles
 *
 * @package Astra Child
 */

/* -----------------------------------------
   Category Drawer Overlay
----------------------------------------- */
.bs-category-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 8, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10000;
}

.bs-category-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* -----------------------------------------
   Category Drawer
----------------------------------------- */
.bs-category-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(420px, 92vw);
    background: #fff;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.35s ease;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow: hidden;
}

.bs-category-drawer.is-visible {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .bs-category-drawer {
        width: 100%;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        height: min(95vh, 640px);
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        transform: translateY(100%);
        padding: 1.25rem;
    }

    .bs-category-drawer.is-visible {
        transform: translateY(0);
    }
}

body.bs-drawer-open {
    overflow: hidden;
}

.bs-category-drawer__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1.25rem;
}

.bs-category-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.bs-category-drawer__header > div {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bs-category-drawer__eyebrow {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2a3144;
    margin: 0;
    font-weight: 600;
    text-align: center;
}

.bs-category-drawer__close {
    border: none;
    background: transparent;
    color: #111;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    outline: none;
    opacity: 1;
    visibility: visible;
}

.bs-category-drawer__close:hover,
.bs-category-drawer__close:focus,
.bs-category-drawer__close:active,
.bs-category-drawer__close:visited {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    color: #111 !important;
}

.bs-category-drawer__close span {
    opacity: 1 !important;
    visibility: visible !important;
    color: inherit !important;
}

.bs-category-drawer__close:hover span,
.bs-category-drawer__close:focus span,
.bs-category-drawer__close:active span {
    opacity: 1 !important;
    visibility: visible !important;
    color: #111 !important;
}

.bs-category-drawer__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.bs-category-drawer__panels {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bs-category-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.bs-category-drawer__panel.is-active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.bs-category-drawer__panel--parents {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-right: 1rem;
}

.bs-category-link {
    border: none;
    background: transparent;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    text-align: left;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    color: #2a3144;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    width: 100%;
}

.bs-category-link__name {
    font-family: 'TT commons Pro', sans-serif;
    font-size: 16px;
    color: rgb(36, 36, 36);
    font-weight: 550;
    text-align: left;
}

.bs-category-link__arrow {
    font-size: 1.2rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.bs-category-link:hover .bs-category-link__arrow {
    transform: translateX(4px);
}

.bs-category-link:hover {
    background: #f3f5ff;
    color: #1f3aec;
}

.bs-category-link:focus {
    outline: none;
}

.bs-category-link:focus-visible {
    background: #f3f5ff;
    color: #1f3aec;
    outline: 2px solid #1f3aec;
    outline-offset: 2px;
}

.bs-category-link:focus:not(:focus-visible) {
    background: transparent;
    color: #2a3144;
}

.bs-category-link.is-active {
    background: #1f3aec;
    color: #fff;
}

.bs-category-link__count {
    font-size: 0.75rem;
    color: inherit;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

.bs-category-drawer__panel--children {
    background: #f8f9fb;
    border-radius: 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.bs-category-panel__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eef0f5;
    background: #fff;
    border-radius: 18px 18px 0 0;
}

.bs-category-panel__back {
    border: none;
    background: transparent;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: #2a3144;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.bs-category-panel__back:hover,
.bs-category-panel__back:focus {
    color: #1f3aec;
}

.bs-category-panel__back-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.bs-category-panel__content {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    position: relative;
}

.bs-category-panel__content.is-loading::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #1f3aec;
    animation: bs-spinner 0.8s linear infinite;
}

@keyframes bs-spinner {
    to {
        transform: rotate(360deg);
    }
}

.bs-category-children__view-all-wrapper {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eef0f5;
}

.bs-category-children__view-all {
    font-size: 0.9rem;
    color: #1f3aec;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bs-category-children__view-all:hover {
    text-decoration: underline;
}

.bs-category-children__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bs-category-children__list li {
    margin: 0;
    padding: 0;
}

.bs-category-children__list a {
    background: #fff;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #2a3144;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.bs-category-children__list a:hover {
    background: #eef1ff;
    color: #1f3aec;
}

.bs-category-children__list .bs-category-link__count {
    font-size: 0.75rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.bs-category-children__placeholder,
.bs-category-children__error {
    margin: 0;
    font-size: 0.95rem;
    color: #5a6073;
}

.bs-category-children__error {
    color: #d93025;
}

.bs-category-drawer__footer {
    border-top: 1px solid #eef0f5;
    padding-top: 1.25rem;
    margin-top: auto;
    flex-shrink: 0;
}

.bs-category-drawer__footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
}

.bs-category-drawer__footer-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bs-category-drawer__footer-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2a3144;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bs-category-drawer__footer-contact,
.bs-category-drawer__footer-social {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bs-category-drawer__footer-contact a,
.bs-category-drawer__footer-social a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #5a6073;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.bs-category-drawer__footer-contact a:hover,
.bs-category-drawer__footer-social a:hover {
    color: #1f3aec;
}

.bs-category-drawer__footer-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.bs-category-drawer__footer-icon svg {
    width: 100%;
    height: 100%;
}

.bs-category-drawer__footer-social {
    flex-direction: row;
    gap: 0.75rem;
}

.bs-category-drawer__footer-social a {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f2f4f7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.bs-category-drawer__footer-social a:hover {
    background: #eef1ff;
    color: #1f3aec;
}

.bs-category-drawer__footer-social .bs-category-drawer__footer-icon {
    width: 18px;
    height: 18px;
}

@media (max-width: 1024px) {
    .bs-category-drawer__panel--parents {
        flex-direction: row;
        flex-wrap: wrap;
        padding-right: 0;
        padding-bottom: 0.75rem;
        gap: 0.5rem;
    }

    .bs-category-link {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }

    .bs-category-drawer__footer-inner {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .bs-category-drawer__footer {
        padding-top: 1rem;
    }

    .bs-category-drawer__footer-inner {
        gap: 1rem;
    }

    .bs-category-drawer__footer-section {
        gap: 0.6rem;
    }
}

