/**
 * Top Pneus - Styles Boutique & Filtres
 *
 * Styles pour la page boutique WooCommerce :
 * - Layout sidebar + produits
 * - Panneau de filtres (desktop & mobile)
 * - Filtres actifs (pills)
 * - Options saison/gamme
 * - Sliders EU labels
 *
 * @package TopPneus
 * @since 2.0.0
 */

/* ==========================================================================
   SHOP LAYOUT - FILTRES + PRODUITS
   ========================================================================== */

.tp-shop-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--tp-space-md);
    align-items: start;
    max-width: 100%;
    margin: 0;
    padding: 0 var(--tp-space-lg) var(--tp-space-md);
}

.tp-shop-sidebar {
    position: sticky;
    top: calc(var(--tp-header-sticky-height, 95px) + 28px);
    height: fit-content;
    align-self: start;
    max-height: calc(100vh - var(--tp-header-sticky-height, 95px) - 28px);
    overflow-y: auto;
    margin: 0;
    padding: 0;
}

.tp-shop-products {
    min-width: 0;
    margin: 0;
    padding: 0;
}
body.admin-bar .tp-shop-sidebar {
    top: calc(var(--tp-header-sticky-height, 95px) + 32px + 28px);
    max-height: calc(100vh - var(--tp-header-sticky-height, 95px) - 32px - 28px);
}

/* Prevent Blocksy containers from clipping sticky sidebar.
   Without this, overflow:hidden/clip on any ancestor breaks position:sticky.
   #main-container has overflow:clip in Blocksy main.min.css — must override. */
#main-container,
.tp-shop-layout,
.site-main,
.site-main .ct-container,
.site-main article,
.site-main .entry-content,
.site-main [data-content] {
    overflow: visible !important;
}

/* Sidebar plus étroite */
.tp-filters-panel {
    font-size: 0.9em;
}

/* Reset Blocksy label defaults (margin: 0 0 .5em 0) inside filter panel */
.tp-filters-panel label {
    margin: 0;
}

/* Filtres actifs - pills en haut de la grille */
.tp-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--tp-gray-100);
    border: 1px solid var(--tp-gray-200);
    border-radius: var(--tp-radius-lg);
}

.tp-active-filters-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tp-gray-600);
    margin-right: 4px;
}

.tp-active-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-300);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--tp-gray-700);
    text-decoration: none;
    transition: all 0.15s ease;
}

.woocommerce .tp-active-filter-pill:hover {
    background: var(--tp-gray-50);
    border-color: var(--tp-gray-500);
    color: var(--tp-gray-700);
}

.tp-active-filter-pill svg {
    color: var(--tp-gray-400);
    transition: color 0.15s ease;
}

.woocommerce .tp-active-filter-pill:hover svg {
    color: var(--tp-red);
}

.tp-filter-pill-text {
    white-space: nowrap;
}

.tp-clear-all-filters {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tp-gray-500);
    text-decoration: underline;
    margin-left: 8px;
    transition: color 0.15s ease;
}

.tp-clear-all-filters:hover {
    color: var(--tp-red);
}

/* ========== MOBILE TOOLBAR (filter toggle + ordering) ========== */

/* Hidden on desktop */
.tp-mobile-toolbar {
    display: none;
}

/* Bouton filtre (shared base for mobile + desktop) */
.tp-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--tp-primary);
    color: var(--tp-white);
    border: none;
    border-radius: var(--tp-radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.tp-filter-toggle:hover {
    background: var(--tp-secondary);
}

.tp-filter-toggle svg {
    flex-shrink: 0;
}

/* Desktop filter toggle — visible in shop toolbar */
.tp-desktop-filter-toggle {
    display: inline-flex;
    padding: 6px 14px;
    font-size: var(--tp-text-sm);
    border-radius: var(--tp-radius-sm);
}

/* Desktop sidebar collapse */
.tp-shop-layout.sidebar-collapsed .tp-shop-sidebar {
    display: none;
}
.tp-shop-layout.sidebar-collapsed {
    grid-template-columns: 1fr;
}

/* Active filter count badge on mobile toggle */
.tp-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    background: var(--tp-red, #e53e3e);
    color: var(--tp-white);
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    line-height: 1;
}

/* Tooltip for index fields */
.tp-tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: var(--tp-gray-400);
    cursor: help;
}

