/* Portada — slider invitación digital con vista previa en vivo */

.home-inv-demo-note {
    max-width: 520px;
    font-size: 15px;
    color: #3d5248;
}

.home-inv-showcase {
    padding: 2rem 0 0.5rem;
}

.home-inv-showcase__stage {
    display: grid;
    grid-template-columns: auto minmax(260px, 300px) 1.15fr auto;
    align-items: center;
    gap: 1rem 1.5rem;
    max-width: 1120px;
    margin: 0 auto;
}

.home-inv-showcase__phone-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* —— Marco teléfono —— */
.home-inv-phone-shell {
    position: relative;
    width: min(300px, 44vw);
    padding: 14px 11px 16px;
    border-radius: 40px;
    background: linear-gradient(160deg, #3a403a 0%, #1e211e 45%, #121412 100%);
    box-shadow:
        0 32px 64px rgba(20, 28, 22, 0.32),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 0 2px rgba(88, 115, 96, 0.2);
}

.home-inv-phone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 88px;
    height: 26px;
    border-radius: 0 0 16px 16px;
    background: #121412;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.home-inv-phone-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 19.2;
    border-radius: 28px;
    overflow: hidden;
    background: #0f110f;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.home-inv-phone-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #f8f6f2;
}

.home-inv-phone-iframe {
    position: absolute;
    top: 0;
    left: 50%;
    width: 390px;
    height: 844px;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    transform: translateX(-50%) scale(var(--home-inv-scale, 0.72));
    transform-origin: top center;
    opacity: 0;
    transition: opacity 0.45s ease;
    will-change: transform, opacity;
}

.home-inv-phone-iframe.is-visible {
    opacity: 1;
}

/* —— Loader profesional —— */
.home-inv-loader {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 1.5rem;
    background: linear-gradient(165deg, #f6f8f5 0%, #eef2ec 50%, #e8ede8 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.home-inv-phone-shell:not(.is-loading) .home-inv-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.home-inv-loader.is-done {
    opacity: 0;
}

.home-inv-loader__spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(88, 115, 96, 0.2);
    border-top-color: #587360;
    border-right-color: #c4a962;
    animation: homeInvSpin 0.85s linear infinite;
}

@keyframes homeInvSpin {
    to { transform: rotate(360deg); }
}

.home-inv-loader__label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #3d5248;
}

.home-inv-loader__track {
    width: min(160px, 70%);
    height: 4px;
    border-radius: 999px;
    background: rgba(88, 115, 96, 0.15);
    overflow: hidden;
}

.home-inv-loader__bar {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #587360 0%, #7a9a82 50%, #c4a962 100%);
    transition: width 0.25s ease;
}

.home-inv-phone-hint {
    max-width: 300px;
    line-height: 1.4;
    font-size: 13px;
}

/* —— Panel info —— */
.home-inv-showcase__info {
    min-width: 0;
    max-width: 100%;
}

.home-inv-showcase__info-inner {
    background: #fff;
    border-radius: 24px;
    padding: 1.5rem 1.65rem;
    box-shadow: 0 12px 40px rgba(40, 50, 42, 0.08);
    border: 1px solid rgba(88, 115, 96, 0.12);
    transition: opacity 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.home-inv-actions {
    width: 100%;
    max-width: 100%;
}

.home-inv-actions .btn {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
}

.home-inv-slide-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
}

.home-inv-badge--premium {
    background: linear-gradient(135deg, #8a6d3b 0%, #c4a962 100%);
    color: #fff;
}

.home-inv-badge--free {
    background: rgba(88, 115, 96, 0.15);
    color: #3d5248;
}

.home-inv-counter {
    font-size: 13px;
    color: #00000080;
    font-weight: 600;
}

.home-inv-slide-title {
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 600;
    color: #1a1f1a;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.home-inv-slide-desc {
    font-size: 15px;
    color: #4a554c;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.home-inv-features {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.home-inv-features li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.45rem;
    font-size: 14px;
    color: #2d3a30;
    line-height: 1.4;
    break-inside: avoid;
}

.home-inv-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #587360;
}

.home-inv-nav {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #587360;
    font-size: 1.85rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
    flex-shrink: 0;
}

.home-inv-nav:hover {
    background: #587360;
    color: #fff;
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(88, 115, 96, 0.35);
}

.home-inv-nav:active {
    transform: scale(0.98);
}

