/**
 * Hero de portada — carrusel apilado de tarjetas (paragraphs hero_slide).
 * Réplica del "deck" del hero de Lovable: la tarjeta activa delante y las
 * siguientes asomando detrás, desplazadas 10/20/30 px, desenfocadas.
 * El JS (js/hero-deck.js) solo cambia data-pos en cada tarjeta.
 */

.hero__deck-col {
    display: flex;
    align-items: center;
}

.hero-deck {
    --deck-accent: #f44e4e;
    --deck-ease: cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    width: 100%;
    max-width: 560px;
    margin-left: auto;
}

.hero-deck__stack {
    display: grid;
    grid-template-areas: "stack";
}

/* --- Tarjeta --------------------------------------------------------- */
.hero-deck__card {
    grid-area: stack;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(26px, 2.4vw, 40px) clamp(20px, 2.2vw, 32px) clamp(14px, 1.4vw, 20px);
    background: radial-gradient(120% 100% at 30% 0%, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04) 55%, rgba(255, 255, 255, 0.02) 100%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border-radius: 0 0 12px 0;
    color: var(--color-white);
    overflow-wrap: anywhere;
    /* Estado "detrás" por defecto; data-pos lo afina. */
    opacity: 0;
    transform: translate(30px, 30px) scale(0.96);
    filter: blur(4px);
    pointer-events: none;
    z-index: 5;
    box-shadow: none;
    transition:
        opacity 1.8s var(--deck-ease),
        transform 1.8s var(--deck-ease),
        filter 1.8s var(--deck-ease),
        box-shadow 1.8s var(--deck-ease);
    will-change: opacity, transform, filter;
}

/* Borde degradado de 1px + brillo superior (como .hero-soft-card). */
.hero-deck__card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.9;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.15) 25%, rgba(255, 255, 255, 0.02) 55%, rgba(3, 159, 255, 0.18) 100%);
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000, #000) content-box exclude, linear-gradient(#000, #000);
}

.hero-deck__card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(140% 90% at 20% 0, rgba(255, 255, 255, 0.08), transparent 60%);
}

.hero-deck__card[data-pos="0"] {
    opacity: 1;
    transform: none;
    filter: none;
    pointer-events: auto;
    z-index: 10;
    box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.45), 0 0 60px -20px rgba(3, 159, 255, 0.15);
}

.hero-deck__card[data-pos="1"] { opacity: 0.22; transform: translate(10px, 10px) scale(0.96); z-index: 9; }
.hero-deck__card[data-pos="2"] { opacity: 0.22; transform: translate(20px, 20px) scale(0.96); z-index: 8; }
.hero-deck__card[data-pos="3"] { opacity: 0.22; transform: translate(30px, 30px) scale(0.96); z-index: 7; }

/* --- Contenido ------------------------------------------------------- */
.hero-deck__kicker {
    margin: 0;
    color: var(--deck-accent);
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-deck__title {
    margin: 12px 0 0;
    color: var(--color-white);
    font-family: var(--font-family-base);
    font-size: clamp(1.25rem, 1.75vw, 1.5625rem);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.03em;
}

.hero-deck__title strong,
.hero-deck__title b {
    color: var(--deck-accent);
    font-weight: 500;
}

.hero-deck__body {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    color: rgba(232, 240, 249, 0.85);
    font-size: 15px;
    line-height: 1.625;
}

.hero-deck__body--logos {
    flex-wrap: wrap;
    gap: 12px 20px;
}

.hero-deck__logo {
    width: auto;
    height: auto;
    max-width: 165px;
    max-height: 32px;
    object-fit: contain;
}

.hero-deck__icon {
    width: auto;
    height: auto;
    max-width: min(300px, 100%);
    max-height: 180px;
    object-fit: contain;
}

.hero-deck__body--split {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    margin-top: 0;
    text-align: left;
}

.hero-deck__list {
    margin-top: 12px;
}

.hero-deck__list p {
    margin: 0;
}

.hero-deck__list ul {
    margin: 4px 0 0;
    padding-left: 20px;
    list-style: disc;
}

.hero-deck__body--split .hero-deck__icon {
    flex-shrink: 0;
    width: 170px;
    max-height: 170px;
    margin: 8px 0 0 38px;
}

@media (max-width: 575.98px) {
    .hero-deck__body--split .hero-deck__icon {
        width: 110px;
        margin-left: 8px;
    }
}

.hero-deck__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 16px;
}

.hero-deck__btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 22px;
    border-radius: 0 0 10px 0;
    background: var(--color-accent);
    color: var(--color-white);
    font-family: var(--font-family-base);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.hero-deck__btn:hover,
.hero-deck__btn:focus-visible {
    color: var(--color-white);
    background: var(--color-primary-hover);
    transform: scale(1.03);
}

.hero-deck__btn:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 3px;
}

/* --- Controles ------------------------------------------------------- */
.hero-deck__arrow {
    position: absolute;
    top: calc(50% - 15px); /* centro de la tarjeta (descontando los puntos) */
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 0.2s ease, color 0.2s ease;
}

.hero-deck__arrow--prev { left: -18px; }
.hero-deck__arrow--next { right: -18px; }

.hero-deck__arrow:hover {
    color: var(--color-white);
    transform: translateY(-50%) scale(1.1);
}

.hero-deck__arrow:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

.hero-deck__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.hero-deck__dot {
    position: relative;
    width: 8px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Zona de pulsación más grande que el punto. */
.hero-deck__dot::after {
    content: "";
    position: absolute;
    inset: -10px -4px;
}

.hero-deck__dot[aria-current="true"] {
    width: 24px;
    background: var(--color-accent);
}

.hero-deck__dot:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 3px;
}

@media (min-width: 992px) {
    .hero-deck__stack {
        min-height: 445px;
    }
}

@media (max-width: 991.98px) {
    .hero__deck-col {
        margin-top: var(--space-8, 32px);
    }

    .hero-deck {
        max-width: calc(100% - 30px);
        margin-right: auto;
        margin-left: 0;
    }

    .hero-deck__arrow--prev { left: -12px; }
    .hero-deck__arrow--next { right: -12px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-deck__card,
    .hero-deck__btn,
    .hero-deck__arrow,
    .hero-deck__dot {
        transition: none;
    }
}