.tp-tooltip-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--tp-gray-900, #1a1a1a);
    color: var(--tp-white);
    font-size: 12px;
    line-height: 1.4;
    border-radius: 4px;
    white-space: normal;
    max-width: 280px;
    z-index: 100;
    pointer-events: none;
}

.tp-tooltip-trigger:hover .tp-tooltip-content,
.tp-tooltip-trigger:focus .tp-tooltip-content {
    display: block;
}

/* Overlay backdrop - caché par défaut */
.tp-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tp-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Header mobile sidebar - caché sur desktop */
.tp-sidebar-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: var(--tp-space-md) var(--tp-space-lg);
    padding-top: max(var(--tp-space-md), env(safe-area-inset-top));
    border-bottom: 1px solid var(--tp-gray-200);
    background: var(--tp-primary);
    color: var(--tp-white);
    min-height: 60px;
}

.tp-sidebar-mobile-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--tp-white);
}

.tp-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    color: var(--tp-white);
    border-radius: var(--tp-radius-md);
    transition: all 0.2s ease;
}

.tp-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--tp-white);
}

/* Lien réinitialiser dans header mobile - même style que bouton fermer */
.tp-mobile-reset,
.tp-mobile-reset:link,
.tp-mobile-reset:visited {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--tp-white) !important;
    text-decoration: none !important;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--tp-radius-md);
    transition: all 0.2s ease;
    margin-left: auto;
    margin-right: var(--tp-space-sm);
}

.tp-mobile-reset:hover,
.tp-mobile-reset:active {
    background: rgba(255, 255, 255, 0.25);
    color: var(--tp-white) !important;
}

/* Filtres actifs sur mobile : scroll horizontal */
@media (max-width: 1024px) {
    .tp-active-filters-wrapper {
        padding: 0 var(--tp-space-sm);
    }

    .tp-active-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 12px;
        margin-bottom: 12px;
        scrollbar-width: none;
    }

    .tp-active-filters::-webkit-scrollbar {
        display: none;
    }
}

/* TABLET & MOBILE: Sidebar en overlay */
@media (max-width: 1024px) {
    /* Mobile toolbar: filter toggle + ordering on same line */
    .tp-mobile-toolbar {
        display: flex;
        align-items: center;
        gap: var(--tp-space-sm);
        padding: var(--tp-space-sm);
        margin-top: var(--tp-space-sm);
        margin-bottom: var(--tp-space-sm);
    }

    .tp-filter-toggle {
        display: flex;
        padding: 0 20px;
    }

    /* Mobile ordering: fill remaining space */
    .tp-mobile-ordering {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
    }

    .tp-mobile-ordering .woocommerce-ordering {
        margin: 0;
        flex: 1;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Blocksy sort icon — vertically center within toolbar */
    .tp-mobile-ordering .ct-sort-icon {
        flex-shrink: 0;
    }

    /* Uniform height for filter button and select (44px WCAG touch target) */
    .tp-mobile-toolbar .tp-filter-toggle,
    .tp-mobile-ordering .woocommerce-ordering select {
        height: 44px;
        box-sizing: border-box;
    }

    .tp-mobile-ordering .woocommerce-ordering select {
        width: 100%;
        padding: 0 32px 0 12px;
        font-size: 0.85rem;
        border: 1px solid var(--tp-gray-300);
        border-radius: var(--tp-radius-md);
        background: var(--tp-white);
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
    }

    /* Hide entire desktop toolbar on mobile (duplicated in mobile toolbar) */
    .tp-shop-toolbar {
        display: none !important;
    }

    /* Layout sans sidebar - marges réduites */
    .tp-shop-layout {
        grid-template-columns: 1fr;
        padding-left: var(--tp-space-sm);
        padding-right: var(--tp-space-sm);
    }

    /* Sidebar: slide from top, below the fixed header */
    .tp-shop-sidebar {
        position: fixed !important;
        top: var(--tp-header-height-mobile, 60px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: calc(100vh - var(--tp-header-height-mobile, 60px)) !important;
        height: calc(100dvh - var(--tp-header-height-mobile, 60px)) !important;
        background: var(--tp-white) !important;
        z-index: 999 !important;
        overflow-y: auto;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .tp-shop-sidebar.open {
        transform: translateY(0);
    }

    /* Overlay backdrop — dark + blur */
    .tp-sidebar-overlay {
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    /* Header mobile sticky en haut */
    .tp-sidebar-mobile-header {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--tp-primary);
        border-bottom: none;
    }

    /* Cacher le header desktop du panneau filtres */
    .tp-shop-sidebar .tp-filters-header {
        display: none;
    }

    /* Ajuster le panneau de filtres */
    .tp-shop-sidebar .tp-filters-panel {
        border: none;
        border-radius: 0;
        box-shadow: none;
        flex: 1;
        overflow-y: visible;
    }

    /* Padding confortable pour le contenu */
    .tp-shop-sidebar .tp-filters-content {
        padding: var(--tp-space-md);
    }

    /* Bouton rechercher plus grand sur mobile */
    .tp-shop-sidebar .tp-submit-btn {
        padding: 16px 24px;
        font-size: 1rem;
    }
}

/* Panneau de filtres - compact */
.tp-filters-panel {
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-200);
    border-radius: var(--tp-radius-lg);
    box-shadow: var(--tp-shadow-sm);
    overflow: clip;
}

.tp-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--tp-space-sm) var(--tp-space-md);
    border-bottom: 1px solid var(--tp-gray-200);
}

