/* =====================================================================
   Revedoux – Buscador lateral
===================================================================== */

/* El buscador desplegable anterior ya no se usa */
.rvx-search { display: none !important; }

.rvx-sd-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
}
.rvx-sd-overlay:not([hidden]) { display: block; }
.rvx-sd-overlay.is-open { animation: rvx-sd-fade-in .4s ease both; }
.rvx-sd-overlay.is-closing { animation: rvx-sd-fade-out .35s ease both; }

.rvx-sd {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    width: min(552px, 100vw);
    background: #fff;
    color: #111;
    box-sizing: border-box;
    visibility: hidden;
    will-change: transform;
}
.rvx-sd *, .rvx-sd *::before, .rvx-sd *::after { box-sizing: border-box; }
.rvx-sd.is-open,
.rvx-sd.is-closing { visibility: visible; box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .35); }
.rvx-sd.is-open { animation: rvx-sd-in .55s cubic-bezier(.22, 1, .36, 1) both; }
.rvx-sd.is-closing { animation: rvx-sd-out .42s cubic-bezier(.4, 0, .2, 1) both; }

@keyframes rvx-sd-in  { from { transform: translate3d(100%, 0, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes rvx-sd-out {
    from { transform: translate3d(0, 0, 0); opacity: 1; }
    to   { transform: translate3d(100%, 0, 0); opacity: .35; }
}
@keyframes rvx-sd-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes rvx-sd-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes rvx-sd-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* Tarjetas: entran en cascada al abrir y en cada nueva búsqueda */
.rvx-sd.is-open .rvx-sd-card { animation: rvx-sd-rise .55s cubic-bezier(.22, 1, .36, 1) both; }
.rvx-sd.is-open .rvx-sd-card:nth-child(1) { animation-delay: .20s; }
.rvx-sd.is-open .rvx-sd-card:nth-child(2) { animation-delay: .26s; }
.rvx-sd.is-open .rvx-sd-card:nth-child(3) { animation-delay: .32s; }
.rvx-sd.is-open .rvx-sd-card:nth-child(4) { animation-delay: .38s; }
.rvx-sd.is-open .rvx-sd-card:nth-child(n+5) { animation-delay: .44s; }
.rvx-sd.is-open .rvx-sd__title { animation: rvx-sd-rise .5s ease .12s both; }

html.rvx-sd-lock { overflow: hidden; }

/* ---------- Barra superior ---------- */
.rvx-sd__top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px 12px;
}
.rvx-sd__form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px 0 18px;
    border: 1px solid #e1e3e8;
    border-radius: 999px;
    background: #f7f7f8;
    margin: 0;
}
.rvx-sd .rvx-sd__form input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: none;
    box-shadow: none;
    font-size: 15px;
    color: #111;
    -webkit-appearance: none;
    appearance: none;
}
.rvx-sd .rvx-sd__form input[type="search"]::-webkit-search-cancel-button { display: none; }
.rvx-sd .rvx-sd__form button,
.rvx-sd .rvx-sd__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: #111;
    cursor: pointer;
}
.rvx-sd .rvx-sd__form button svg { width: 18px; height: 18px; }
.rvx-sd .rvx-sd__close { width: 32px; height: 32px; flex: none; }
.rvx-sd .rvx-sd__close svg { width: 18px; height: 18px; }

/* ---------- Cuerpo ---------- */
.rvx-sd__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 22px 96px;
}
.rvx-sd__title {
    margin: 8px 0 22px;
    padding-left: 4px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
}
.rvx-sd__title:empty { display: none; }

/* Quizás estés buscando */
.rvx-sd__suggest { margin: 4px 0 30px; padding-left: 4px; }
.rvx-sd__suggest[hidden] { display: none; }
.rvx-sd .rvx-sd__suggest-label {
    margin: 6px 0 16px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #a3a7b0;
}
.rvx-sd__chips { display: flex; flex-wrap: wrap; gap: 10px; }
.rvx-sd .rvx-sd__chip,
.rvx-sd .rvx-sd__chip:focus {
    padding: 10px 16px;
    border: 1px solid #8b93a1;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: #5b6270;
    font: inherit;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.rvx-sd .rvx-sd__chip:hover { background: #111; border-color: #111; color: #fff; }
.rvx-sd.is-open .rvx-sd__chip { animation: rvx-sd-rise .5s cubic-bezier(.22, 1, .36, 1) both; }
.rvx-sd.is-open .rvx-sd__chip:nth-child(2) { animation-delay: .05s; }
.rvx-sd.is-open .rvx-sd__chip:nth-child(3) { animation-delay: .10s; }
.rvx-sd.is-open .rvx-sd__chip:nth-child(4) { animation-delay: .15s; }
.rvx-sd.is-open .rvx-sd__chip:nth-child(n+5) { animation-delay: .20s; }

.rvx-sd__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 14px;
    transition: opacity .15s ease;
}
.rvx-sd__grid:empty { display: none; }
.rvx-sd.is-loading .rvx-sd__grid { opacity: .45; }

/* ---------- Tarjeta ---------- */
.rvx-sd .rvx-sd-card,
.rvx-sd .rvx-sd-card:hover { display: block; color: inherit; text-decoration: none; min-width: 0; }

.rvx-sd-card__media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4.2;
    overflow: hidden;
    border-radius: 12px;
    background: #eceef3;
}
.rvx-sd .rvx-sd-card__media img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    transition: opacity .35s ease, transform .5s ease;
}
.rvx-sd .rvx-sd-img-hover { opacity: 0; }
.rvx-sd-card.has-hover:hover .rvx-sd-img-hover { opacity: 1; }
.rvx-sd-card:not(.has-hover):hover .rvx-sd-img-main { transform: scale(1.03); }

.rvx-sd-card__info { display: block; padding-top: 10px; }
.rvx-sd-card__cat {
    display: block;
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #6b7280;
}
.rvx-sd-card__title {
    display: block;
    margin-top: 3px;
    font-size: 13.5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rvx-sd-card__price { display: block; margin-top: 3px; font-size: 13.5px; }
.rvx-sd-card__price del { color: #9aa0ad; margin-right: 6px; }
.rvx-sd-card__price ins { text-decoration: none; }

/* ---------- Pie: Ver todo ---------- */
.rvx-sd__foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    padding: 36px 0 22px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 60%);
    pointer-events: none;
}
.rvx-sd .rvx-sd__all,
.rvx-sd .rvx-sd__all:hover {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 30px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .02em;
    text-decoration: none;
}

@media (max-width: 600px) {
    .rvx-sd__top { padding: 16px 16px 10px; }
    .rvx-sd__body { padding: 8px 16px 96px; }
    .rvx-sd__grid { gap: 22px 10px; }
}

/* =====================================================================
   Header móvil: lupa + cuenta junto al carrito
   (el header base los oculta fuera de escritorio)
===================================================================== */
.rvx .rvx-search-toggle,
.rvx .rvx-account { display: inline-flex; }

@media (max-width: 1024px) {
    .rvx .rvx-actions { gap: 0; }
    .rvx .rvx-header__bar { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    .rvx .rvx-search-toggle,
    .rvx .rvx-account { width: 36px; height: 40px; }
    .rvx .rvx-search-toggle svg,
    .rvx .rvx-account svg { width: 21px; height: 21px; }
}

/* Pantallas muy angostas: un poco más compacto para no pisar el logo */
@media (max-width: 380px) {
    .rvx .rvx-search-toggle,
    .rvx .rvx-account { width: 32px; }
    .rvx .rvx-search-toggle svg,
    .rvx .rvx-account svg { width: 19px; height: 19px; }
}