/**
 * WooCommerce Product Filter — Styles
 *
 * Layout:
 *   Desktop (>1024px): sidebar on the left
 *   Tablet  (≤1024px): collapsible panel at the top
 *   Mobile  (≤640px):  full-screen overlay drawer
 */

/* =========================================================================
   CSS Custom Properties
   ========================================================================= */

:root {
    --wpf-primary: #071C13;
    --wpf-primary-light: #0d2a1c;
    --wpf-accent: #FFB000;
    --wpf-accent-hover: #E6A000;
    --wpf-bg: #F0F0EF;
    --wpf-bg-soft: rgba(7, 28, 19, 0.45);
    --wpf-border: rgba(240, 240, 239, 0.18);
    --wpf-border-light: rgba(240, 240, 239, 0.1);
    --wpf-text: #F0F0EF;
    --wpf-text-secondary: rgba(240, 240, 239, 0.7);
    --wpf-text-muted: rgba(240, 240, 239, 0.45);
    --wpf-radius: 10px;
    --wpf-radius-sm: 6px;
    --wpf-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --wpf-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --wpf-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --wpf-sidebar-width: 280px;
    --wpf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* =========================================================================
   Archive Layout — Desktop Sidebar Left
   ========================================================================= */

.wpf-archive-layout {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
}

.wpf-products-content {
    flex: 1;
    min-width: 0;
}

/* =========================================================================
   Filter Panel — Base
   ========================================================================= */

.wpf-filter-panel {
    width: var(--wpf-sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 2rem; 
}

.wpf-filter-panel__inner {
    background-image: url('/wp-content/uploads/2026/01/pozadie-drevene.webp');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 176, 0, 0.25);
    border-radius: var(--wpf-radius);
    box-shadow: var(--wpf-shadow);
    overflow: hidden;
}

.wpf-filter-content {
    padding: 1.25rem;
}

/* =========================================================================
   Filter Header
   ========================================================================= */

.wpf-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--wpf-border-light);
}

.wpf-filter-header__title {
    font-family: var(--wpf-font);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--wpf-text);
    margin: 0;
    padding: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.wpf-filter-header__reset {
    font-family: var(--wpf-font);
    font-size: 0.75rem;
    color: var(--wpf-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--wpf-transition);
    white-space: nowrap;
}

.wpf-filter-header__reset:hover {
    color: var(--wpf-accent-hover);
    text-decoration: underline;
}

/* =========================================================================
   Breadcrumb
   ========================================================================= */

.wpf-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding: 0.625rem 0.75rem;
    background: var(--wpf-bg-soft);
    border-radius: var(--wpf-radius-sm);
    font-family: var(--wpf-font);
    font-size: 0.75rem;
    line-height: 1.4;
}

.wpf-breadcrumb__item {
    color: var(--wpf-text-secondary);
    text-decoration: none;
    transition: color var(--wpf-transition);
}

.wpf-breadcrumb__item:hover {
    color: var(--wpf-accent);
}

.wpf-breadcrumb__item--current {
    color: var(--wpf-text);
    font-weight: 600;
}

.wpf-breadcrumb__sep {
    color: var(--wpf-text-muted);
    font-size: 0.6875rem;
}

/* =========================================================================
   Filter Section
   ========================================================================= */

.wpf-filter-section {
    margin-bottom: 1.5rem;
}

.wpf-filter-section:last-of-type {
    margin-bottom: 0.5rem;
}

.wpf-filter-section__title {
    font-family: var(--wpf-font);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--wpf-text);
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* =========================================================================
   Accordion
   ========================================================================= */

.wpf-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--wpf-border-light);
    padding: 0 0 0.625rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    text-align: left;
}

.wpf-accordion-toggle:hover .wpf-filter-section__title {
    color: var(--wpf-accent);
}

.wpf-accordion-chevron {
    flex-shrink: 0;
    color: var(--wpf-text-secondary);
    transition: transform var(--wpf-transition);
}

.wpf-filter-section--accordion.wpf-filter-section--open .wpf-accordion-chevron {
    transform: rotate(180deg);
}

.wpf-accordion-body {
    overflow: hidden;
}

.wpf-filter-section--accordion:not(.wpf-filter-section--open) .wpf-accordion-body {
    display: none;
}

/* =========================================================================
   Category Tree
   ========================================================================= */

.wpf-cat-tree,
.wpf-cat-tree__children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wpf-cat-tree__children {
    padding-left: 1rem;
    margin-top: 0.125rem;
    border-left: 2px solid var(--wpf-border-light);
}

.wpf-cat-tree__item {
    margin: 0;
    padding: 0;
}

.wpf-cat-tree__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.625rem;
    margin: 0.0625rem 0;
    border-radius: var(--wpf-radius-sm);
    text-decoration: none;
    font-family: var(--wpf-font);
    font-size: 0.8125rem;
    color: var(--wpf-text);
    transition: all var(--wpf-transition);
    line-height: 1.3;
}

.wpf-cat-tree__link:hover {
    background: var(--wpf-bg-soft);
    color: var(--wpf-accent);
}

.wpf-cat-tree__item--active > .wpf-cat-tree__link {
    background: #FFB000;
    color: #071C13;
    font-weight: 600;
}

.wpf-cat-tree__item--active > .wpf-cat-tree__link .wpf-cat-tree__count {
    background: rgba(7, 28, 19, 0.25);
    color: #071C13;
}

.wpf-cat-tree__item--ancestor > .wpf-cat-tree__link {
    color: var(--wpf-accent);
    font-weight: 600;
}