.tp-filters-title {
    display: flex;
    align-items: center;
    gap: var(--tp-space-xs);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tp-gray-900);
    margin: 0;
}

.tp-filters-title svg {
    width: 16px;
    height: 16px;
}

.tp-filters-reset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tp-red, #c00);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--tp-red, #c00);
    border-radius: var(--tp-radius-sm);
    transition: all 0.15s ease;
}

.tp-filters-reset svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.tp-filters-reset:hover,
.tp-filters-reset:active {
    color: var(--tp-white) !important;
    background: var(--tp-red, #c00) !important;
    text-decoration: none !important;
}

.tp-filters-reset:hover svg,
.tp-filters-reset:active svg {
    stroke: var(--tp-white);
}

.tp-filters-body {
    padding: var(--tp-space-sm) var(--tp-space-md);
}

.tp-filter-section {
    margin-bottom: var(--tp-space-sm);
}

.tp-filter-section:last-child {
    margin-bottom: 0;
}

.tp-filter-section-compact {
    margin-bottom: var(--tp-space-xs);
}

.tp-filter-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--tp-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--tp-space-xs);
}

.tp-dimension-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--tp-space-xs);
}

.tp-filter-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--tp-gray-600);
    margin-bottom: 2px;
}

.tp-filter-field select,
.tp-filter-select-full {
    width: 100%;
    padding: 8px 28px 8px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--tp-gray-900);
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-300);
    border-radius: var(--tp-radius-md);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-filter-field select:hover,
.tp-filter-select-full:hover {
    border-color: var(--tp-gray-500);
}

.tp-filter-field select:focus,
.tp-filter-select-full:focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

/* Select avec valeur sélectionnée - effet rouge */
.tp-filter-field select.has-value,
.tp-filter-select-full.has-value,
.tp-combobox-select.has-value {
    border-color: var(--tp-red);
    background-color: var(--tp-red-light);
    color: var(--tp-red);
}

/* Index exact checkbox — .tp-filter-field prefix needed to override `.tp-filter-field label { display: block }` */
.tp-filter-field .tp-exact-check {
    display: none;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.tp-filter-field .tp-exact-check.visible {
    display: flex;
}

.tp-exact-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tp-exact-box {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--tp-gray-400);
    border-radius: 3px;
    background: var(--tp-white);
    flex-shrink: 0;
    transition: all 0.15s ease;
    position: relative;
}

.tp-exact-check input:checked ~ .tp-exact-box {
    background: var(--tp-red);
    border-color: var(--tp-red);
}

.tp-exact-check input:checked ~ .tp-exact-box::after {
    content: '';
    position: absolute;
    left: 3.5px;
    top: 1px;
    width: 4px;
    height: 7px;
    border: solid var(--tp-white);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.tp-exact-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--tp-gray-600);
    line-height: 1;
}

.tp-exact-check input:checked ~ .tp-exact-label {
    color: var(--tp-red);
}

.tp-exact-check:hover .tp-exact-box {
    border-color: var(--tp-gray-600);
}

.tp-exact-check:hover input:checked ~ .tp-exact-box {
    border-color: var(--tp-red);
}

/* Index hint text (dynamic feedback under selects) */
.tp-index-hint {
    display: none;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    font-size: 0.65rem;
    font-style: italic;
    color: var(--tp-gray-500);
    line-height: 1;
}

.tp-index-hint.visible {
    display: flex;
}

