/* =========================================================
   LAYOUTS.CSS — Event Master
   Variaciones visuales por layout
========================================================= */

/* L1 — Editorial Clásico */
body.layout-l1 .invite-hero {
    padding: 26px 18px 10px;
}

body.layout-l1 .invite-card {
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 34px 28px 28px;
    border: none;
    border-radius: 34px;
    box-shadow: 0 24px 55px rgba(80, 55, 35, 0.16);
    background:
        radial-gradient(
            ellipse at center,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.84) 48%,
            rgba(255, 255, 255, 0.46) 78%,
            rgba(255, 255, 255, 0.18) 100%
        );
    backdrop-filter: blur(8px);
}

body.layout-l1 .event-box {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.42);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

body.layout-l1 .event-row {
    padding: 15px 0;
}

body.layout-l1 .event-row + .event-row {
    border-top: 1px solid rgba(120, 90, 70, 0.12);
}

body.layout-l1 .invite-family-card,
body.layout-l1 .invite-additional-message {
    background: transparent;
    box-shadow: none;
    border: none;
}

body.layout-l1 .invite-card {
    width: min(100%, 390px);
    padding: 32px 24px 26px;
}

body.layout-l1 .event-box {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 10px 4px 0;
    margin-top: 22px;
}

body.layout-l1 .event-row {
    padding: 16px 0;
}

body.layout-l1 .event-row + .event-row {
    border-top: 1px solid rgba(120, 90, 70, 0.16);
}

body.layout-l1 .invite-card .event-box {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
}

body.layout-l1 .invite-card .event-box::before,
body.layout-l1 .invite-card .event-box::after {
    display: none !important;
}

/* =========================================================
   L1 — Overrides finales sobre Template Engine
========================================================= */

body[data-template].layout-l1 .invite-card {
    width: min(100%, 390px) !important;
    padding: 32px 24px 26px !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body[data-template].layout-l1 .invite-card .event-box {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    padding: 8px 4px 0 !important;
}

body[data-template].layout-l1 .event-row {
    padding: 16px 0 !important;
}

/* L1 — Experience Menu */
body[data-template].layout-l1 .bottom-nav.experience-menu {
    bottom: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom)) !important;
}

body[data-template].layout-l1 .invitation-phone {
    padding-bottom: 120px !important;
}

@media (max-width: 768px) {
    body[data-template].layout-l1 .bottom-nav.experience-menu {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        transform: none !important;
    }
}

@media (min-width: 769px) {
    body[data-template].layout-l1 .bottom-nav.experience-menu {
        left: 50% !important;
        width: 430px !important;
        max-width: 430px !important;
        transform: translateX(-50%) !important;
    }
}

/* =========================================================
   L1 — Event RSVP editorial FINAL
========================================================= */

/* =========================================================
   L1 — Event RSVP editorial compacto 2 columnas
========================================================= */

body[data-template].layout-l1 .event-action-card {
    width: calc(100% - 70px);
    max-width: 360px;
    margin: 14px auto 18px;
    padding: 14px 0;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    align-items: center;
    text-align: center;
    background: transparent !important;
    border-top: 1px solid color-mix(in srgb, var(--template-primary, var(--primary)) 14%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--template-primary, var(--primary)) 14%, transparent);
    box-shadow: none !important;
    backdrop-filter: none !important;
}

body[data-template].layout-l1 .event-action-date {
    display: none !important;
}

body[data-template].layout-l1 .event-action-card::before {
    content: "";
    grid-column: 2;
    grid-row: 1;
    width: 1px;
    height: 54px;
    background: color-mix(in srgb, var(--template-primary, var(--primary)) 18%, transparent);
}

body[data-template].layout-l1 .event-action-countdown {
    grid-column: 1;
    margin: 0;
    padding: 0 12px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 0 !important;
}

body[data-template].layout-l1 .event-action-days strong {
    color: var(--template-primary, var(--primary));
    font-family: var(--font-title);
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1;
}

body[data-template].layout-l1 .event-action-days span {
    margin-top: 4px;
    color: var(--template-text, var(--text));
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body[data-template].layout-l1 .event-action-days span::after {
    content: "";
}

body[data-template].layout-l1 .event-action-time {
    margin-top: 8px;
}

body[data-template].layout-l1 .event-action-time strong {
    font-size: 0;
    color: var(--template-primary, var(--primary));
    font-family: var(--font-title);
    font-weight: 500;
    letter-spacing: 0.08em;
}

body[data-template].layout-l1 .event-action-time strong span {
    font-size: 0.82rem;
}

body[data-template].layout-l1 .event-action-time strong span + span::before {
    content: " · ";
}

body[data-template].layout-l1 .event-action-rsvp {
    grid-column: 3;
    width: 100%;
    margin: 0;
    padding: 0 0 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--template-primary, var(--primary)) !important;
    font-size: 0;
    cursor: pointer;
}

