/* ==========================================================================
   Légal Empresa — Popup de promoción (js/promo-popup.js)
   Mobile-first: en celular es una tarjeta con la foto como franja superior;
   desde 720px, foto a la izquierda y contenido a la derecha.
   ========================================================================== */

.promo {
    --promo-verde: var(--verde-oscuro, #273329);
    --promo-lima: var(--verde-lima, #84b72e);
    --promo-gris: var(--gris-texto, #5c675e);
    --promo-crema: var(--crema, #f3f4ef);

    position: fixed;
    inset: 0;
    z-index: 2100; /* encima del aviso de cookies (2000) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: var(--font, 'Poppins', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif);
    visibility: hidden;
}

.promo.is-open {
    visibility: visible;
}

html.promo-lock,
html.promo-lock body {
    overflow: hidden;
}

.promo__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 18, 12, 0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.promo.is-open .promo__backdrop {
    opacity: 1;
}

.promo__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 22px;
    background-color: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.promo.is-open .promo__dialog {
    opacity: 1;
    transform: none;
}

.promo__dialog:focus {
    outline: none;
}

/* ── Cerrar ─────────────────────────────────────────────────────────── */

.promo__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--promo-verde);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.promo__close:hover {
    background-color: #fff;
    transform: rotate(90deg);
}

.promo__close:focus-visible,
.promo__cta:focus-visible,
.promo__later:focus-visible {
    outline: 3px solid var(--promo-lima);
    outline-offset: 3px;
}

/* ── Foto + sello del descuento ─────────────────────────────────────── */

.promo__media {
    position: relative;
    flex: none;
    height: 190px;
    overflow: hidden;
    background: linear-gradient(180deg, #33422f 0%, var(--promo-verde) 100%);
}

.promo__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 28%;
}

.promo__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(39, 51, 41, 0.55) 0%, rgba(39, 51, 41, 0) 60%);
    pointer-events: none;
}

.promo__seal {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background-color: var(--promo-lima);
    color: var(--promo-verde);
    text-align: center;
    box-shadow: 0 0 0 6px rgba(132, 183, 46, 0.3), 0 12px 26px rgba(0, 0, 0, 0.3);
    transform: rotate(-8deg);
}

.promo__seal-num {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

.promo__seal-txt {
    margin-top: 2px;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.promo.is-open .promo__seal {
    animation: promoSello 0.6s 0.25s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes promoSello {
    from { transform: rotate(-30deg) scale(0.4); opacity: 0; }
    to { transform: rotate(-8deg) scale(1); opacity: 1; }
}

/* ── Contenido ──────────────────────────────────────────────────────── */

.promo__body {
    padding: 22px 22px 20px;
    color: var(--promo-verde);
}

.promo__logo {
    display: block;
    align-self: flex-start; /* en escritorio el cuerpo es flex: sin esto se estira */
    width: auto;
    max-width: 100%;
    height: 30px;
    margin-bottom: 16px;
}

.promo__eyebrow {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--promo-gris);
}

.promo__title {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.3px;
    color: var(--promo-verde);
}

.promo__hl {
    padding: 0 6px;
    border-radius: 6px;
    background-color: var(--promo-lima);
    white-space: nowrap;
}

.promo__text {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--promo-gris);
}

.promo__list {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.promo__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--promo-verde);
}

.promo__list svg {
    flex: none;
    width: 20px;
    height: 20px;
    padding: 3px;
    border-radius: 50%;
    background-color: rgba(132, 183, 46, 0.18);
    color: #5d8a17;
}

.promo__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 999px;
    background-color: var(--promo-verde);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(39, 51, 41, 0.28);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.promo__cta svg {
    flex: none;
    color: var(--promo-lima);
    transition: transform 0.2s ease;
}

.promo__cta:hover {
    background-color: #1c251d;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(39, 51, 41, 0.34);
}

.promo__cta:hover svg {
    transform: translateX(3px);
}

.promo__later {
    display: block;
    margin: 10px auto 0;
    padding: 8px 12px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--promo-gris);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.promo__later:hover {
    color: var(--promo-verde);
}

.promo__legal {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
    color: #8a948b;
}

/* ── Celulares muy bajos: se achica la foto ─────────────────────────── */

@media (max-height: 680px) and (max-width: 719px) {
    .promo__media {
        height: 130px;
    }

    .promo__seal {
        width: 84px;
        height: 84px;
        bottom: 12px;
    }

    .promo__seal-num {
        font-size: 27px;
    }

    .promo__list {
        display: none;
    }
}

/* ── Escritorio: foto a la izquierda ────────────────────────────────── */

@media (min-width: 720px) {
    .promo {
        padding: 24px;
    }

    .promo__dialog {
        flex-direction: row;
        max-width: 820px;
        max-height: calc(100dvh - 48px);
        border-radius: 26px;
    }

    .promo__media {
        width: 42%;
        height: auto;
        min-height: 520px;
    }

    .promo__photo {
        position: absolute;
        inset: 0;
        object-position: center 22%;
    }

    .promo__media::after {
        background: linear-gradient(0deg, rgba(39, 51, 41, 0.6) 0%, rgba(39, 51, 41, 0) 45%);
    }

    .promo__seal {
        left: 22px;
        bottom: 22px;
        width: 128px;
        height: 128px;
    }

    .promo__seal-num {
        font-size: 42px;
    }

    .promo__seal-txt {
        font-size: 12px;
    }

    .promo__body {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 40px 40px 30px;
    }

    .promo__logo {
        height: 36px;
        margin-bottom: 22px;
    }

    .promo__title {
        font-size: 29px;
    }

    .promo__text {
        font-size: 15px;
    }

    .promo__list li {
        font-size: 14px;
    }

    .promo__cta {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .promo__backdrop,
    .promo__dialog,
    .promo__cta,
    .promo__cta svg,
    .promo__close {
        transition: none;
    }

    .promo.is-open .promo__seal {
        animation: none;
    }
}