.tp-info-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Saison options - compact avec icônes */
.tp-saison-options {
    display: flex;
    gap: 3px;
}

.tp-saison-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-300);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 34px;
    box-sizing: border-box;
}

/* sr-only: accessible to screen readers but visually hidden */
.tp-saison-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tp-saison-option:hover {
    border-color: var(--tp-gray-500);
}

.tp-saison-option:hover .tp-saison-icon svg,
.tp-saison-option:hover .tp-saison-icon .tp-filter-icon {
    opacity: 0.8;
}

.tp-saison-option.selected,
.tp-saison-option:has(input:checked) {
    color: var(--tp-red);
    background: var(--tp-red-light);
    border-color: var(--tp-red);
}

.tp-saison-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-saison-icon svg,
.tp-saison-icon .tp-filter-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}


.tp-saison-option:has(input:checked) .tp-saison-icon svg,
.tp-saison-option:has(input:checked) .tp-saison-icon .tp-filter-icon {
    opacity: 1;
}

.tp-saison-label {
    /* Hidden per design decision: icons only, label in aria-label */
    display: none;
}

/* Vehicle type options */
.tp-vehicle-options {
    display: flex;
    gap: var(--tp-space-sm);
}

.tp-vehicle-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--tp-space-xs) 0;
    border: 1px solid var(--tp-gray-200);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color var(--tp-transition-fast), background var(--tp-transition-fast);
    min-height: 36px;
    position: relative;
}

/* sr-only: accessible to screen readers but visually hidden */
.tp-vehicle-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tp-vehicle-option:hover {
    border-color: var(--tp-gray-500);
}

.tp-vehicle-option.selected,
.tp-vehicle-option:has(input:checked) {
    color: var(--tp-red);
    background: var(--tp-red-light);
    border-color: var(--tp-red);
}

.tp-vehicle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-vehicle-icon .tp-filter-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity var(--tp-transition-fast);
}

.tp-vehicle-option:has(input:checked) .tp-vehicle-icon .tp-filter-icon {
    opacity: 1;
}

.tp-vehicle-label {
    font-size: var(--tp-text-xs);
    line-height: 1;
    margin-top: 2px;
}

/* Gamme (Premium/Quality/Budget) - Compact */
.tp-gamme-options {
    display: flex;
    gap: 3px;
}

.tp-gamme-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-300);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 32px;
    box-sizing: border-box;
}

.tp-gamme-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tp-gamme-option:hover {
    border-color: var(--tp-gray-500);
    color: var(--tp-gray-900);
}

.tp-gamme-option.selected,
.tp-gamme-option:has(input:checked) {
    color: var(--tp-red);
    background: var(--tp-red-light);
    border-color: var(--tp-red);
}

.tp-gamme-icon {
    display: none;
}

.tp-gamme-label {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

/* Label européen - Sliders */
.tp-eu-labels {
    margin-top: var(--tp-space-md);
    padding-top: var(--tp-space-md);
    border-top: 1px solid var(--tp-gray-200);
}

.tp-eu-label-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tp-gray-600);
    margin-bottom: var(--tp-space-sm);
}

.tp-eu-slider-group {
    margin-bottom: var(--tp-space-sm);
}

.tp-eu-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tp-eu-slider-label {
    font-size: 0.7rem;
    color: var(--tp-gray-600);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tp-eu-icon {
    width: 14px;
    height: 14px;
    color: var(--tp-gray-500);
}

.tp-eu-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.tp-eu-slider-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tp-red);
    min-width: 52px;
    text-align: right;
    white-space: nowrap;
}

.tp-eu-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--tp-gray-200);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background 0.1s ease;
}

.tp-eu-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--tp-red);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.tp-eu-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.tp-eu-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--tp-red);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Prix */
.tp-price-row {
    display: flex;
    align-items: center;
    gap: var(--tp-space-sm);
}

