/**
 * Letica Product Filters - Frontend Styling
 * 60FPS Mobile-First & Desktop Widget
 *
 * @package Botiga_Child
 */

:root {
    --lpf-gold: #774d32;
    --lpf-gold-hover: #916b46;
    --lpf-bg-grey: #f8f8f8;
    --lpf-border: #e6e6e6;
    --lpf-text: #2b2b2b;
    --lpf-radius: 10px;
    --lpf-shadow: 0px 1px 13px -3px rgba(216, 216, 216, 1);
}

/* --- DESKTOP SIDEBAR WIDGET --- */
.sidebar .sidebar__title h3 {
    font-size: 1rem !important;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #774d32;
}
.sidebar .sidebar__title {
    padding: 7px 12px !important;
    border: 1px solid #774d32 !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}
.letica-filter-sidebar {
    margin-top: 25px;
    margin-bottom: 25px;
}
.sidebar__title.letica-filter-title {
    padding: 10px 16px !important;
}
.sidebar__title.letica-filter-title h3 {
    font-size: 1rem !important;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: #774d32;
    letter-spacing: 0.2px;
}

/* Aktywne filtry */
.letica-active-filters-section {
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--lpf-border);
}
.letica-active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.letica-active-filters-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.letica-clear-all-link {
    font-size: 0.75rem;
    color: #b33939;
    text-decoration: none;
    font-weight: 500;
    padding: 3px 10px;
    border: 1px solid #f0d0d0;
    background: #fff8f8;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.letica-clear-all-link:hover {
    color: #fff;
    background: #b33939;
    border-color: #b33939;
}

/* Aktywne chipy */
.letica-active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
}
.letica-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--lpf-gold);
    color: var(--lpf-gold);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    line-height: 1.3;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.letica-chip:hover {
    background: #fdf5f0;
    border-color: #a8724d;
    color: #a8724d;
}
.letica-chip--clear-all {
    border-color: #e0b4b4;
    color: #b33939;
    background: #fff8f8;
}
.letica-chip--clear-all:hover {
    background: #b33939;
    color: #fff;
    border-color: #b33939;
}
.letica-chip__remove {
    font-size: 1rem;
    line-height: 1;
    color: #999;
    transition: color 0.2s ease;
    margin-left: 2px;
}
.letica-chip:hover .letica-chip__remove {
    color: #b33939;
}

/* Przycisk na dole sidebara */
.letica-filter-sidebar__footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--lpf-border);
}
.letica-sidebar-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background: #fff;
    color: #666;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.letica-sidebar-reset-btn:hover {
    border-color: #b33939;
    color: #b33939;
    background: #fff8f8;
}

/* Grupy akordeonu */
.letica-filter-group {
    border-bottom: 1px solid var(--lpf-border);
    padding: 12px 0;
}
.letica-filter-group:last-child {
    border-bottom: none;
}
.letica-filter-group__header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 8px 4px;
    cursor: pointer;
    text-align: left;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--lpf-text);
}
.letica-filter-group__arrow {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}
.letica-filter-group.is-collapsed .letica-filter-group__arrow {
    transform: rotate(-90deg);
}
.letica-filter-group.is-collapsed .letica-filter-group__content {
    display: none;
}
.letica-filter-group__content {
    padding-top: 10px;
    padding-bottom: 4px;
}

/* Swatches (Kolory) */
.letica-swatch-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 250px;
    overflow-y: auto;
    padding: 2px 6px 2px 2px;
}
.letica-swatch-grid::-webkit-scrollbar {
    width: 4px;
}
.letica-swatch-grid::-webkit-scrollbar-thumb {
    background: #dcdcdc;
    border-radius: 4px;
}
.letica-swatch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--lpf-text);
    width: 100%;
    box-sizing: border-box;
}
.letica-swatch-item:hover {
    background: #ececec;
    color: var(--lpf-gold);
}
.letica-swatch-item.is-active {
    background: #f0e9e2;
    color: var(--lpf-gold);
    font-weight: 600;
}
.letica-swatch-item input {
    display: none;
}
.letica-swatch-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    transition: transform 0.2s ease;
}
.letica-swatch-item:hover .letica-swatch-color {
    transform: scale(1.1);
}
.letica-swatch-item.is-active .letica-swatch-color {
    outline: 2px solid var(--lpf-gold);
    outline-offset: 2px;
    transform: scale(1.1);
}
.letica-swatch-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pills (Rozmiar/Format) */
.letica-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px;
}
.letica-pill-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--lpf-border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.84rem;
    line-height: 1.3;
    transition: all 0.2s ease;
}
.letica-pill-item input {
    display: none;
}
.letica-pill-item:hover {
    border-color: var(--lpf-gold);
}
.letica-pill-item.is-active {
    background: var(--lpf-gold);
    color: #fff;
    border-color: var(--lpf-gold);
}
.letica-pill-item .letica-opt-count {
    opacity: 0.7;
    font-size: 0.75rem;
}
.letica-pill-item.is-active .letica-opt-count {
    color: #fff;
    opacity: 0.85;
}

