/* =========================================================
   Focus Team Filtro de Productos — v1.25
   Una sola línea visual: tipografía del sitio, radios,
   bordes y alturas iguales en buscador, filtros y tarjetas.
   ========================================================= */

.ftfp-filtro {
    --ftfp-primary: #4963C9;
    --ftfp-accent: #F257A1;
    --ftfp-btn-bg: #4963C9;
    --ftfp-btn-text: #FFFFFF;
    --ftfp-section: #4963C9;
    --ftfp-card-hover: #F257A1;
    --ftfp-reset-bg: #F257A1;
    --ftfp-reset-text: #FFFFFF;
    --ftfp-reset-hover: #E0408A;
    --ftfp-btn-size: 12px;

    --ftfp-text: #1F2937;
    --ftfp-muted: #6B7280;
    --ftfp-border: #E5E7EB;
    --ftfp-surface: #F9FAFB;
    --ftfp-radius: 8px;
    --ftfp-control-h: 46px;

    margin: 30px 0;
    font-family: inherit;
    color: var(--ftfp-text);
}

.ftfp-filtro *,
.ftfp-filtro *::before,
.ftfp-filtro *::after {
    box-sizing: border-box;
}

.ftfp-filtro button,
.ftfp-filtro input,
.ftfp-filtro select {
    font-family: inherit;
}

/* ---------- Buscador protagonista ---------- */
.ftfp-searchbar {
    margin-bottom: 26px;
}

.ftfp-search {
    position: relative;
    display: flex;
    align-items: center;
}

.ftfp-filtro .ftfp-search-input,
.ftfp-filtro input.ftfp-search-input {
    width: 100%;
    height: 56px;
    min-height: 56px;
    margin: 0;
    padding: 0 48px 0 52px !important;
    border: 2px solid var(--ftfp-border) !important;
    border-radius: var(--ftfp-radius) !important;
    background: #FFF !important;
    text-indent: 0 !important;
    color: var(--ftfp-text);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
    transition: border-color .2s ease, box-shadow .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ftfp-filtro .ftfp-search-input::-webkit-search-cancel-button { display: none; }
.ftfp-filtro .ftfp-search-input::placeholder { color: #9CA3AF; opacity: 1; }

.ftfp-filtro .ftfp-search-input:focus {
    outline: none;
    border-color: var(--ftfp-primary) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ftfp-primary) 15%, transparent);
}

.ftfp-search-icon {
    position: absolute;
    z-index: 2;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--ftfp-primary);
    pointer-events: none;
}

.ftfp-filtro .ftfp-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: #F3F4F6;
    color: var(--ftfp-muted);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.ftfp-filtro .ftfp-search-clear.is-visible { display: flex; }
.ftfp-filtro .ftfp-search-clear:hover { background: #E5E7EB; color: var(--ftfp-text); }

.ftfp-search-hint {
    margin: 8px 2px 0;
    font-size: 13px;
    color: var(--ftfp-muted);
    line-height: 1.4;
}

/* ---------- Estructura ---------- */
.ftfp-wrapper {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.ftfp-sidebar {
    background: var(--ftfp-surface);
    border: 1px solid var(--ftfp-border);
    border-radius: var(--ftfp-radius);
    position: sticky;
    top: 20px;
}

.ftfp-sidebar-body {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 24px;
}

.ftfp-drawer-head,
.ftfp-drawer-foot,
.ftfp-overlay,
.ftfp-filtro .ftfp-filter-toggle {
    display: none;
}

/* ---------- Títulos de sección (todos iguales) ---------- */
.ftfp-filtro .ftfp-filter-title {
    margin: 0 0 14px;
    padding: 0 0 10px;
    border-bottom: 2px solid var(--ftfp-accent);
    color: var(--ftfp-section);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* ---------- Ordenar ---------- */
.ftfp-filtro .ftfp-select,
.ftfp-filtro select.ftfp-select {
    width: 100%;
    height: var(--ftfp-control-h);
    min-height: var(--ftfp-control-h);
    margin: 0;
    padding: 0 38px 0 14px;
    border: 1px solid var(--ftfp-border);
    border-radius: var(--ftfp-radius);
    background: #FFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    color: var(--ftfp-text);
    font-size: 14px;
    font-weight: 500;
    line-height: var(--ftfp-control-h);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
}

.ftfp-filtro .ftfp-select:focus {
    outline: none;
    border-color: var(--ftfp-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ftfp-primary) 15%, transparent);
}

/* ---------- Rango de precio ----------
   El input queda transparente y la barra se dibuja en el "track",
   así el tema no puede ponerle fondo, borde ni relleno. */
.ftfp-filtro .ftfp-range,
.ftfp-filtro input.ftfp-range,
.ftfp-filtro input[type="range"].ftfp-range {
    --ftfp-fill: 100%;
    display: block !important;
    width: 100% !important;
    height: 24px !important;
    min-height: 0 !important;
    margin: 6px 0 10px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    cursor: pointer;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.ftfp-filtro .ftfp-range::-webkit-slider-runnable-track {
    height: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 3px !important;
    box-shadow: none !important;
    background: linear-gradient(to right, var(--ftfp-primary) 0, var(--ftfp-primary) var(--ftfp-fill), #E5E7EB var(--ftfp-fill), #E5E7EB 100%) !important;
}

.ftfp-filtro .ftfp-range::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 22px !important;
    height: 22px !important;
    margin-top: -8px !important;
    border-radius: 50% !important;
    border: 3px solid #FFF !important;
    background: var(--ftfp-primary) !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer;
}

.ftfp-filtro .ftfp-range::-moz-range-track {
    height: 6px;
    border: 0;
    border-radius: 3px;
    background: #E5E7EB;
}

.ftfp-filtro .ftfp-range::-moz-range-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--ftfp-primary);
}

.ftfp-filtro .ftfp-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #FFF;
    background: var(--ftfp-primary);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.ftfp-filtro .ftfp-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ftfp-primary) 25%, transparent) !important;
}