.tp-price-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tp-gray-900);
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-300);
    border-radius: var(--tp-radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-price-input::placeholder {
    color: var(--tp-gray-400);
    font-weight: 400;
}

.tp-price-input:focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.tp-price-sep {
    color: var(--tp-gray-400);
    font-size: 0.85rem;
}

/* Divider & Advanced toggle */
.tp-filter-divider {
    height: 1px;
    background: var(--tp-gray-200);
    margin: var(--tp-space-lg) 0;
}

.tp-advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--tp-gray-600);
    background: var(--tp-gray-50);
    border: 1px solid var(--tp-gray-200);
    border-radius: var(--tp-radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.tp-advanced-toggle:hover {
    background: var(--tp-gray-100);
    border-color: var(--tp-gray-400);
    color: var(--tp-gray-800);
}

.tp-advanced-toggle svg {
    transition: transform 0.2s ease;
}

.show-advanced .tp-advanced-toggle svg {
    transform: rotate(180deg);
}

/* Advanced filters panel */
.tp-advanced-filters {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease;
}

.show-advanced .tp-advanced-filters {
    max-height: 1500px;
    opacity: 1;
    margin-top: var(--tp-space-sm);
}

.tp-advanced-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--tp-space-md);
    margin-bottom: var(--tp-space-md);
}

/* Checkboxes */
.tp-checkbox-row {
    display: flex;
    gap: var(--tp-space-md);
}

.tp-checkbox-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--tp-space-sm);
    padding: 12px 14px;
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-300);
    border-radius: var(--tp-radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--tp-gray-700);
    transition: all 0.15s ease;
}

.tp-checkbox-item input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tp-checkbox-item:hover {
    border-color: var(--tp-gray-400);
}

.tp-checkbox-item.checked,
.tp-checkbox-item:has(input:checked) {
    background: var(--tp-red-light);
    border-color: var(--tp-red);
    color: var(--tp-red);
}

.tp-checkbox-box {
    width: 16px;
    height: 16px;
    border: 2px solid var(--tp-gray-300);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tp-checkbox-item:has(input:checked) .tp-checkbox-box {
    background: var(--tp-red);
    border-color: var(--tp-red);
}

.tp-checkbox-item:has(input:checked) .tp-checkbox-box::after {
    content: '✓';
    color: var(--tp-white);
    font-size: 10px;
    font-weight: 700;
}

/* Filtres avancés compacts - 1 par ligne */
.tp-advanced-compact {
    display: flex;
    flex-direction: column;
    gap: var(--tp-space-xs);
}

/* Dropdown dans les filtres avancés */
.tp-advanced-dropdown {
    margin-top: var(--tp-space-md);
    padding-top: var(--tp-space-md);
    border-top: 1px solid var(--tp-gray-200);
}

.tp-advanced-dropdown-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tp-gray-500);
    margin-bottom: var(--tp-space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tp-advanced-dropdown select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tp-gray-200);
    border-radius: var(--tp-radius-md);
    font-size: 0.85rem;
    color: var(--tp-gray-700);
    background: var(--tp-white);
    cursor: pointer;
}

.tp-advanced-dropdown select:hover {
    border-color: var(--tp-gray-400);
}

/* Multi-select */
.tp-multiselect-wrapper {
    position: relative;
}

.tp-multiselect {
    width: 100%;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--tp-gray-200);
    border-radius: var(--tp-radius-md);
    font-size: 0.85rem;
    color: var(--tp-gray-700);
    background: var(--tp-white);
    cursor: pointer;
}

.tp-multiselect:hover {
    border-color: var(--tp-gray-400);
}

.tp-multiselect:focus {
    outline: none;
    border-color: var(--tp-red);
    box-shadow: 0 0 0 2px rgba(227, 24, 55, 0.1);
}

.tp-multiselect option {
    padding: 6px 10px;
}

.tp-multiselect option:checked {
    background: linear-gradient(0deg, var(--tp-red-light) 0%, var(--tp-red-light) 100%);
    color: var(--tp-red);
}

.tp-multiselect-sm {
    min-height: 32px;
    font-size: 0.8rem;
}

/* Dropdown avec checkboxes */
.tp-dropdown-check {
    position: relative;
}

.tp-dropdown-check-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--tp-gray-200);
    border-radius: var(--tp-radius-md);
    background: var(--tp-white);
    font-size: 0.85rem;
    color: var(--tp-gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
}

.tp-dropdown-check-btn:hover {
    border-color: var(--tp-gray-400);
}

.tp-dropdown-check.open .tp-dropdown-check-btn {
    border-color: var(--tp-red);
    box-shadow: 0 0 0 2px rgba(227, 24, 55, 0.1);
}

.tp-dropdown-check.open .tp-dropdown-check-btn svg {
    transform: rotate(180deg);
}

.tp-dropdown-check-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tp-dropdown-check-text {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-dropdown-check-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    margin-top: 4px;
    padding: 6px 0;
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-200);
    border-radius: var(--tp-radius-md);
    box-shadow: var(--tp-shadow-lg);
    max-height: 200px;
    overflow-y: auto;
}