body[data-template].layout-l1 .event-action-rsvp::before {
    content: "RSVP";
    display: block;
    color: var(--template-text, var(--text));
    font-family: var(--font-title);
    font-size: 1.42rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.12em;
}

body[data-template].layout-l1 .event-action-rsvp::after {
    content: "Confirmar";
    display: block;
    color: var(--template-primary, var(--primary));
    font-size: 0.66rem;
    font-weight: 850;
    letter-spacing: 0.16em;
    line-height: 1;
    text-transform: uppercase;
}

body[data-template].layout-l1 .event-action-rsvp small {
    display: block;
    margin-top: 2px;
    color: var(--template-text, var(--text));
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0.62;
}

body[data-template].layout-l1 .event-action-rsvp:hover {
    transform: translateY(-1px);
}

body[data-template].layout-l1 .event-action-rsvp:active {
    transform: translateY(0);
}


/* =========================================================
   L1 — Control de nombres largos
========================================================= */

body[data-template].layout-l1 .invite-name {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(2.25rem, 9vw, 3.75rem);
    line-height: 0.92;
    letter-spacing: -0.045em;
    text-wrap: balance;
    overflow-wrap: break-word;
    word-break: normal;
}

body[data-template].layout-l1 .invite-name.invite-name-medium {
    font-size: clamp(1.95rem, 7.2vw, 3.05rem);
    line-height: 1.16;
    letter-spacing: -0.04em;
}

body[data-template].layout-l1 .invite-name.invite-name-long {
    font-size: clamp(1.55rem, 5.8vw, 2.45rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
    max-width: 92%;
}

body[data-template].layout-l1 .invite-profile-subtitle {
    max-width: 92%;
    margin-left: auto;
    margin-right: auto;
}

body[data-template].layout-l1 .invite-message,
body[data-template].layout-l1 .invite-profile-story,
body[data-template].layout-l1 .invite-short {
    max-width: 92%;
    margin-left: auto;
    margin-right: auto;
}

body[data-template].layout-l1 .invite-family-card strong {
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.18;
}

body[data-template].layout-l1 .event-row strong,
body[data-template].layout-l1 .event-row span,
body[data-template].layout-l1 .event-row small {
    overflow-wrap: break-word;
    word-break: normal;
}

/* Ajuste específico para previews pequeñas del catálogo */
.catalog-preview body[data-template].layout-l1 .invite-name,
body.catalog-preview[data-template].layout-l1 .invite-name {
    font-size: clamp(1.75rem, 7vw, 2.85rem);
}

.catalog-preview body[data-template].layout-l1 .invite-name.invite-name-medium,
body.catalog-preview[data-template].layout-l1 .invite-name.invite-name-medium {
    font-size: clamp(1.45rem, 5.8vw, 2.25rem);
}

.catalog-preview body[data-template].layout-l1 .invite-name.invite-name-long,
body.catalog-preview[data-template].layout-l1 .invite-name.invite-name-long {
    font-size: clamp(1.18rem, 4.8vw, 1.85rem);
    line-height: 1;
}

/* =========================================================
   L1 — Tipo de evento + foto sin deformación
========================================================= */

body[data-template].layout-l1 .invite-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    padding: 0;
    color: var(--template-primary, var(--primary));
    font-size: 0.78rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0.78;
}

body[data-template].layout-l1 .invite-profile-image {
    width: 138px;
    height: 138px;
    margin: 0 auto 26px;
    border-radius: 34px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.55);
}

body[data-template].layout-l1 .invite-profile-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Variante desktop / vista completa */
@media (min-width: 769px) {
    body[data-template].layout-l1 .invite-profile-image {
        width: 150px;
        height: 150px;
        border-radius: 38px;
    }
}

/* Ajuste en previews pequeñas */
body.catalog-preview[data-template].layout-l1 .invite-profile-image,
.catalog-preview body[data-template].layout-l1 .invite-profile-image {
    width: 112px;
    height: 112px;
    border-radius: 28px;
    margin-bottom: 18px;
}

