/* =====================================================
   TS HOME – FILTROS SIDEBAR
   Poppins | Azul #0A2F75 | Dorado #c9a84c
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --tsh-blue:       #0A2F75;
    --tsh-blue-dark:  #071f50;
    --tsh-blue-light: #e8eef8;
    --tsh-gold:       #c9a84c;
    --tsh-text:       #1a1a1a;
    --tsh-muted:      #777;
    --tsh-border:     #e0e4ea;
    --tsh-white:      #ffffff;
    --tsh-font:       'Poppins', sans-serif;
    --tsh-radius:     8px;
    --tsh-ease:       cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══ WIDGET CONTENEDOR ══ */
#tsh-sidebar-widget {
    background: var(--tsh-white) !important;
    border: 1px solid var(--tsh-border) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    font-family: var(--tsh-font) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ══ HEADER ══ */
#tsh-sidebar-widget .tsh-widget-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 16px 20px !important;
    background: var(--tsh-blue) !important;
    color: var(--tsh-white) !important;
}
#tsh-sidebar-widget .tsh-widget-header svg { flex-shrink: 0; opacity: 0.9; }
#tsh-sidebar-widget .tsh-widget-header > span {
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    flex: 1 !important;
    color: var(--tsh-white) !important;
}
#tsh-sidebar-widget .tsh-reset-all-btn {
    font-family: var(--tsh-font) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: rgba(255,255,255,0.7) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: color 0.2s !important;
}
#tsh-sidebar-widget .tsh-reset-all-btn:hover { color: var(--tsh-white) !important; }

/* ══ CHIPS ACTIVOS ══ */
#tsh-active-filters {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid var(--tsh-border) !important;
    background: var(--tsh-blue-light) !important;
}
#tsh-active-filters:empty { display: none !important; }

#tsh-sidebar-widget .tsh-active-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: var(--tsh-white) !important;
    border: 1px solid rgba(10,47,117,0.25) !important;
    color: var(--tsh-blue) !important;
    font-family: var(--tsh-font) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}
#tsh-sidebar-widget .tsh-active-chip:hover {
    background: var(--tsh-blue) !important;
    color: var(--tsh-white) !important;
    border-color: var(--tsh-blue) !important;
}

/* ══ SECCIONES ══ */
#tsh-sidebar-widget .tsh-widget-section {
    padding: 18px 20px !important;
}
#tsh-sidebar-widget .tsh-widget-section-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
}
#tsh-sidebar-widget .tsh-widget-section-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: var(--tsh-blue) !important;
}
#tsh-sidebar-widget .tsh-reset-single {
    font-family: var(--tsh-font) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: var(--tsh-gold) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    text-decoration: none !important;
    transition: opacity 0.2s !important;
}
#tsh-sidebar-widget .tsh-reset-single:hover { opacity: 0.7 !important; }

#tsh-sidebar-widget .tsh-widget-divider {
    border: none !important;
    border-top: 1px solid var(--tsh-border) !important;
    margin: 0 !important;
}

/* ══ SELECT ══ */
#tsh-sidebar-widget .tsh-select-wrap { position: relative !important; }
#tsh-sidebar-widget .tsh-select-wrap select {
    width: 100% !important;
    padding: 10px 36px 10px 12px !important;
    border: 1.5px solid var(--tsh-border) !important;
    border-radius: var(--tsh-radius) !important;
    background: var(--tsh-white) !important;
    font-family: var(--tsh-font) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--tsh-text) !important;
    appearance: none !important;
    cursor: pointer !important;
    outline: none !important;
    box-sizing: border-box !important;
}
#tsh-sidebar-widget .tsh-select-wrap select:focus {
    border-color: var(--tsh-blue) !important;
    box-shadow: 0 0 0 3px rgba(10,47,117,0.1) !important;
}
#tsh-sidebar-widget .tsh-chevron {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--tsh-muted) !important;
    pointer-events: none !important;
}

/* ══ RANGE SLIDER ══ */
#tsh-sidebar-widget .tsh-range-wrap { display: flex !important; flex-direction: column !important; gap: 14px !important; }
#tsh-sidebar-widget .tsh-range-track {
    position: relative !important;
    height: 4px !important;
    background: var(--tsh-border) !important;
    border-radius: 2px !important;
    margin: 12px 0 4px !important;
}
#tsh-range-fill {
    position: absolute !important;
    height: 100% !important;
    background: var(--tsh-blue) !important;
    border-radius: 2px !important;
    pointer-events: none !important;
}
#tsh-sidebar-widget .tsh-range-track input[type="range"] {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 100% !important;
    height: 4px !important;
    background: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    pointer-events: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