.ftfp-price-values {
    display: flex;
    justify-content: space-between;
    color: var(--ftfp-text);
    font-size: 13px;
    font-weight: 700;
}

/* ---------- Categorías ---------- */
.ftfp-categories {
    display: flex;
    flex-direction: column;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.ftfp-categories::-webkit-scrollbar { width: 6px; }
.ftfp-categories::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }

.ftfp-category-orphan-group {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--ftfp-border);
}

.ftfp-category-parent-label {
    display: block;
    margin-bottom: 4px;
    color: var(--ftfp-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.ftfp-category-main-label,
.ftfp-category-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    user-select: none;
    line-height: 1.35;
    transition: color .2s ease;
}

.ftfp-category-main-label {
    padding: 10px 0;
    border-bottom: 1px solid var(--ftfp-border);
    color: var(--ftfp-text);
    font-size: 13px;
    font-weight: 600;
}

.ftfp-category-label {
    padding: 8px 0 8px 26px;
    color: #4B5563;
    font-size: 12px;
    font-weight: 500;
}

.ftfp-category-main-label:hover,
.ftfp-category-label:hover {
    color: var(--ftfp-primary);
}

.ftfp-filtro .ftfp-category-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--ftfp-primary);
}

.ftfp-category-count {
    margin-left: auto;
    flex-shrink: 0;
    color: #9CA3AF;
    font-size: 11px;
    font-weight: 500;
}

/* ---------- Botones (mismo estilo en toda la tienda) ---------- */
.ftfp-filtro .ftfp-btn,
.ftfp-filtro a.ftfp-btn,
.ftfp-filtro .ftfp-reset-btn,
.ftfp-filtro button.ftfp-reset-btn,
.ftfp-filtro .ftfp-apply-btn,
.ftfp-filtro .ftfp-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 10px 14px;
    border: none;
    border-radius: var(--ftfp-radius);
    font-size: var(--ftfp-btn-size);
    font-weight: 700;
    font-style: normal !important;
    line-height: 1.3;
    letter-spacing: 0.2px;
    text-align: center;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.ftfp-filtro .ftfp-btn,
.ftfp-filtro a.ftfp-btn,
.ftfp-filtro a.ftfp-btn:link,
.ftfp-filtro a.ftfp-btn:visited,
.ftfp-filtro .ftfp-apply-btn {
    background: var(--ftfp-btn-bg);
    color: var(--ftfp-btn-text) !important;
}

.ftfp-filtro .ftfp-btn:hover,
.ftfp-filtro a.ftfp-btn:hover,
.ftfp-filtro a.ftfp-btn:focus,
.ftfp-filtro .ftfp-apply-btn:hover {
    background: var(--ftfp-btn-bg);
    color: var(--ftfp-btn-text) !important;
    filter: brightness(1.12);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.18);
}