/* =========================================================
   L1 — Padrinos / Testigos extendidos FINAL
========================================================= */

body[data-template].layout-l1 .invite-family-block {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 28px auto 0 !important;
    padding: 0 !important;
    text-align: center !important;
}

body[data-template].layout-l1 .invite-family-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 18px !important;
    padding: 0 !important;
    text-align: center !important;
}

body[data-template].layout-l1 .invite-family-card span {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 12px !important;
    text-align: center !important;
    letter-spacing: 0.22em;
    line-height: 1.15;
}

body[data-template].layout-l1 .invite-family-card strong {
    display: block !important;
    width: 100% !important;
    max-width: 330px !important;
    margin: 0 auto 4px !important;
    padding: 0 !important;
    text-align: center !important;
    white-space: normal !important;
    text-wrap: balance;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
    line-height: 1.12 !important;
}

/* =========================================================
   L1 — Eliminar línea lateral en bloque familiar móvil
========================================================= */

@media (max-width: 768px) {
    body[data-template].layout-l1 .invite-family-block,
    body[data-template].layout-l1 .invite-family-card {
        border: none !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;
    }

    body[data-template].layout-l1 .invite-family-block::before,
    body[data-template].layout-l1 .invite-family-block::after,
    body[data-template].layout-l1 .invite-family-card::before,
    body[data-template].layout-l1 .invite-family-card::after {
        content: none !important;
        display: none !important;
    }
}

/* =========================================================
   L1 — Ajustes finales: título, divisor y menú dinámico
========================================================= */

/* Título principal: mejora interlineado también en nombres cortos */
body[data-template].layout-l1 .invite-name {
    line-height: 1.12 !important;
}

body[data-template].layout-l1 .invite-name.invite-name-medium {
    line-height: 1.16 !important;
}

body[data-template].layout-l1 .invite-name.invite-name-long {
    line-height: 1.2 !important;
}

/* Divisor: eliminar corazón/parche blanco */
body[data-template].layout-l1 .divider {
    width: 72px !important;
    height: 1px !important;
    margin: 14px auto 18px !important;
    background: color-mix(
        in srgb,
        var(--template-primary, var(--primary)) 60%,
        transparent
    ) !important;
    border: 0 !important;
    position: relative !important;
}

body[data-template].layout-l1 .divider::before,
body[data-template].layout-l1 .divider::after {
    content: none !important;
    display: none !important;
}

/* Menú inferior: distribución automática según cantidad de botones */
body[data-template].layout-l1 .bottom-nav.experience-menu {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 1fr !important;
    align-items: stretch !important;
}

body[data-template].layout-l1 .bottom-nav.experience-menu button {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
}

body[data-template].layout-l1 .bottom-nav.experience-menu button span {
    white-space: nowrap !important;
    font-size: 0.68rem !important;
}

/* =========================================================
   L1 — Mejora de lectura en móvil
========================================================= */

@media (max-width: 480px) {
    body[data-template].layout-l1 .invite-card {
        padding-left: 26px !important;
        padding-right: 26px !important;
    }

    body[data-template].layout-l1 .invite-name {
        font-size: clamp(2.45rem, 12vw, 3.25rem) !important;
        line-height: 1.12 !important;
    }

    body[data-template].layout-l1 .invite-message,
    body[data-template].layout-l1 .invite-profile-story,
    body[data-template].layout-l1 .invite-short {
        font-size: 1.04rem !important;
        line-height: 1.62 !important;
    }

    body[data-template].layout-l1 .event-row small {
        font-size: 0.72rem !important;
        letter-spacing: 0.14em !important;
    }

    body[data-template].layout-l1 .event-row strong {
        font-size: 1.05rem !important;
        line-height: 1.3 !important;
    }

    body[data-template].layout-l1 .event-row span {
        font-size: 0.94rem !important;
        line-height: 1.38 !important;
    }

    body[data-template].layout-l1 .invite-family-card span {
        font-size: 0.72rem !important;
    }

    body[data-template].layout-l1 .invite-family-card strong {
        font-size: 0.98rem !important;
        line-height: 1.28 !important;
    }

    body[data-template].layout-l1 .bottom-nav.experience-menu button span {
        font-size: 0.64rem !important;
    }
}

/* =========================================================
   L1 — Refuerzo de lectura móvil: mensaje + countdown + RSVP
========================================================= */

