/**
 * Hero Slider Block Styles
 * Carrusel de slides con imagen de fondo, titulo, descripcion y CTA
 * Mobile first - Usa variables de theme.json
 */

/* ===========================
   CONTENEDOR PRINCIPAL
   =========================== */

.hero-slider {
    position: relative;
    width: 100%;
    height: calc( var(--hero-slider-height, 800px) - 80px);
    overflow: hidden;
}

/* ===========================
   SPLIDE CONTAINER (absolute, fills the section)
   =========================== */

.hero-slider__splide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slider__splide .splide__track,
.hero-slider__splide .splide__list,
.hero-slider__splide .splide__slide {
    height: 100%;
}

/* ===========================
   SLIDE
   =========================== */

.hero-slider__slide {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--wp--preset--color--text-dark);
}

/* Overlay plano que cubre todo el contenedor.
   --hero-slider-overlay-opacity es el porcentaje de oscurecimiento (0-1).
   Default 0.25 = 25% negro. */
.hero-slider__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, var(--hero-slider-overlay-opacity, 0.25));
    z-index: 1;
    pointer-events: none;
}

/* ===========================
   SLIDE CONTENT
   =========================== */

/* Content overlay - positioned absolute inside each .hero-slider__slide */
.hero-slider__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: var(--wp--style--global--wide-size, 1400px);
    margin: 0 auto;
    padding: 0 var(--wp--preset--spacing--extra-large);
    box-sizing: border-box;
}

.hero-slider__text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: var(--hero-slider-content-width, 800px);
    max-width: 100%;
}

/* Titles group (subtitle + title) */
.hero-slider__titles-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Subtitle / Pretitle (Figma: 24px, weight 500, DM Sans) */
.hero-slider__subtitle {
    font-family: var(--wp--preset--font-family--inter);
    font-weight: 500;
    font-size: var(--wp--preset--font-size--medium);
    line-height: 1.3;
    color: var(--wp--preset--color--white);
    margin: 0;
}

/* Title - H1 Bold (Figma: 64px, weight 700) */
.hero-slider__title {
    font-family: var(--wp--preset--font-family--inter);
    font-weight: 700;
    font-size: var(--wp--preset--font-size--huge);
    line-height: 1.21;
    color: var(--wp--preset--color--white);
    margin: 0;
    text-shadow: 0 4px 4px rgba(0, 0, 0, 0.12);
}

/* Description - H4 Medium (Figma: 24px, weight 500) */
.hero-slider__description {
    font-family: var(--wp--preset--font-family--inter);
    font-weight: 500;
    font-size: var(--wp--preset--font-size--medium);
    line-height: 1.21;
    color: var(--wp--preset--color--white);
    margin: 0;
    text-shadow:  0 4px 4px rgba(0, 0, 0, 0.12);;
}

/* CTA wrapper */
.hero-slider__cta-wrapper {
    display: flex;
    align-items: center;
}

/* CTA Button (Figma: Primary, Large, border-radius 24px) */
.hero-slider__cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    height: 48px;
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--inter);
    font-weight: 700;
    font-size: var(--wp--preset--font-size--body-large);
    line-height: 1.21;
    text-decoration: none;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.hero-slider__cta:hover {
    background-color: var(--wp--preset--color--primary-hover);
    color: var(--wp--preset--color--white);
}

.hero-slider__cta:focus {
    outline: 2px solid var(--wp--preset--color--white);
    outline-offset: 2px;
}

/* ===========================
   BREADCRUMBS
   Figma: position absolute, top 40px, left 64px
   Inter 500 · 16px · blanco · separador "/"
   =========================== */

.hero-slider__breadcrumbs {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    z-index: 3;
    max-width: var(--wp--style--global--wide-size, 1400px);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--wp--preset--spacing--extra-large);
    box-sizing: border-box;
}