.tp-dropdown-check.open .tp-dropdown-check-menu {
    display: block;
}

/* Dropdown search field */
.tp-dropdown-search-wrap {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 6px 8px;
    background: var(--tp-white, #fff);
    border-bottom: 1px solid var(--tp-gray-100, #f0f0f0);
}
.tp-dropdown-search {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--tp-gray-200, #e5e7eb);
    border-radius: var(--tp-radius-sm, 4px);
    font-size: 0.8rem;
    outline: none;
}
.tp-dropdown-search:focus {
    border-color: var(--tp-red, #E31837);
}

.tp-dropdown-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--tp-gray-700);
    transition: background 0.1s ease;
}

.tp-dropdown-check-item:hover {
    background: var(--tp-gray-100);
}

.tp-dropdown-check-item.checked {
    background: var(--tp-red-light);
    color: var(--tp-red);
}

.tp-dropdown-check-item input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tp-dropdown-check-box {
    width: 16px;
    height: 16px;
    border: 2px solid var(--tp-gray-300);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tp-dropdown-check-item.checked .tp-dropdown-check-box,
.tp-dropdown-check-item:has(input:checked) .tp-dropdown-check-box {
    background: var(--tp-red);
    border-color: var(--tp-red);
}

.tp-dropdown-check-item.checked .tp-dropdown-check-box::after,
.tp-dropdown-check-item:has(input:checked) .tp-dropdown-check-box::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid var(--tp-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Version compacte pour les filtres avancés */
.tp-dropdown-check-sm .tp-dropdown-check-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
}

.tp-dropdown-check-sm .tp-dropdown-check-item {
    padding: 6px 10px;
    font-size: 0.8rem;
}

.tp-dropdown-check-sm .tp-dropdown-check-box {
    width: 14px;
    height: 14px;
}

.tp-checkbox-item-compact {
    display: flex;
    align-items: center;
    gap: var(--tp-space-sm);
    padding: 8px 12px;
    background: var(--tp-white);
    border: 1px solid var(--tp-gray-200);
    border-radius: var(--tp-radius-md);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--tp-gray-600);
    transition: all 0.15s ease;
}

.tp-checkbox-item-compact input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tp-checkbox-item-compact:hover {
    border-color: var(--tp-gray-400);
    color: var(--tp-gray-700);
}

.tp-checkbox-item-compact.checked,
.tp-checkbox-item-compact:has(input:checked) {
    background: var(--tp-red-light);
    border-color: var(--tp-red);
    color: var(--tp-red);
}

.tp-checkbox-item-compact .tp-checkbox-box {
    width: 14px;
    height: 14px;
    border: 2px solid var(--tp-gray-300);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tp-checkbox-item-compact:has(input:checked) .tp-checkbox-box {
    background: var(--tp-red);
    border-color: var(--tp-red);
}

.tp-checkbox-item-compact:has(input:checked) .tp-checkbox-box::after {
    content: '✓';
    color: var(--tp-white);
    font-size: 9px;
    font-weight: 700;
}

/* Footer - compact */
.tp-filters-footer {
    padding: var(--tp-space-sm) var(--tp-space-md);
    background: var(--tp-gray-50);
    border-top: 1px solid var(--tp-gray-200);
}

.tp-filters-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--tp-space-xs);
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tp-white);
    background: var(--tp-gray-900);
    border: none;
    border-radius: var(--tp-radius-md);
    cursor: pointer;
    transition: background 0.15s ease;
}

.tp-filters-submit svg {
    width: 14px;
    height: 14px;
}

.tp-filters-submit:hover {
    background: var(--tp-red);
}

/* Mobile filters toggle */
@media (max-width: 1024px) {
    .tp-filters-panel {
        margin-bottom: var(--tp-space-lg);
    }

    /* Submit button sticky at bottom of mobile sidebar */
    .tp-shop-sidebar.open .tp-filters-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* ==========================================================================
   RESULT COUNT & ORDERING BAR
   ========================================================================== */

.tp-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--tp-space-sm) 0;
    margin-bottom: var(--tp-space-sm);
    border-bottom: 1px solid var(--tp-gray-200);
    font-size: var(--tp-text-sm);
    color: var(--tp-gray-600);
}

.tp-shop-toolbar .woocommerce-result-count {
    margin: 0;
    padding: 0;
}