.ftfp-filtro .ftfp-reset-btn,
.ftfp-filtro button.ftfp-reset-btn {
    background: var(--ftfp-reset-bg);
    color: var(--ftfp-reset-text);
}

.ftfp-filtro .ftfp-reset-btn:hover,
.ftfp-filtro button.ftfp-reset-btn:hover {
    background: var(--ftfp-reset-hover);
    color: var(--ftfp-reset-text);
}

/* En escritorio no se usan los controles del cajón móvil */
.ftfp-filtro .ftfp-filter-toggle { display: none; }
.ftfp-filtro .ftfp-apply-btn { gap: 0.3em; }

/* ---------- Encabezado de resultados ---------- */
.ftfp-main {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

.ftfp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--ftfp-accent);
}

.ftfp-count {
    color: var(--ftfp-text);
    font-size: 15px;
    font-weight: 700;
}

.ftfp-count-query strong { color: var(--ftfp-primary); }

/* ---------- Grilla y tarjetas ---------- */
.ftfp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    width: 100%;
    transition: opacity .2s ease;
}

.ftfp-grid.is-loading { opacity: .45; pointer-events: none; }

.ftfp-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: #FFF;
    border: 1px solid var(--ftfp-border);
    border-radius: var(--ftfp-radius);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ftfp-product-card:hover {
    border-color: var(--ftfp-card-hover);
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.10);
    transform: translateY(-3px);
}

.ftfp-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 0.9;
    overflow: hidden;
    background: #F7F7F8;
}

.ftfp-product-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    padding: 16px;
    transition: transform .3s ease;
}

.ftfp-product-card:hover .ftfp-product-image img { transform: scale(1.05); }

.ftfp-product-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
    padding: 14px 16px 16px;
}

.ftfp-product-category {
    color: var(--ftfp-primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.4;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Nombre: hasta 3 líneas, reserva 2 para que las tarjetas queden alineadas */
.ftfp-filtro .ftfp-product-title {
    margin: 0;
    font-weight: 600;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ftfp-filtro .ftfp-product-title a {
    color: inherit;
    text-decoration: none !important;
    font-style: normal;
}

.ftfp-filtro .ftfp-product-title a:hover { color: var(--ftfp-primary); }

.ftfp-product-sku {
    color: var(--ftfp-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
    word-break: break-all;
}

.ftfp-product-price {
    margin-top: auto;
    padding-top: 4px;
    font-weight: 700;
}

.ftfp-product-price del { opacity: .55; font-weight: 500; margin-right: 6px; }
.ftfp-product-price ins { text-decoration: none; }

/* ---------- Paginación ---------- */
.ftfp-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--ftfp-border);
}

.ftfp-pagination:empty { display: none; }

.ftfp-filtro .ftfp-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--ftfp-radius);
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    transition: all .2s ease;
}

.ftfp-page-dots { color: var(--ftfp-muted); padding: 0 2px; }

/* ---------- Estados ---------- */
.ftfp-loading,
.ftfp-no-results {
    grid-column: 1 / -1;
    padding: 50px 24px;
    text-align: center;
    color: var(--ftfp-muted);
    font-size: 15px;
}

.ftfp-no-results p { margin: 0 0 8px; }
.ftfp-no-results strong { color: var(--ftfp-text); font-size: 17px; }

/* ---------- Insignias ---------- */
.ftfp-product-image { position: relative; }

.ftfp-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    pointer-events: none;
}

.ftfp-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 5px;
    color: #FFF;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.ftfp-badge-sale { background: #DC2626; }
.ftfp-badge-new { background: var(--ftfp-primary); }
.ftfp-badge-oos { background: #6B7280; }

.ftfp-product-card.ftfp-oos .ftfp-product-image img { opacity: .45; filter: grayscale(.6); }

/* ---------- Acciones de la tarjeta ---------- */
.ftfp-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.ftfp-actions .ftfp-btn { flex: 1; min-width: 0; }

.ftfp-filtro a.ftfp-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ftfp-btn-bg);
    border-radius: var(--ftfp-radius);
    background: #FFF;
    color: var(--ftfp-btn-bg) !important;
    text-decoration: none !important;
    box-shadow: none;
    transition: background-color .2s ease, color .2s ease;
}

