/* ═══════════════════════════════════════════════════════════════════
   PGL — Header overrides + filtros (wcapf)
   Carga directa via wp_enqueue_style (sin pasar por scssphp).
   ═══════════════════════════════════════════════════════════════════ */

/* ─── HEADER: botones unificados, fondo transparente, hover sutil ──── */
.header-actions .pgl-header-btn,
.header-actions .account-toggler,
.header-actions .cart-toggler,
.header-actions .back-to-cart,
.header-actions .nav-toggler,
.header-actions .pgl-shop-link {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #062E52 !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    border-radius: 10px !important;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
}
.header-actions .pgl-header-btn:hover,
.header-actions .account-toggler:hover,
.header-actions .cart-toggler:hover,
.header-actions .back-to-cart:hover,
.header-actions .nav-toggler:hover,
.header-actions .pgl-shop-link:hover,
.header-actions .pgl-header-btn:focus-visible {
    background: rgba(6, 46, 82, 0.06) !important;
    border-color: rgba(6, 46, 82, 0.12) !important;
    color: #062E52 !important;
    text-decoration: none !important;
}

/* Íconos del header — tamaño único */
.header-actions .pgl-header-btn .bi,
.header-actions .pgl-header-icon,
.header-actions .pgl-shop-link .bi {
    font-size: 1.25rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: inherit !important;
}

/* UL del menú "tienda" — reset */
.header-actions ul.navbar-nav.tienda {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    display: inline-flex !important;
}
.header-actions ul.navbar-nav.tienda .nav-item,
.header-actions ul.navbar-nav.tienda .menu-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.header-actions ul.navbar-nav.tienda .nav-link {
    padding: 0 !important;
    margin: 0 4px !important;
}

/* Badge del carrito — celeste sobre blanco, esquina superior derecha */
.header-actions button.cart-toggler {
    position: relative !important;
}
.header-actions button.cart-toggler > .cart-content,
.header-actions span.cart-content.pgl-cart-badge,
.header-actions .pgl-cart-badge {
    position: absolute !important;
    top: -3px !important;
    right: -3px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    min-width: 18px !important;
    width: auto !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 100px !important;
    background: #00d4ff !important;
    color: #062E52 !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    line-height: 18px !important;
    text-align: center !important;
    box-shadow: 0 0 0 2px var(--bs-body-bg, #fff) !important;
    border: none !important;
}

/* Ocultar precio del carrito si algún widget lo inyecta inline */
.header-actions .woocommerce-Price-amount,
.header-actions .cart-amount {
    display: none !important;
}

/* ─── Botón Categorías — azul medio, no tan oscuro ───────────────── */
.pgl-cat-btn {
    background: #0a4a7c !important;
}
.pgl-cat-btn:hover,
.pgl-cat-btn[aria-expanded="true"] {
    background: #0d5a96 !important;
}

/* ─── Buscador: la lupa es position:absolute (definido en _search.scss),
   así que agrego padding al input para hacerle espacio en vez de pelearla ──── */
.pgl-search-wrap {
    position: relative !important;
    border: 1px solid transparent !important;
    background: #f1f5f9 !important;
    border-radius: 100px !important;
    padding: 0 !important;
    transition: border-color 0.15s ease, background 0.15s ease !important;
    box-shadow: none !important;
    min-height: 42px !important;
}
.pgl-search-wrap:focus-within {
    background: #fff !important;
    border-color: #00d4ff !important;
    box-shadow: none !important;
}
/* Lupa: dejarla absolute pero centrarla verticalmente */
.pgl-search-icon,
.pgl-search-wrap > .bi-search {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #64748b !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    pointer-events: none !important;
    z-index: 1 !important;
}
.pgl-search-wrap:focus-within .pgl-search-icon {
    color: #062E52 !important;
}
/* Input: padding-left para hacerle espacio a la lupa absolute */
.pgl-search-input,
.pgl-search-input:focus,
.pgl-search-input:focus-visible {
    width: 100% !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0.55rem 38px 0.55rem 40px !important;  /* left: para lupa, right: para botón clear */
    font-size: 0.92rem !important;
    color: #062E52 !important;
    line-height: 1.4 !important;
    min-height: 42px !important;
}
.pgl-search-clear {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    padding: 4px 6px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    z-index: 2 !important;
}
.pgl-search-clear:hover { color: #062E52 !important; }
.pgl-search-clear .bi { font-size: 0.85rem !important; }

/* ═══════════════════════════════════════════════════════════════════
   FILTROS (plugin wcapf)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Range slider de precio ──────────────────────────────────────
   Importante: .wcapf-range-wrapper === .wcapf-range-slider (misma div).
   Contiene TANTO los inputs min/max COMO el track del jQuery UI.
   Si ponemos background al .wcapf-range-slider, se pinta TODO el wrapper
   (de ahí el "rectángulo gris alrededor"). Hay que usar pseudo elementos
   para el track y dejar el wrapper transparente. */
.wcapf-range-wrapper.wcapf-range-slider {
    position: relative !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 10px 28px !important;
    margin: 0.5rem 0 0.5rem !important;
    height: auto !important;
    overflow: visible !important;
}

/* Track gris pintado con pseudo (NO afecta a los inputs de arriba) */
.wcapf-range-wrapper.wcapf-range-slider::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 14px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 100px;
    z-index: 0;
    pointer-events: none;
}

/* Fill navy entre los dos handles — jQuery UI lo renderiza absolute */
.wcapf-range-wrapper.wcapf-range-slider .ui-slider-range,
.wcapf-range-wrapper.wcapf-range-slider .ui-widget-header {
    background: #062E52 !important;
    height: 4px !important;
    border-radius: 100px !important;
    border: none !important;
    z-index: 1 !important;
    bottom: 14px !important;
    top: auto !important;
}

/* Handles redondos navy con sombra sutil */
.wcapf-range-wrapper.wcapf-range-slider .ui-slider-handle {
    width: 18px !important;
    height: 18px !important;
    background: #fff !important;
    border: 3px solid #062E52 !important;
    border-radius: 50% !important;
    bottom: 7px !important;
    top: auto !important;
    margin-left: -9px !important;
    outline: none !important;
    cursor: pointer !important;
    z-index: 2 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}
.wcapf-range-wrapper.wcapf-range-slider .ui-slider-handle:hover,
.wcapf-range-wrapper.wcapf-range-slider .ui-slider-handle.ui-state-active {
    border-color: #00d4ff !important;
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.18) !important;
}

