/**
 * Buscador bajo la ruta (inicio, catálogo, categoría, listado y búsqueda).
 * Misma pieza que .product-ficha-search en la ficha.
 * PC ≥992: el bloque no se muestra. No altera estilos de escritorio existentes.
 */
.lds-ruta-search {
    display: none;
}

@media (max-width: 991px) {
    .lds-ruta-search {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 0.45rem 3px 0.55rem;
        background: #000;
        overflow: hidden;
    }

    /* Portada: mismo eje y ancho que Catálogo (el main ya trae el padding lateral). */
    body.page-inicio .inicio-contenido > .lds-ruta-search {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    /*
     * Listado (categoría hoja y búsqueda): el buscador mide lo mismo que la tarjeta.
     * ≤699 el grid lleva padding 0 2rem; desde 700px la tarjeta es el 70% centrado.
     */
    .lds-ruta-search:has(+ .prod-grid) {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .lds-ruta-search__form {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .lds-ruta-search__box {
        display: flex;
        align-items: center;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        background: #fff;
        border: none;
        border-radius: 5px;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .lds-ruta-search__box > button {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0.35rem 0.55rem;
        margin: 0;
        line-height: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .lds-ruta-search__box > button svg {
        width: 1.35rem;
        height: 1.35rem;
        max-width: 100%;
        display: block;
    }

    .lds-ruta-search__input {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        box-sizing: border-box;
        border: none;
        outline: none;
        box-shadow: none;
        background: transparent;
        color: #111;
        font-size: clamp(0.85rem, 3.6vw, 1.15rem);
        line-height: 1.25;
        padding: 0.55rem 0.65rem 0.55rem 0;
        margin: 0;
        border-radius: 0;
        -webkit-appearance: none;
        appearance: none;
    }

    .lds-ruta-search__input::-webkit-search-decoration,
    .lds-ruta-search__input::-webkit-search-cancel-button,
    .lds-ruta-search__input::-webkit-search-results-button,
    .lds-ruta-search__input::-webkit-search-results-decoration {
        -webkit-appearance: none;
        appearance: none;
        display: none;
    }

    .lds-ruta-search__input::placeholder {
        color: #888;
        opacity: 1;
    }
}

@media (min-width: 700px) and (max-width: 991px) {
    .lds-ruta-search:has(+ .prod-grid) {
        width: 70%;
        max-width: 70%;
        margin-left: 15%;
        margin-right: 15%;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }
}