/* —— Miniaturas —— */
.home-inv-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.65rem;
    justify-content: center;
    overflow-x: auto;
    padding: 0.25rem 0.5rem 1.25rem;
    margin-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-width: 100%;
}

.home-inv-thumb {
    flex: 0 0 auto;
    min-width: 148px;
    max-width: 200px;
    padding: 0.8rem 1rem;
    border: 2px solid rgba(88, 115, 96, 0.18);
    border-radius: 16px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s, opacity 0.25s;
}

.home-inv-thumb:hover {
    border-color: #587360;
    transform: translateY(-2px);
}

.home-inv-thumb.is-active {
    border-color: #587360;
    box-shadow: 0 10px 28px rgba(88, 115, 96, 0.22);
    background: linear-gradient(180deg, #fff 0%, #f0f5f1 100%);
}

.home-inv-thumb.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

.home-inv-thumb-badge {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #587360;
    margin-bottom: 0.25rem;
}

.home-inv-thumb-badge.is-premium {
    color: #8a6d3b;
}

.home-inv-thumb-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1f1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Evita scroll horizontal en toda la página por esta sección */
.section_plantillas {
    overflow-x: clip;
}

@media (max-width: 991.98px) {
    .section_plantillas {
        padding: 56px 0 64px;
    }

    .section_plantillas .text_plantillas h2 {
        font-size: clamp(1.35rem, 5.5vw, 2rem);
        margin-bottom: 1rem;
        line-height: 1.2;
        padding-inline: 0.25rem;
    }

    .home-inv-showcase {
        padding-top: 1.25rem;
    }

    .home-inv-showcase__stage {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        justify-items: center;
        gap: 1.25rem;
        position: relative;
        padding: 0;
        max-width: 100%;
    }

    .home-inv-nav {
        position: absolute;
        top: 38%;
        transform: translateY(-50%);
        z-index: 6;
    }

    .home-inv-nav--prev {
        left: 0;
    }

    .home-inv-nav--next {
        right: 0;
    }

    .home-inv-nav:hover {
        transform: translateY(-50%) scale(1.06);
    }

    .home-inv-showcase__phone-col {
        width: 100%;
        max-width: 100%;
        padding-inline: 2.75rem;
        box-sizing: border-box;
    }

    .home-inv-showcase__info {
        width: 100%;
        max-width: 100%;
        padding-inline: 0;
        box-sizing: border-box;
    }

    .home-inv-showcase__info-inner {
        padding: 1.25rem 1rem;
    }

    .home-inv-features {
        display: block !important;
        grid-template-columns: unset !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 0 1rem !important;
    }

    .home-inv-features li {
        font-size: 13px;
    }

    .home-inv-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-inv-actions .btn {
        width: 100%;
        flex: 1 1 auto;
    }

    /* Carrusel de plantillas a ancho completo, sin recortar tarjetas a los lados */
    .home-inv-thumbs {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.5rem;
        width: 100%;
        max-width: none;
        margin-left: calc(-0.5 * var(--bs-gutter-x, 1.5rem));
        margin-right: calc(-0.5 * var(--bs-gutter-x, 1.5rem));
        padding: 0.25rem calc(var(--bs-gutter-x, 1.5rem) * 0.5) 1rem;
        scroll-padding-inline: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .home-inv-thumbs::-webkit-scrollbar {
        display: none;
    }

    .home-inv-thumb {
        flex: 0 0 auto;
        min-width: min(38vw, 148px);
        max-width: min(42vw, 168px);
        scroll-snap-align: start;
        padding: 0.65rem 0.75rem;
    }

    .home-inv-thumb-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: unset;
        font-size: 12px;
    }
}

@media (max-width: 575.98px) {
    .section_plantillas {
        padding: 44px 0 56px;
    }

    .home-inv-demo-note {
        font-size: 14px;
        padding-inline: 0.25rem;
    }

    .home-inv-phone-shell {
        width: min(240px, 72vw);
        padding: 12px 10px 14px;
    }

    .home-inv-showcase__phone-col {
        padding-inline: 0;
    }

    .home-inv-nav {
        display: none;
    }

    .home-inv-showcase__info-inner {
        padding: 1rem 0.9rem;
        border-radius: 18px;
    }

    .home-inv-slide-title {
        font-size: 1.15rem;
    }

    .home-inv-thumb {
        min-width: min(44vw, 140px);
        max-width: min(48vw, 156px);
    }

    .home-inv-phone-hint {
        font-size: 12px;
        max-width: 260px;
    }
}