/* Inputs min/max — pill limpio */
.wcapf-range-start,
.wcapf-range-end {
    display: inline-flex !important;
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 4px 10px !important;
    transition: border-color 0.15s ease !important;
}
.wcapf-range-start:focus-within,
.wcapf-range-end:focus-within {
    border-color: #00d4ff !important;
    background: #fff !important;
}
.wcapf-range-start .min-value,
.wcapf-range-end .max-value {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 2px 0 !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: #062E52 !important;
    width: 70px !important;
    text-align: right !important;
}
.wcapf-range-unit {
    color: #64748b !important;
    font-size: 0.85rem !important;
    margin-left: 4px !important;
    font-weight: 500 !important;
}
.wcapf-range-separator {
    color: #94a3b8 !important;
    margin: 0 6px !important;
}

/* ─── Limpiar fondo azul claro del wrapper de filtros activos ────── */
.wcapf-filter-inner,
.wcapf-active-filter-items-wrapper {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Chips de filtros activos (Bazar × / Gaming × / 2000$ – 484798$ ×) */
.wcapf-active-filter-items {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    background: transparent !important;
}
.wcapf-active-filter-item.wcapf-filter-clear-btn,
button.wcapf-filter-clear-btn.wcapf-active-filter-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: #062E52 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 100px !important;
    padding: 6px 8px 6px 14px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 0.15s ease !important;
}
.wcapf-active-filter-item.wcapf-filter-clear-btn:hover {
    background: #0a4a7c !important;
    color: #fff !important;
}
.wcapf-active-filter-item.wcapf-filter-clear-btn .wcapf-nav-item-text {
    line-height: 1 !important;
    color: #fff !important;
    display: inline-block !important;
}

/* X del chip — RESET total de position + visibilidad forzada */
.wcapf-active-filter-items .wcapf-cross-sign,
.wcapf-active-filter-item span.wcapf-cross-sign,
button.wcapf-filter-clear-btn span.wcapf-cross-sign,
.wcapf-active-filter-item.wcapf-filter-clear-btn .wcapf-cross-sign,
button.wcapf-active-filter-item .wcapf-cross-sign {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    font-size: 1.05rem !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    margin: 0 0 0 2px !important;
    padding: 0 !important;
    transition: background 0.15s ease !important;
    text-indent: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: hidden !important;
    text-decoration: none !important;
}
.wcapf-active-filter-item .wcapf-nav-item-text {
    text-decoration: none !important;
    position: static !important;
    color: #fff !important;
}
.wcapf-active-filter-item.wcapf-filter-clear-btn:hover .wcapf-cross-sign {
    background: rgba(255, 255, 255, 0.45) !important;
}

/* Botón "Limpiar todo" */
.wcapf-reset-filters-btn-wrapper {
    margin-left: 4px !important;
}
.wcapf-reset-filters-btn {
    background: transparent !important;
    color: #64748b !important;
    border: none !important;
    padding: 5px 10px !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
}
.wcapf-reset-filters-btn:hover {
    color: #062E52 !important;
    background: transparent !important;
}