/* Checkbox list (Branże, Kolekcje, Motywy) */
.letica-checkbox-list {
    list-style: none !important;
    padding: 2px 4px !important;
    margin: 0 !important;
    max-height: 220px;
    overflow-y: auto;
}
.letica-checkbox-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.86rem;
    line-height: 1.4;
    color: #444;
    transition: background 0.15s ease, color 0.15s ease;
}
.letica-checkbox-item label:hover {
    color: var(--lpf-gold);
    background: #f7f7f7;
}
.letica-checkbox-item input[type="checkbox"] {
    accent-color: var(--lpf-gold);
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}
.letica-opt-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: #888;
    padding-left: 6px;
}

/* --- MOBILE-FIRST UI (TELEFONY I TABLETY) --- */
.letica-mobile-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 5px;
}
.letica-mobile-filter-bar__row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.letica-mobile-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    min-height: 46px;
    border: 1px solid #e0b4b4;
    border-radius: var(--lpf-radius);
    background: #fff;
    color: #b33939;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.letica-mobile-reset-btn:hover {
    background: #b33939;
    color: #fff;
}
.letica-mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    background: var(--lpf-bg-grey);
    border: 1px solid var(--lpf-gold);
    border-radius: var(--lpf-radius);
    color: var(--lpf-gold);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.letica-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--lpf-gold);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}
.letica-mobile-active-scroll {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
}
.letica-mobile-active-scroll .letica-active-chips {
    display: inline-flex;
    flex-wrap: nowrap;
}

/* Pływający przycisk na dole */
.letica-floating-filter-btn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--lpf-gold);
    color: #fff;
    border: none;
    border-radius: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}
.letica-floating-filter-btn.is-visible {
    transform: translateY(0);
    opacity: 1;
}
.letica-floating-filter-btn .letica-filter-badge {
    background: #fff;
    color: var(--lpf-gold);
}

/* Mobile Drawer (Bottom Sheet) */
.letica-filter-drawer-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    visibility: hidden;
    transition: visibility 0.3s ease;
}
.letica-filter-drawer-wrapper.is-open {
    visibility: visible;
}
.letica-filter-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}
.letica-filter-drawer-wrapper.is-open .letica-filter-backdrop {
    opacity: 1;
}
.letica-filter-drawer {
    position: relative;
    width: 100%;
    max-height: 88vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 2;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.letica-filter-drawer-wrapper.is-open .letica-filter-drawer {
    transform: translateY(0);
}
.letica-drawer__handle {
    width: 40px;
    height: 5px;
    background: #ccc;
    border-radius: 3px;
    margin: 10px auto 4px auto;
}
.letica-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--lpf-border);
}
.letica-drawer__title {
    margin: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    color: var(--lpf-text);
}
.letica-drawer__close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    color: #666;
}
.letica-drawer__body {
    padding: 15px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}
.letica-drawer__footer {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--lpf-border);
    background: #fff;
}
.letica-btn-reset {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid var(--lpf-border);
    border-radius: var(--lpf-radius);
    background: #fff;
    color: #555;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
}
.letica-btn-submit {
    flex: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: none;
    border-radius: var(--lpf-radius);
    background: var(--lpf-gold);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.letica-btn-submit:hover {
    background: var(--lpf-gold-hover);
}

/* Ukrywanie elementów w zależności od ekranu */
@media (min-width: 1351px) {
    .letica-mobile-filter-bar,
    .letica-floating-filter-btn,
    .letica-filter-drawer-wrapper {
        display: none !important;
    }
}
@media (max-width: 1350px) {
    .letica-filter-sidebar {
        display: none !important;
    }
}