/* ========================================
   FILTER MODAL & FILTER BUTTON
   ======================================== */

.filter-button {
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.filter-button svg line,
.filter-button svg circle {
    stroke: #fff;
}

.filter-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* MODAL FILTRÓW */
.filter-modal {
    position: fixed;
    inset: 0;
    z-index: 21000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.filter-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

/* widoczne okno */
.filter-modal--open {
    pointer-events: auto;
    opacity: 1;
}

/* panel */
.filter-modal__content {
    position: relative;
    margin: 160px auto 0 auto;
    width: 100%;
    max-width: 360px;
    background: #f9fafb;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.55);
    overflow: visible;
    transform: translateY(-25px);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    z-index: 21000;
}

.filter-modal--open .filter-modal__content {
    transform: translateY(0);
}

/* nagłówek */
.filter-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #1d5ad4;
    font-size: 14px;
}

.filter-modal__title {
    font-weight: 600;
}

.filter-modal__clear,
.filter-modal__done {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 7px;
    cursor: pointer;
}

.filter-modal__clear {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
}

.filter-modal__done {
    border: none;
    background: #111827;
    color: #fff;
}

/* body + pola */
.filter-modal__body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #374151;
    position: relative;
}

.filter-field input,
.filter-field select {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 7px 9px;
    font-size: 13px;
    outline: none;
    background: #fff;
}

.filter-field input:focus,
.filter-field select:focus {
    border-color: #18a0fb;
    box-shadow: 0 0 0 1px rgba(24, 160, 251, 0.25);
}

/* ========================================
   CATEGORY FILTER DROPDOWN (Hover-based)
   ======================================== */

.category-filter-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.category-filter__trigger {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.category-filter__trigger:hover {
    border-color: #b3d4fa;
    background: rgba(24, 160, 251, 0.02);
}

.category-filter__trigger-arrow {
    font-size: 10px;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.category-filter__trigger.active .category-filter__trigger-arrow {
    transform: rotate(180deg);
}

.category-filter__main-list {
    display: flex;
    flex-direction: column;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 0;
    margin: 4px 0 0 0;
    max-height: 240px;
    overflow-y: auto;
    flex: 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
}

.category-filter__main-list.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.category-filter__item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    user-select: none;
    white-space: nowrap;
    position: relative;
}

.category-filter__item:hover {
    background: rgba(24, 160, 251, 0.08);
    color: #18a0fb;
    border-left-color: #18a0fb;
}

.category-filter__item.active {
    background: rgba(24, 160, 251, 0.15);
    color: #18a0fb;
    border-left-color: #18a0fb;
    font-weight: 600;
}

.category-filter__item--all {
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
}

.category-filter__item--all:hover {
    background: rgba(24, 160, 251, 0.08);
}

.category-filter__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-filter__arrow {
    font-size: 12px;
    margin-left: 8px;
    opacity: 0.6;
}

/* Subcategories panel - appears on hover */
.category-filter__sub-list {
    position: absolute;
    top: 0;
    left: calc(100% + 4px);
    display: flex;
    flex-direction: column;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 0;
    margin: 0;
    min-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-filter__sub-list.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.category-filter__subitem {
    padding: 18px 20px;
    cursor: pointer;
    font-size: 12px;
    color: #4b5563;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.category-filter__subitem:hover {
    background: rgba(24, 160, 251, 0.1);
    color: #18a0fb;
    border-left-color: #18a0fb;
    padding-left: 16px;
}

.category-filter__subitem.active {
    background: rgba(24, 160, 251, 0.15);
    color: #18a0fb;
    border-left-color: #18a0fb;
    font-weight: 600;
}

/* Scrollbar styling */
.category-filter__main-list::-webkit-scrollbar,
.category-filter__sub-list::-webkit-scrollbar {
    width: 6px;
}

.category-filter__main-list::-webkit-scrollbar-track,
.category-filter__sub-list::-webkit-scrollbar-track {
    background: transparent;
}

.category-filter__main-list::-webkit-scrollbar-thumb,
.category-filter__sub-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.category-filter__main-list::-webkit-scrollbar-thumb:hover,
.category-filter__sub-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}



/* ========================================
   CHECKBOX-BASED CATEGORY FILTER
   ======================================== */

.category-filter__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.category-filter__group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-filter__item-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-filter__checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.category-filter__checkbox-item--sub {
    padding-left: 32px;
}

.category-filter__checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #18a0fb;
    flex-shrink: 0;
}

.category-filter__checkbox-label {
    font-size: 13px;
    color: #374151;
    flex: 1;
}

.category-filter__checkbox-item:hover .category-filter__checkbox-label {
    color: #18a0fb;
}

.category-filter__expand {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 4px;
    color: #6b7280;
    font-size: 12px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.category-filter__expand:hover {
    color: #18a0fb;
}

.category-filter__expand.expanded {
    transform: rotate(180deg);
}

.category-filter__subcategories {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

/* ========================================
   MOBILE CATEGORY FILTER
   ======================================== */

@media (max-width: 768px) {
    .category-filter__list {
        padding: 4px 0;
    }

    .category-filter__checkbox-item {
        padding: 10px 0;
        font-size: 14px;
    }

    .category-filter__checkbox-item--sub {
        padding-left: 40px;
        font-size: 13px;
    }

    .category-filter__checkbox {
        width: 20px;
        height: 20px;
    }
}