#tsh-sidebar-widget .tsh-range-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    background: var(--tsh-blue) !important;
    border: 2px solid var(--tsh-white) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    pointer-events: all !important;
    box-shadow: 0 1px 4px rgba(10,47,117,0.3) !important;
}
#tsh-sidebar-widget .tsh-range-track input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--tsh-gold) !important;
    transform: scale(1.15) !important;
}
#tsh-sidebar-widget .tsh-price-inputs { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
#tsh-sidebar-widget .tsh-price-field { display: flex !important; flex-direction: column !important; gap: 4px !important; }
#tsh-sidebar-widget .tsh-price-field > span {
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    color: var(--tsh-muted) !important;
}
#tsh-sidebar-widget .tsh-price-input-wrap {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}
#tsh-sidebar-widget .tsh-currency {
    position: absolute !important;
    left: 9px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--tsh-muted) !important;
    pointer-events: none !important;
}
#tsh-sidebar-widget .tsh-price-input-wrap input[type="number"] {
    width: 100% !important;
    padding: 8px 8px 8px 22px !important;
    border: 1.5px solid var(--tsh-border) !important;
    border-radius: var(--tsh-radius) !important;
    font-family: var(--tsh-font) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--tsh-text) !important;
    background: var(--tsh-white) !important;
    outline: none !important;
    box-sizing: border-box !important;
}
#tsh-sidebar-widget .tsh-price-input-wrap input[type="number"]:focus {
    border-color: var(--tsh-blue) !important;
    box-shadow: 0 0 0 3px rgba(10,47,117,0.1) !important;
}
#tsh-sidebar-widget .tsh-price-input-wrap input[type="number"]::-webkit-inner-spin-button { opacity: 0 !important; }

/* ══ LISTA CATEGORÍAS JERÁRQUICA ══ */
#tsh-sidebar-widget .tsh-cat-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#tsh-sidebar-widget .tsh-cat-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 10px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: var(--tsh-text) !important;
    font-family: var(--tsh-font) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
    border: 1.5px solid transparent !important;
    margin-bottom: 2px !important;
    cursor: pointer !important;
}
#tsh-sidebar-widget .tsh-cat-item:hover {
    background: var(--tsh-blue-light) !important;
    color: var(--tsh-blue) !important;
    border-color: rgba(10,47,117,0.15) !important;
}
#tsh-sidebar-widget .tsh-cat-item.active {
    background: var(--tsh-blue) !important;
    color: var(--tsh-white) !important;
    font-weight: 600 !important;
    border-color: var(--tsh-blue) !important;
}

/* Flecha acordeón */
#tsh-sidebar-widget .tsh-cat-arrow {
    flex-shrink: 0 !important;
    color: var(--tsh-muted) !important;
    transition: transform 0.25s var(--tsh-ease) !important;
    margin-right: 6px !important;
}
#tsh-sidebar-widget .tsh-cat-arrow.open {
    transform: rotate(90deg) !important;
}
#tsh-sidebar-widget .tsh-cat-item.active .tsh-cat-arrow {
    color: var(--tsh-white) !important;
}

#tsh-sidebar-widget .tsh-cat-name { flex: 1 !important; }

#tsh-sidebar-widget .tsh-cat-count {
    font-size: 10px !important;
    font-weight: 500 !important;
    opacity: 0.5 !important;
    background: rgba(0,0,0,0.06) !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    margin-left: 6px !important;
    flex-shrink: 0 !important;
}
#tsh-sidebar-widget .tsh-cat-item.active .tsh-cat-count {
    background: rgba(255,255,255,0.2) !important;
    opacity: 0.85 !important;
}

/* ══ ACORDEÓN SUBCATEGORÍAS — CLAVE ══ */
#tsh-sidebar-widget .tsh-cat-children {
    display: none !important;
    padding-left: 14px !important;
    border-left: 2px solid var(--tsh-blue-light) !important;
    margin-left: 8px !important;
    margin-bottom: 4px !important;
}
#tsh-sidebar-widget .tsh-cat-children.open {
    display: block !important;
}
#tsh-sidebar-widget .tsh-cat-children .tsh-cat-item {
    font-size: 12px !important;
    padding: 6px 8px !important;
}
/* Padre con hijos — negrita y cursor de acordeón */
#tsh-sidebar-widget .tsh-cat-has-children > .tsh-cat-item {
    font-weight: 600 !important;
}

/* ══ BOTÓN APLICAR ══ */
#tsh-sidebar-widget .tsh-widget-footer {
    padding: 16px 20px 20px !important;
    border-top: 1px solid var(--tsh-border) !important;
}
#tsh-apply-btn {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 20px !important;
    background: var(--tsh-blue) !important;
    color: var(--tsh-white) !important;
    border: none !important;
    border-radius: var(--tsh-radius) !important;
    font-family: var(--tsh-font) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.25s !important;
    box-sizing: border-box !important;
}
#tsh-apply-btn:hover {
    background: var(--tsh-blue-dark) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(10,47,117,0.3) !important;
}
#tsh-result-count {
    background: rgba(255,255,255,0.2) !important;
    border-radius: 20px !important;
    padding: 2px 9px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

/* ══ LOADER ══ */
#tsh-loader {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99997 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255,255,255,0.65) !important;
    backdrop-filter: blur(3px) !important;
}
.tsh-spinner {
    width: 38px !important;
    height: 38px !important;
    border: 3px solid var(--tsh-blue-light) !important;
    border-top-color: var(--tsh-blue) !important;
    border-radius: 50% !important;
    animation: tsh-spin 0.7s linear infinite !important;
}
@keyframes tsh-spin { to { transform: rotate(360deg); } }
#tsh-loader.tsh-hidden { display: none !important; }

/* ══ MOBILE ══ */
@media (max-width: 768px) {
    #tsh-sidebar-widget { border-radius: 8px !important; }
}