@media (max-width: 480px) {
    /* Mensaje en negrita */
    body[data-template].layout-l1 .invite-short {
        font-size: 1.08rem !important;
        line-height: 1.5 !important;
    }

    /* Texto debajo del mensaje en negrita */
    body[data-template].layout-l1 .invite-message,
    body[data-template].layout-l1 .invite-profile-story,
    body[data-template].layout-l1 .invite-additional-message {
        font-size: 1.02rem !important;
        line-height: 1.62 !important;
    }

    /* Countdown */
    body[data-template].layout-l1 .event-action-days strong {
        font-size: 2rem !important;
        line-height: 1 !important;
    }

    body[data-template].layout-l1 .event-action-days span {
        font-size: 0.68rem !important;
        letter-spacing: 0.10em !important;
    }

    body[data-template].layout-l1 .event-action-time {
        margin-top: 10px !important;
    }

    body[data-template].layout-l1 .event-action-time strong span {
        font-size: 0.96rem !important;
    }

    /* RSVP */
    body[data-template].layout-l1 .event-action-rsvp::before {
        font-size: 1.7rem !important;
        letter-spacing: 0.10em !important;
    }

    body[data-template].layout-l1 .event-action-rsvp::after {
        font-size: 0.8rem !important;
        letter-spacing: 0.14em !important;
    }

    body[data-template].layout-l1 .event-action-rsvp small {
        font-size: 0.68rem !important;
        line-height: 1.2 !important;
        opacity: 0.72 !important;
    }
}

/* =========================================================
   L1 — Tipografía móvil base 360px / OPPO Find X3 Pro
========================================================= */