.wpf-cat-tree__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpf-cat-tree__count {
    flex-shrink: 0;
    font-size: 0.6875rem;
    color: var(--wpf-text-muted);
    background: var(--wpf-bg-soft);
    padding: 0.125rem 0.4375rem;
    border-radius: 100px;
    font-weight: 500;
    margin-left: 0.5rem;
    min-width: 1.375rem;
    text-align: center;
    transition: all var(--wpf-transition);
}

/* =========================================================================
   Price Range Slider
   ========================================================================= */

.wpf-price-filter {
    padding: 0.25rem 0;
}

.wpf-price-filter__slider {
    position: relative;
    height: 2.5rem;
    display: flex;
    align-items: center;
}

.wpf-price-filter__track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--wpf-border);
    border-radius: 2px;
    pointer-events: none;
}

.wpf-price-filter__range {
    position: absolute;
    height: 100%;
    background: var(--wpf-accent);
    border-radius: 2px;
    transition: left 0.05s, right 0.05s;
}

.wpf-price-filter__input {
    position: absolute;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
    outline: none;
}

.wpf-price-filter__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wpf-bg);
    border: 3px solid var(--wpf-accent);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform var(--wpf-transition), box-shadow var(--wpf-transition);
}

.wpf-price-filter__input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

.wpf-price-filter__input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wpf-bg);
    border: 3px solid var(--wpf-accent);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.wpf-price-filter__values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
    font-family: var(--wpf-font);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wpf-text);
}

.wpf-price-filter__sep {
    color: var(--wpf-text-muted);
    font-weight: 400;
}

.wpf-price-filter__currency {
    font-size: 0.75rem;
    color: var(--wpf-text-secondary);
    font-weight: 500;
}

.wpf-price-filter__apply {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5625rem 1rem;
    background: #FFB000;
    color: #071C13;
    border: none;
    border-radius: var(--wpf-radius-sm);
    font-family: var(--wpf-font);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--wpf-transition), transform var(--wpf-transition);
    letter-spacing: 0.02em;
}

.wpf-price-filter__apply:hover {
    background: #E6A000;
    transform: translateY(-1px);
}

/* =========================================================================
   Mobile Toggle (hidden on desktop)
   ========================================================================= */

.wpf-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background-image: url('/wp-content/uploads/2026/01/pozadie-drevene.webp');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 176, 0, 0.25);
    border-radius: var(--wpf-radius);
    font-family: var(--wpf-font);
    font-size: 0.875rem;
    font-weight: 600;
    color: #F0F0EF;
    cursor: pointer;
    transition: all var(--wpf-transition);
}

.wpf-filter-toggle:hover {
    border-color: #FFB000;
    color: #FFB000;
}

.wpf-filter-toggle__icon {
    flex-shrink: 0;
}

.wpf-filter-toggle__badge {
    margin-left: auto;
    background: var(--wpf-accent);
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    min-width: 1.25rem;
    text-align: center;
}

/* Mobile close button (hidden on desktop) */
.wpf-filter-close {
    display: none;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--wpf-bg-soft);
    border: 1px solid var(--wpf-border);
    border-radius: var(--wpf-radius-sm);
    font-family: var(--wpf-font);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wpf-text);
    cursor: pointer;
    transition: all var(--wpf-transition);
}

.wpf-filter-close:hover {
    background: var(--wpf-border);
}

/* Overlay (mobile drawer backdrop) */
.wpf-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* No results */
.wpf-no-results {
    text-align: center;
    padding: 3rem 1.5rem;
    font-family: var(--wpf-font);
    color: var(--wpf-text-secondary);
}

.wpf-no-results p {
    margin: 0;
    font-size: 0.9375rem;
}

/* Loading state */
.wpf-loading .wpf-products-content {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* =========================================================================
   Tablet (≤1024px) — Filter moves to top, collapsible
   ========================================================================= */

@media (max-width: 1024px) {
    .wpf-archive-layout {
        flex-direction: column;
    }

    .wpf-filter-panel {
        width: 100%;
        position: relative;
        top: 0;
    }

    .wpf-filter-panel__inner {
        border-radius: var(--wpf-radius);
    }

    .wpf-filter-toggle {
        display: flex;
    }

    .wpf-filter-content {
        display: none;
        padding: 1.25rem;
        border-top: 1px solid var(--wpf-border-light);
    }

    .wpf-filter-content.wpf-filter-content--open {
        display: block;
        animation: wpfSlideDown 0.25s ease;
    }

    .wpf-filter-close {
        display: block;
    }
}

/* =========================================================================
   Mobile (≤640px) — Full-screen drawer
   ========================================================================= */

@media (max-width: 640px) {
    .wpf-filter-panel__inner {
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .wpf-filter-toggle {
        border-radius: var(--wpf-radius);
        box-shadow: var(--wpf-shadow);
    }

    .wpf-filter-content {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: none;
        background-image: url('/wp-content/uploads/2026/01/pozadie-drevene.webp');
        background-size: cover;
        background-position: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.5rem;
        animation: none;
    }

    .wpf-filter-content.wpf-filter-content--open {
        display: block;
        animation: wpfDrawerIn 0.3s ease;
    }

    .wpf-filter-overlay.wpf-filter-overlay--visible {
        display: block;
        opacity: 1;
    }

    .wpf-filter-close {
        display: block;
        position: sticky;
        bottom: 0;
        background: #FFB000;
        color: #071C13;
        border: none;
        border-radius: var(--wpf-radius-sm);
        padding: 0.875rem;
        font-weight: 700;
    }

    .wpf-filter-close:hover {
        background: #E6A000;
        color: #071C13;
    }
}

/* =========================================================================
   Animations
   ========================================================================= */

@keyframes wpfSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wpfDrawerIn {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