.hero-slider__breadcrumbs-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Separador "/" entre items generado con ::before */
.hero-slider__breadcrumbs-item + .hero-slider__breadcrumbs-item::before {
    content: '/';
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--normal);
    font-weight: 500;
    color: var(--wp--preset--color--white);
    margin-right: 8px;
}

.hero-slider__breadcrumbs-link,
.hero-slider__breadcrumbs-current {
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--normal);
    font-weight: 500;
    line-height: 1.21;
    color: var(--wp--preset--color--white);
    text-decoration: none;
    white-space: nowrap;
}

.hero-slider__breadcrumbs-link:hover {
    text-decoration: underline;
    color: var(--wp--preset--color--white);
}

.hero-slider__breadcrumbs-link:focus-visible {
    outline: 2px solid var(--wp--preset--color--white);
    outline-offset: 2px;
    border-radius: var(--wp--custom--border-radius--sm);
}

/* Página actual: sin enlace, misma apariencia */
.hero-slider__breadcrumbs-item.is-current .hero-slider__breadcrumbs-current {
    opacity: 0.85;
}

/* Tablet / mobile */
@media (max-width: 1024px) {
    .hero-slider__breadcrumbs {
        padding: 0 var(--wp--preset--spacing--medium);
    }
}

@media (max-width: 768px) {
    .hero-slider__breadcrumbs {
        top: 24px;
        padding: 0 var(--wp--preset--spacing--small);
    }

    .hero-slider__breadcrumbs-link,
    .hero-slider__breadcrumbs-current {
        font-size: var(--wp--preset--font-size--small);
    }

    .hero-slider__breadcrumbs-item + .hero-slider__breadcrumbs-item::before {
        font-size: var(--wp--preset--font-size--small);
    }
}

/* ===========================
   NAVIGATION ARROWS (Figma: CaretLeft/CaretRight)
   =========================== */

/* Arrows container - direct child of .hero-slider (outside splide for z-index) */
.hero-slider__arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.hero-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    background-color: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--secondary);
    border-radius: var(--wp--custom--border-radius--lg);
    color: var(--wp--preset--color--text-dark);
    cursor: pointer;
    pointer-events: all;
    box-shadow: var(--wp--custom--shadow--lg);
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    box-sizing: border-box;
    opacity: 0;
}

.hero-slider:hover .hero-slider__arrow {
    opacity: 1;
}

.hero-slider__arrow:hover {
    background-color: var(--wp--preset--color--light-gray);
}

.hero-slider__arrow:focus {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
}

.hero-slider__arrow--prev {
    left: 40px;
}

.hero-slider__arrow--next {
    right: 40px;
}

.hero-slider__arrow svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Hide Splide default arrows (we use custom ones) */
.hero-slider__splide > .splide__arrows {
    display: none;
}

/* ===========================
   PAGINATION DOTS (Figma: active=pill 103x8, inactive=circle 8x8)
   =========================== */

