/* =====================================================================
   Revedoux – Header propio
   Escritorio ≥ 1025px  ·  Móvil/tablet ≤ 1024px (drawer)
===================================================================== */

:root {
    --rvx-ink: #111;
    --rvx-muted: #6b7280;
    --rvx-line: #e8eaf0;
    --rvx-bg: #fff;
    --rvx-sale: #ff3b30;
    --rvx-accent: #5073ee;
    --rvx-radius: 12px;

    --rvx-ann-h: 34px;      /* alto barra negra (móvil) */
    --rvx-bar-h: 56px;      /* alto header (móvil) */
    --rvx-z: 9990;
}

@media (min-width: 1025px) {
    :root {
        --rvx-ann-h: 36px;
        --rvx-bar-h: 64px;
    }
}

/* ---------- Reset acotado (Hello Elementor estiliza button/a/input globalmente) ---------- */
.rvx-scope,
.rvx-scope * { box-sizing: border-box; }

.rvx-scope a,
.rvx-scope a:hover,
.rvx-scope a:focus { color: inherit; text-decoration: none; }

.rvx-scope button,
.rvx-scope button:hover,
.rvx-scope button:focus {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
    font: inherit;
    line-height: 1;
    margin: 0;
    padding: 0;
    text-transform: none;
    cursor: pointer;
}

.rvx-scope ul { list-style: none; margin: 0; padding: 0; }
.rvx-scope li { margin: 0; }
.rvx-scope svg { display: block; }

.rvx-scope :focus-visible {
    outline: 2px solid var(--rvx-accent);
    outline-offset: 2px;
}

/* ---------- Capas ----------
   El header queda por encima del contenido (el mega menú se dibuja sobre la página). */
.rvx,
.elementor-location-header:has(.rvx) { position: relative; z-index: var(--rvx-z); }

/* ---------- Barra superior ---------- */
.rvx-announcement {
    height: var(--rvx-ann-h);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Header ---------- */
/* El wrapper conserva el espacio del header cuando pasa a position:fixed (lo controla el JS) */
.rvx-header-wrap { position: relative; }

.rvx-header {
    position: relative;
    z-index: var(--rvx-z);
    background: var(--rvx-bg);
    border-bottom: 1px solid var(--rvx-line);
}

/* Header fijo al bajar la página (escritorio y móvil) */
.rvx-header.is-fixed {
    position: fixed;
    top: var(--rvx-top, 0px);
    left: 0;
    right: 0;
    width: 100%;
    box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .3);
}

.rvx-header__bar {
    position: relative; /* ancla del mega menú */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: minmax(0, var(--rvx-bar-h));
    align-items: center;
    height: var(--rvx-bar-h);
    padding: 0 16px;
}

.rvx-burger { justify-self: start; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; margin-left: -8px; }
.rvx-burger svg { width: 28px; height: 28px; }

.rvx-logo { justify-self: center; display: inline-flex; align-items: center; max-height: var(--rvx-bar-h); min-width: 0; }
.rvx .rvx-logo .rvx-logo__img {
    display: block;
    height: 34px !important;
    width: auto !important;
    max-width: 170px !important;
    object-fit: contain;
}
.rvx-logo__text { font-size: 20px; font-weight: 700; letter-spacing: .02em; }

.rvx-actions { justify-self: end; display: flex; align-items: center; gap: 4px; }

.rvx-icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.rvx-icon-btn svg { width: 22px; height: 22px; }

.rvx-cart { display: inline-flex; align-items: center; }

/* Solo escritorio */
.rvx-nav,
.rvx-search-toggle,
.rvx-account,
.rvx-search { display: none; }