.ftfp-filtro a.ftfp-cart-btn:hover { background: var(--ftfp-btn-bg); color: var(--ftfp-btn-text) !important; }
.ftfp-filtro a.ftfp-cart-btn::after,
.ftfp-filtro a.ftfp-cart-btn::before { display: none !important; } /* íconos que agregan algunos temas */
.ftfp-cart-btn .ftfp-ico-ok { display: none; }
.ftfp-filtro a.ftfp-cart-btn.loading { opacity: .5; pointer-events: none; }
.ftfp-filtro a.ftfp-cart-btn.added { background: #16A34A; border-color: #16A34A; color: #FFF !important; }
.ftfp-cart-btn.added .ftfp-ico-cart { display: none; }
.ftfp-cart-btn.added .ftfp-ico-ok { display: block; }
.ftfp-filtro .added_to_cart { display: none !important; } /* enlace "Ver carrito" de WooCommerce */

.ftfp-filtro a.ftfp-wa-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
    color: #128C4A !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
}

.ftfp-filtro a.ftfp-wa-link:hover { text-decoration: underline !important; }

.ftfp-filtro a.ftfp-wa-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: var(--ftfp-radius);
    background: #25D366;
    color: #FFF !important;
    font-size: var(--ftfp-btn-size);
    font-weight: 700;
    text-decoration: none !important;
    transition: filter .2s ease;
}

.ftfp-filtro a.ftfp-wa-button:hover { filter: brightness(.93); }

.ftfp-filtro a.ftfp-wa-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    border-radius: var(--ftfp-radius);
    background: #25D366;
    color: #FFF !important;
    text-decoration: none !important;
}

.ftfp-filtro a.ftfp-wa-icon:hover { filter: brightness(.93); }

.ftfp-filtro a.ftfp-btn-wa {
    width: auto;
    margin-top: 12px;
    padding: 10px 20px;
    background: #25D366;
    color: #FFF !important;
}

/* ---------- Disponibilidad ---------- */
.ftfp-avail-box .ftfp-toggle-row:last-child { border-bottom: 0; }

/* ---------- Orden en línea (diseño sin sidebar) ---------- */
.ftfp-sort-inline { flex: 0 0 220px; }
.ftfp-sort-inline .ftfp-filter-title { display: none; }

/* ---------- Categorías rápidas (chips) ---------- */
.ftfp-chips {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px;
}

.ftfp-chips::-webkit-scrollbar { display: none; }
.ftfp-chips:empty { display: none; }

.ftfp-filtro .ftfp-chip {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 14px;
    min-height: 0;
    border: 1px solid var(--ftfp-border);
    border-radius: 999px;
    background: #FFF;
    color: var(--ftfp-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-transform: none;
    cursor: pointer;
    box-shadow: none;
    transition: all .2s ease;
}

.ftfp-filtro .ftfp-chip:hover { border-color: var(--ftfp-primary); color: var(--ftfp-primary); background: #FFF; }
.ftfp-filtro .ftfp-chip.is-active { background: var(--ftfp-primary); border-color: var(--ftfp-primary); color: #FFF; }

/* =========================================================
   Tablet
   ========================================================= */
@media (max-width: 1200px) {
    .ftfp-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* =========================================================
   Modo cajón (.ftfp-dm): siempre en "Sin sidebar",
   y en celular para "Con sidebar". Lo activa el JS.
   ========================================================= */
.ftfp-dm .ftfp-wrapper { display: block; }

.ftfp-filtro.ftfp-dm .ftfp-filter-toggle {
    display: inline-flex;
    width: auto;
    flex-shrink: 0;
    padding: 10px 16px;
    background: #FFF;
    color: var(--ftfp-text);
    border: 1px solid var(--ftfp-border);
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.06);
}

.ftfp-filtro.ftfp-dm .ftfp-filter-toggle svg { color: var(--ftfp-primary); }

.ftfp-filter-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--ftfp-primary);
    color: #FFF;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.ftfp-filter-badge.is-visible { display: inline-flex; }

.ftfp-dm .ftfp-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    width: min(88vw, 380px);
    border: none;
    border-radius: 0 14px 14px 0;
    background: #FFF;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.2);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .3s ease, visibility .3s;
}

.ftfp-dm .ftfp-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--ftfp-border);
    font-size: 17px;
    font-weight: 700;
}

.ftfp-filtro.ftfp-dm .ftfp-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #F3F4F6;
    color: var(--ftfp-text);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.ftfp-dm .ftfp-sidebar-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 18px;
    gap: 24px;
}

.ftfp-dm .ftfp-categories { max-height: none; overflow: visible; }