@media (max-width: 480px) {
    body[data-template].layout-l1 {
        --l1-text-size: 0.94rem;
        --l1-text-line: 1.5;
        --l1-label-size: 0.68rem;
        --l1-important-size: 1.04rem;
    }

    body[data-template].layout-l1 .invite-card {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    body[data-template].layout-l1 .invite-name {
        font-size: clamp(2.55rem, 11vw, 3.25rem) !important;
        line-height: 1.12 !important;
    }

    body[data-template].layout-l1 .invite-name.invite-name-medium {
        font-size: clamp(2.25rem, 9.5vw, 3rem) !important;
        line-height: 1.16 !important;
    }

    body[data-template].layout-l1 .invite-name.invite-name-long {
        font-size: clamp(1.85rem, 8vw, 2.45rem) !important;
        line-height: 1.2 !important;
    }

    body[data-template].layout-l1 .invite-message,
    body[data-template].layout-l1 .invite-profile-story,
    body[data-template].layout-l1 .invite-additional-message {
        font-size: var(--l1-text-size) !important;
        line-height: var(--l1-text-line) !important;
        font-weight: 500 !important;
    }

    body[data-template].layout-l1 .invite-short {
        font-size: 1rem !important;
        line-height: 1.42 !important;
        font-weight: 800 !important;
    }

    body[data-template].layout-l1 .event-row {
        padding: 16px 0 !important;
    }

    body[data-template].layout-l1 .event-row small,
    body[data-template].layout-l1 .invite-family-card span {
        font-size: var(--l1-label-size) !important;
        line-height: 1.2 !important;
    }

    body[data-template].layout-l1 .event-row strong {
        font-size: var(--l1-important-size) !important;
        line-height: 1.25 !important;
    }

    body[data-template].layout-l1 .event-row:first-child strong {
        font-size: 1.08rem !important;
    }

    body[data-template].layout-l1 .event-row span {
        font-size: 0.88rem !important;
        line-height: 1.36 !important;
    }

    body[data-template].layout-l1 .invite-family-card strong {
        font-size: 0.94rem !important;
        line-height: 1.24 !important;
    }

    body[data-template].layout-l1 .event-action-days strong {
        font-size: 1.62rem !important;
    }

    body[data-template].layout-l1 .event-action-days span {
        font-size: 0.58rem !important;
    }

    body[data-template].layout-l1 .event-action-time strong span {
        font-size: 0.78rem !important;
    }

    body[data-template].layout-l1 .event-action-rsvp::before {
        font-size: 1.5rem !important;
    }

    body[data-template].layout-l1 .event-action-rsvp small {
        font-size: 0.58rem !important;
        line-height: 1.15 !important;
    }

    body[data-template].layout-l1 .event-action-rsvp::after {
        font-size: 0.66rem !important;
        letter-spacing: 0.13em !important;
    }

    body[data-template].layout-l1 .bottom-nav.experience-menu button span {
        font-size: 0.58rem !important;
        line-height: 1.1 !important;
    }
}

/* =========================================================
   L1 — Compactación específica: fecha / ceremonia / recepción
========================================================= */

@media (max-width: 480px) {
    body[data-template].layout-l1 .event-box {
        margin-top: 14px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body[data-template].layout-l1 .event-row {
        padding: 10px 0 !important;
        margin-bottom: 0 !important;
        gap: 3px !important;
    }

    body[data-template].layout-l1 .event-row:first-child {
        padding-bottom: 10px !important;
    }

    body[data-template].layout-l1 .event-row + .event-row {
        padding-top: 12px !important;
    }

    body[data-template].layout-l1 .event-row .em-icon {
        margin-bottom: 1px !important;
    }

    body[data-template].layout-l1 .event-row small {
        margin-bottom: 3px !important;
        line-height: 1.1 !important;
    }

    body[data-template].layout-l1 .event-row strong {
        line-height: 1.18 !important;
    }

    body[data-template].layout-l1 .event-row span {
        line-height: 1.26 !important;
    }
}

/* =========================================================
   L1 — Countdown + RSVP compacto e integrado
========================================================= */

@media (max-width: 480px) {
    body[data-template].layout-l1 .event-action-card {
        width: calc(100% - 56px) !important;
        max-width: 350px !important;
        margin-top: 4px !important;
        margin-bottom: 2px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        min-height: auto !important;
        border-top-color: rgba(120, 90, 70, 0.10) !important;
        border-bottom-color: rgba(120, 90, 70, 0.10) !important;
    }

    body[data-template].layout-l1 .event-action-card::before {
        height: 46px !important;
        opacity: 0.65 !important;
    }

    body[data-template].layout-l1 .event-action-countdown {
        padding-right: 8px !important;
    }

    body[data-template].layout-l1 .event-action-days strong {
        font-size: 1.48rem !important;
        line-height: 0.95 !important;
    }

    body[data-template].layout-l1 .event-action-days span {
        font-size: 0.54rem !important;
        line-height: 1 !important;
        margin-top: 2px !important;
    }

    body[data-template].layout-l1 .event-action-time {
        margin-top: 5px !important;
    }

    body[data-template].layout-l1 .event-action-time strong span {
        font-size: 0.72rem !important;
    }

    body[data-template].layout-l1 .event-action-rsvp {
        padding-left: 8px !important;
        gap: 2px !important;
    }

    body[data-template].layout-l1 .event-action-rsvp::before {
        font-size: 1.38rem !important;
        line-height: 0.95 !important;
        letter-spacing: 0.12em !important;
    }

    body[data-template].layout-l1 .event-action-rsvp small {
        margin-top: 0 !important;
        font-size: 0.54rem !important;
        line-height: 1.1 !important;
        opacity: 0.7 !important;
    }

    body[data-template].layout-l1 .event-action-rsvp::after {
        font-size: 0.62rem !important;
        line-height: 1 !important;
        letter-spacing: 0.13em !important;
    }
}

/* =========================================================
   Preview catálogo — Barra más compacta y menos invasiva
========================================================= */

@media (max-width: 480px) {
    .catalog-preview-bar {
        top: 8px !important;
        width: calc(100vw - 28px) !important;
        max-width: 360px !important;
        padding: 7px 10px !important;
        border-radius: 18px !important;
        gap: 5px !important;
        opacity: 0.92 !important;
    }

    .catalog-preview-bar strong {
        font-size: 0.56rem !important;
        line-height: 1 !important;
        letter-spacing: 0.10em !important;
    }

    .catalog-preview-actions {
        gap: 6px !important;
    }

    .catalog-preview-actions a {
        min-height: 28px !important;
        font-size: 0.62rem !important;
        padding: 0 10px !important;
    }

    body.catalog-preview-mode {
        padding-top: 76px !important;
    }
}

/* =========================================================
   L1 — Aire inferior seguro sobre menú fijo
========================================================= */

@media (max-width: 480px) {
    body[data-template].layout-l1 .invitation-phone {
        padding-bottom: 112px !important;
    }

    body[data-template].layout-l1 .event-action-card {
        margin-bottom: 18px !important;
    }

    body[data-template].layout-l1 .bottom-nav.experience-menu {
        min-height: 72px !important;
    }
}

/* =========================================================
   L1 — Eliminar corazones en padres / padrinos / testigos
========================================================= */

body[data-template].layout-l1 .invite-family-card::after {
    content: none !important;
    display: none !important;
}