.tp-shop-toolbar-actions {
    display: flex;
    align-items: center;
    gap: var(--tp-space-sm);
}

.tp-shop-toolbar .woocommerce-ordering {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Show Blocksy sort icon on desktop too (Blocksy hides it via ct-hidden-lg/md) */
.tp-shop-toolbar .ct-sort-icon {
    display: inline-block !important;
}

.tp-shop-toolbar .woocommerce-ordering select {
    border: 1px solid var(--tp-gray-300);
    border-radius: var(--tp-radius-sm);
    padding: var(--tp-space-xs) var(--tp-space-sm);
    font-size: var(--tp-text-sm);
    background: var(--tp-white);
}

/* ==========================================================================
   NO PRODUCTS FOUND
   ========================================================================== */

.tp-no-products {
    text-align: center;
    padding: var(--tp-space-2xl) var(--tp-space-lg);
}

.tp-no-products-msg {
    font-size: var(--tp-text-lg);
    color: var(--tp-gray-600);
    margin-bottom: var(--tp-space-lg);
}

.tp-no-products-actions {
    display: flex;
    gap: var(--tp-space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   AJAX LOADING STATE
   ========================================================================== */

.tp-shop-products.tp-loading {
    position: relative;
    pointer-events: none;
    min-height: 300px;
}

.tp-shop-products.tp-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.tp-shop-products.tp-loading::before {
    content: '';
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--tp-gray-200);
    border-top-color: var(--tp-red);
    border-radius: 50%;
    animation: tp-spin 0.7s linear infinite;
    z-index: 11;
}

@keyframes tp-spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

/* =========================================================================
   Cascading Filters — unavailable options
   ========================================================================= */

/* Greyed out options (vehicle, saison, gamme, indices, brands) */
.tp-vehicle-option.tp-option-unavailable,
.tp-saison-option.tp-option-unavailable,
.tp-gamme-option.tp-option-unavailable {
    opacity: 0.45 !important;
    filter: grayscale(100%);
    cursor: not-allowed;
    pointer-events: none;
}

/* Greyed out advanced checkboxes (specs) */
.tp-checkbox-item-compact.tp-option-unavailable {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
select option.tp-option-unavailable {
    color: var(--tp-gray-400, #9ca3af);
}
select option:disabled {
    color: var(--tp-gray-400, #9ca3af);
}

/* Brands dropdown: greyed items pushed to bottom */
.tp-dropdown-check-item.tp-option-unavailable {
    opacity: 0.45;
    order: 999;
}
.tp-dropdown-check-item.tp-option-unavailable label,
.tp-dropdown-check-item.tp-option-unavailable span {
    cursor: not-allowed;
}

/* Advanced section: hide entirely when disabled (moto) */
.tp-advanced-section.tp-advanced-disabled {
    display: none !important;
}

/* Screen reader live region */
#tp-filter-live {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* =========================================================================
   Gamme / Category Descriptions
   ========================================================================= */
.tp-gamme-description {
    margin-top: 0;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--tp-gray-50, #f7fafc);
    border-radius: 8px;
    border: 1px solid var(--tp-gray-200, #e2e8f0);
}
.tp-gamme-content h2 {
    font-size: var(--tp-text-xl, 1.25rem);
    font-weight: 700;
    color: var(--tp-gray-900, #1a202c);
    margin: 0 0 12px;
}
.tp-gamme-content p {
    font-size: var(--tp-text-sm, 0.875rem);
    color: var(--tp-gray-600, #718096);
    line-height: 1.7;
    margin: 0;
}
.tp-gamme-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--tp-gray-200, #e2e8f0);
}
.tp-gamme-stat {
    font-size: var(--tp-text-sm, 0.875rem);
    color: var(--tp-gray-600, #718096);
}
.tp-gamme-stat strong {
    color: var(--tp-gray-900, #1a202c);
}
@media (max-width: 689px) {
    .tp-gamme-description {
        padding: 16px;
    }
    .tp-gamme-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* WCAG touch target: dimension selects on mobile */
@media (max-width: 1024px) {
    .tp-filter-field select,
    .tp-filter-select-full {
        min-height: 44px;
        font-size: 1rem;
        padding: 10px 32px 10px 12px;
    }
}

/* Mobile submit button count */
.tp-filters-submit-count {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.85;
}
.tp-filters-submit-count:empty {
    display: none;
}