.hero-slider__pagination.splide__pagination {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.hero-slider__pagination .splide__pagination__page {
    display: block;
    width: 8px;
    height: 8px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.hero-slider__pagination .splide__pagination__page.is-active {
    width: 103px;
    background-color: var(--wp--preset--color--white);
}

.hero-slider__pagination .splide__pagination__page:focus {
    outline: 2px solid var(--wp--preset--color--white);
    outline-offset: 2px;
}

/* ===========================
   DECORATIVE ELLIPSE
   =========================== */

.hero-slider__ellipse {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -460px;
    width: 200%;
    height: 529px;
    background-color: var(--wp--preset--color--white);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

/* ===========================
   RESPONSIVE - TABLET (768px)
   =========================== */

@media (max-width: 1024px) {
    .hero-slider__content {
        padding: 0 var(--wp--preset--spacing--medium);
    }

    .hero-slider__arrow--prev {
        left: 16px;
    }

    .hero-slider__arrow--next {
        right: 16px;
    }

    .hero-slider__text-wrapper {
        gap: 32px;
    }

    .hero-slider__ellipse {
        bottom: -350px;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 90vh;
        min-height: 500px;
    }

    .hero-slider__slide {
        min-height: 90vh;
    }

    .hero-slider__content {
        padding: 0 var(--wp--preset--spacing--small);
        align-items: center;
    }

    .hero-slider__text-wrapper {
        width: 100%;
        gap: 80px;
        text-align: center;
    }

    .hero-slider__subtitle {
        font-size: var(--wp--preset--font-size--medium);
        text-align: center;
    }

    .hero-slider__title {
        font-size: 48px;
        text-align: center;
    }

    .hero-slider__description {
        font-size: var(--wp--preset--font-size--normal);
        text-align: center;
    }

    .hero-slider__cta-wrapper {
        justify-content: center;
    }

    .hero-slider__cta {
        font-size: var(--wp--preset--font-size--normal);
        padding: 12px 20px;
        height: 44px;
    }

    /* Hide custom arrows on mobile */
    .hero-slider__arrows {
        display: none;
    }

    /* Dots closer to bottom */
    .hero-slider__pagination.splide__pagination {
        bottom: 70px;
        gap: 16px;
    }

    .hero-slider__pagination .splide__pagination__page.is-active {
        width: 60px;
    }

    .hero-slider__ellipse {
        bottom: -250px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .hero-slider__slide {
        min-height: 90vh;
    }

    .hero-slider__text-wrapper {
        gap: 80px;
    }

    .hero-slider__description {
        font-size: var(--wp--preset--font-size--small);
    }

    .hero-slider__pagination.splide__pagination {
        bottom: 60px;
        gap: 12px;
    }

    .hero-slider__pagination .splide__pagination__page.is-active {
        width: 48px;
    }

    .hero-slider__ellipse {
        bottom: -200px;
        height: 250px;
    }
}

/* ===========================
   BOTÓN FLOTANTE (scroll down)
   Figma: Button - Style=Only Icon, Type=Secondary, Size=Large
   =========================== */

@keyframes hero-float {
    0%, 100% { transform: translateX(-50%) translateY(0px); }
    50%       { transform: translateX(-50%) translateY(-10px); }
}

.hero-slider .hero-slider__floating-btn {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background-color: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--secondary);
    border-radius: var(--wp--custom--border-radius--xl);
    box-shadow: var(--wp--custom--shadow--lg);
    color: var(--wp--preset--color--text-dark);
    text-decoration: none;
    animation: hero-float 2.4s ease-in-out infinite;
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
}

.hero-slider .hero-slider__floating-btn:hover {
    box-shadow: var(--wp--custom--shadow--md);
    opacity: 0.85;
}

.hero-slider .hero-slider__floating-btn:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .hero-slider .hero-slider__floating-btn {
        animation: none;
    }
}

@media (max-width: 768px) {
    .hero-slider .hero-slider__floating-btn {
        display: none;
    }
}

/* ===========================
   EDITOR PREVIEW
   =========================== */

.editor-styles-wrapper .hero-slider {
    min-height: 400px;
}

.editor-styles-wrapper .hero-slider__arrow {
    pointer-events: none;
    opacity: 0.7;
}

.editor-styles-wrapper .hero-slider .hero-slider__floating-btn {
    animation: none;
    pointer-events: none;
}

/* Editor placeholder (sin slides configurados) */
.hero-slider-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    background-color: var(--wp--preset--color--neutral-200);
    border: 2px dashed var(--wp--preset--color--secondary);
    border-radius: var(--wp--custom--border-radius--lg);
    padding: var(--wp--preset--spacing--large);
}

.hero-slider-placeholder__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.hero-slider-placeholder__inner svg {
    color: var(--wp--preset--color--primary);
    opacity: 0.5;
}

.hero-slider-placeholder__inner strong {
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 700;
    color: var(--wp--preset--color--text-dark);
}

.hero-slider-placeholder__inner span {
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--normal);
    color: var(--wp--preset--color--text-gray);
}