.ftfp-dm .ftfp-drawer-foot {
    display: block;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ftfp-border);
    background: #FFF;
}

.ftfp-filtro.ftfp-dm .ftfp-apply-btn { min-height: 48px; font-size: 15px; }

.ftfp-dm .ftfp-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(17, 24, 39, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s;
}

.ftfp-filtro.ftfp-drawer-open .ftfp-sidebar {
    transform: translateX(0);
    visibility: visible;
}

.ftfp-filtro.ftfp-drawer-open .ftfp-overlay {
    opacity: 1;
    visibility: visible;
}

/* =========================================================
   Celular
   ========================================================= */
@media (max-width: 768px) {
    .ftfp-filtro { margin: 16px 0; }

    /* Antes de que cargue el JS, el sidebar no se muestra en celular */
    .ftfp-layout-sidebar:not(.ftfp-dm) .ftfp-sidebar { display: none; }

    .ftfp-searchbar { margin-bottom: 16px; }

    .ftfp-filtro .ftfp-search-input,
    .ftfp-filtro input.ftfp-search-input {
        height: 52px;
        min-height: 52px;
        padding: 0 42px 0 46px !important;
        font-size: 16px; /* evita el zoom automático en iPhone */
    }

    .ftfp-search-icon { left: 14px; }
    .ftfp-search-hint { font-size: 12px; }

    .ftfp-header { padding-bottom: 12px; flex-wrap: wrap; }

    .ftfp-count {
        font-size: 13px;
        text-align: right;
    }

    /* Sin sidebar en celular: Filtrar + Ordenar arriba, chips y conteo abajo */
    .ftfp-layout-top .ftfp-filter-toggle { order: 1; }
    .ftfp-layout-top .ftfp-sort-inline { order: 2; flex: 1 1 140px; }
    .ftfp-layout-top .ftfp-chips { order: 3; flex: 1 1 100%; }
    .ftfp-layout-top .ftfp-count { order: 4; flex: 1 1 100%; text-align: left; }
    .ftfp-filtro .ftfp-sort-inline .ftfp-select { height: 44px; min-height: 44px; line-height: 44px; font-size: 14px; }

    /* Grilla de 2 columnas en celular */
    .ftfp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .ftfp-product-card:hover { transform: none; }
    .ftfp-product-image img { padding: 10px; }
    .ftfp-product-info { padding: 10px 12px 12px; gap: 6px; }
    .ftfp-product-category { font-size: 9px; }
    .ftfp-badges { top: 6px; left: 6px; }
    .ftfp-badge { font-size: 10px; padding: 3px 6px; }

    .ftfp-actions { gap: 6px; }

    .ftfp-filtro .ftfp-btn,
    .ftfp-filtro a.ftfp-btn {
        min-height: 40px;
        padding: 8px 6px;
        font-size: 13px;
    }

    .ftfp-filtro a.ftfp-cart-btn,
    .ftfp-filtro a.ftfp-wa-icon { flex-basis: 40px; width: 40px; min-height: 40px; }
    .ftfp-filtro a.ftfp-wa-link { font-size: 12px; }
}

@media (max-width: 340px) {
    .ftfp-grid { grid-template-columns: 1fr; }
}

/* Contenedor temporal del panel */
.ftfp-filtro.ftfp-portal {
    margin: 0 !important;
    padding: 0 !important;
    height: 0;
}

/* Con el panel abierto se ocultan botones flotantes (WhatsApp, carrito) */
html.ftfp-no-scroll #sc-wa-btn,
html.ftfp-no-scroll #sc-wa-box,
html.ftfp-no-scroll .joinchat {
    display: none !important;
}

/* Bloquea el scroll de la página con el cajón abierto */
html.ftfp-no-scroll,
html.ftfp-no-scroll body {
    overflow: hidden !important;
}

/* Celular con WhatsApp "solo ícono": botón principal arriba, íconos abajo */
@media (max-width: 768px) {
    .ftfp-actions:has(.ftfp-wa-icon) { flex-wrap: wrap; }
    .ftfp-actions:has(.ftfp-wa-icon) .ftfp-btn { flex: 1 1 100%; }
    .ftfp-filtro .ftfp-actions:has(.ftfp-wa-icon) a.ftfp-cart-btn,
    .ftfp-filtro .ftfp-actions:has(.ftfp-wa-icon) a.ftfp-wa-icon { flex: 1 1 0; width: auto; }
}
