/* ymk-search */

/*
 * #ymk-search-modal
*/

/* ── Modo inline (por defecto) ───────────────────────────────────────────── */

.ymk-search-modal--inline[hidden] {
    display: none;
}

.ymk-search-submit {
    display: none;
}

.ymk-search-submit--visible {
    display: block;
}

/* ── Modo modal ──────────────────────────────────────────────────────────── */

.ymk-search-modal--modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.ymk-search-modal--modal.is-open {
    display: flex;
}

.ymk-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.ymk-search-panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 4px;
    padding: 2rem;
    width: 100%;
    max-width: 680px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    animation: ymkSearchIn 0.18s ease-out;
}

@keyframes ymkSearchIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ymk-search-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    color: inherit;
    padding: 0.25rem;
}

.ymk-search-close:hover {
    opacity: 0.6;
}

/* Bloquea scroll del body mientras el modal está abierto */
html.ymk-search-open {
    overflow: hidden;
}

/* ── Grid de resultados — autónomo ───────────────────────────────────────── */
/*
 * Cuando ymk-woo-extra está activo, shop-card-style.css ya se encola
 * globalmente y enriquece las tarjetas. Este bloque solo garantiza que
 * el grid funciona en cualquier página, con o sin extra.
 */

#datafetch ul.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--global--spacing-vertical, 1.5rem) var(--global--spacing-horizontal, 1rem);
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

#datafetch ul.products::before,
#datafetch ul.products::after {
    display: none;
}

#datafetch ul.products li.product,
#datafetch ul.products[class*="columns-"] li.product {
    width: auto !important;
    margin: 0 !important;
    float: none !important;
    display: flex;
    flex-direction: column;
}

#datafetch ul.products li.product img {
    width: 100%;
    height: auto;
    display: block;
}

@media (min-width: 480px) {
    #datafetch ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}