/* ---------- Escritorio ---------- */
@media (min-width: 1025px) {

    .rvx-header__bar { padding: 0 40px; }
    .rvx-burger { display: none; }
    .rvx .rvx-logo .rvx-logo__img { height: 36px !important; max-width: 180px !important; }

    .rvx-nav { display: block; }
    .rvx-nav ul { display: flex; align-items: center; gap: 28px; }

    .rvx-actions .rvx-nav { margin-right: 14px; }
    .rvx-search-toggle,
    .rvx-account { display: inline-flex; }

    .rvx-nav__link {
        position: relative;
        display: inline-flex;
        align-items: center;
        height: var(--rvx-bar-h);
        font-size: 13px;
        font-weight: 500;
        letter-spacing: .03em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .rvx-nav__link::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 18px;
        height: 1px;
        background: currentColor;
        transform: scaleX(0);
        transform-origin: left;
        transition: transform .2s ease;
    }
    .rvx-nav__item:hover > .rvx-nav__link::after,
    .rvx-nav__item.is-open > .rvx-nav__link::after { transform: scaleX(1); }

    .rvx .rvx-nav__link.is-sale,
    .rvx .rvx-nav__link.is-sale:hover { color: var(--rvx-sale); font-weight: 700; }

    .rvx .rvx-nav__link.is-pill,
    .rvx .rvx-nav__link.is-pill:hover {
        height: 32px;
        padding: 0 14px;
        border-radius: 8px;
        background: var(--rvx-ink);
        color: #fff;
    }
    .rvx-nav__link.is-pill::after { display: none; }

    /* ---------- Mega menú ---------- */
    .rvx-mega {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--rvx-bg);
        border-bottom: 1px solid var(--rvx-line);
        box-shadow: 0 22px 30px -22px rgba(0, 0, 0, .25);
    }
    .rvx-nav__item.is-open > .rvx-mega { display: block; animation: rvx-mega-in .18s ease-out; }

    @keyframes rvx-mega-in {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: none; }
    }

    .rvx-mega__inner {
        display: grid;
        gap: 32px;
        max-width: 1320px;
        margin: 0 auto;
        padding: 4px 40px 28px;
    }
    .rvx-mega__inner.has-sub { grid-template-columns: 210px 270px minmax(0, 1fr); }
    .rvx-mega__inner.no-sub  { grid-template-columns: 250px minmax(0, 1fr); }

    /* Columna 1: grupos */
    .rvx-mega__groups {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 14px 24px 14px 0;
        border-right: 1px solid var(--rvx-line);
    }
    .rvx-mega__group {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        line-height: 1.3;
        text-transform: uppercase;
        transition: color .15s;
    }
    .rvx-mega__group.has-thumb { text-transform: none; }
    .rvx-mega__inner.is-flat .rvx-mega__group { text-transform: none; font-size: 14px; }
    .rvx .rvx-mega__group img { width: 28px !important; height: 28px !important; border-radius: 50%; object-fit: cover; background: #f1f2f6; }

    .rvx .rvx-mega__group.is-active,
    .rvx .rvx-mega__group:hover { color: var(--rvx-accent); }
    .rvx-mega__group.is-active:not(.has-thumb)::before { content: ">"; }

    /* Columna 2: links del grupo activo */
    .rvx-mega__links { padding-top: 14px; }
    .rvx-mega__list { display: none; }
    .rvx-mega__list.is-active { display: block; }
    .rvx-mega__list li { margin-bottom: 9px; }
    .rvx-mega__list a { font-size: 14px; line-height: 1.3; }
    .rvx .rvx-mega__list a:hover { text-decoration: underline; text-underline-offset: 3px; }

    /* Tarjetas con imagen: alta · 2 apiladas · alta */
    .rvx-mega__cards {
        display: grid;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        grid-auto-columns: minmax(0, 1fr);
        gap: 12px;
        height: 330px;
    }
    .rvx-card {
        position: relative;
        display: block;
        overflow: hidden;
        border-radius: var(--rvx-radius);
        background: #eceef3;
    }
    .rvx-card.is-tall { grid-row: span 2; }
    .rvx .rvx-card img {
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
        max-width: none;
        object-fit: cover;
        border-radius: 0;
        transition: transform .5s ease;
    }
    .rvx .rvx-card:hover img { transform: scale(1.03); }

    .rvx-card__label {
        position: absolute;
        left: 16px;
        right: 16px;
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        letter-spacing: .14em;
        text-transform: uppercase;
        text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
    }
    .rvx .rvx-card__label { color: #fff; }
    .rvx-card.is-label-bottom .rvx-card__label { bottom: 14px; text-align: center; }
    .rvx-card.is-label-top .rvx-card__label { top: 14px; text-align: left; }
    /* sin imagen: texto legible sobre gris */
    .rvx-card:not(:has(img)) .rvx-card__label { color: var(--rvx-ink); text-shadow: none; }

    /* ---------- Buscador desplegable ---------- */
    .rvx-search { border-top: 1px solid var(--rvx-line); padding: 14px 40px; }
    .rvx-search.is-open { display: block; animation: rvx-mega-in .16s ease-out; }
    .rvx-search .rvx-searchform { max-width: 720px; margin: 0 auto; }

    /* El drawer no existe en escritorio */
    .rvx-drawer,
    .rvx-overlay { display: none !important; }
}

/* ---------- Formulario de búsqueda (header y drawer) ---------- */
.rvx-searchform {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1.5px solid var(--rvx-ink);
}
.rvx-scope .rvx-searchform input[type="search"] {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 10px 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: none;
    box-shadow: none;
    color: var(--rvx-ink);
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}
.rvx-searchform button { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.rvx-searchform button svg { width: 20px; height: 20px; }

/* ---------- Drawer móvil ---------- */
.rvx-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .25s ease;
}
.rvx-overlay:not([hidden]) { display: block; }
.rvx-overlay.is-open { opacity: 1; }

.rvx-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    width: min(86vw, 380px);
    padding: 20px 24px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--rvx-bg);
    color: var(--rvx-ink);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .3s;
}
.rvx-drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }

.rvx-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.rvx-drawer__title { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.2; }
.rvx-drawer__close { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; margin-right: -8px; }
.rvx-drawer__close svg { width: 22px; height: 22px; }

.rvx-drawer__list { display: flex; flex-direction: column; }

.rvx-scope .rvx-drawer__link,
.rvx-scope .rvx-drawer__link:hover,
.rvx-scope .rvx-drawer__link:focus {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
}
.rvx-drawer__link svg { width: 16px; height: 16px; flex: none; }

/* SALE: rojo y negrita (mismo tamaño y espacio que el resto) */
.rvx-scope .rvx-drawer__link.is-sale,
.rvx-scope .rvx-drawer__link.is-sale:hover,
.rvx-scope .rvx-drawer__link.is-sale:focus {
    color: var(--rvx-sale);
    font-weight: 700;
}

/* Acordeones */
.rvx-scope .rvx-acc { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; }
.rvx-acc > svg { width: 18px; height: 18px; flex: none; color: var(--rvx-muted); transition: transform .2s ease; }
.rvx-acc[aria-expanded="true"] > svg { transform: rotate(180deg); }

.rvx-acc__panel { padding: 0 0 8px 14px; border-left: 1px solid var(--rvx-line); margin-left: 2px; }
.rvx-acc__panel[hidden] { display: none; }

.rvx-scope .rvx-drawer__sub,
.rvx-scope .rvx-drawer__sub:hover,
.rvx-scope .rvx-drawer__sub:focus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.25;
    text-align: left;
    text-transform: none;
}
.rvx-scope .rvx-drawer__all,
.rvx-scope .rvx-drawer__all:hover { color: var(--rvx-muted); }
.rvx-acc__panel--sub { padding-bottom: 4px; }
.rvx-acc__panel--sub a { display: block; padding: 7px 0; font-size: 13.5px; color: var(--rvx-muted); }

/* Pie: contacto + redes */
.rvx-drawer__foot { margin-top: auto; padding-top: 36px; font-size: 12px; line-height: 1.6; }
.rvx-drawer__contact-title { margin: 0 0 2px; font-size: 12px; }
.rvx-drawer__foot > a { display: block; color: var(--rvx-ink); }

.rvx-drawer__social { display: flex; justify-content: center; gap: 22px; margin-top: 18px; }
.rvx-drawer__social a { display: inline-flex; padding: 4px; }
.rvx-drawer__social svg { width: 20px; height: 20px; }

/* Bloqueo de scroll y utilidades */
/* Página congelada mientras el drawer está abierto (el JS guarda y restaura la posición) */
html.rvx-lock { overflow: hidden; overscroll-behavior: none; }
body.rvx-lock {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}
.rvx-overlay { touch-action: none; }
.rvx-scope .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .rvx-drawer,
    .rvx-overlay,
    .rvx-nav__link::after,
    .rvx-card img { transition: none; }
    .rvx-nav__item.is-open > .rvx-mega,
    .rvx-search.is-open { animation: none; }
}