/* ============================================================
   EuroCasetas Slider — Frontend Styles
   Breakpoints: 480 | 768 | 1024 | 1280 | 1440 | 1920 | 2560
   ============================================================ */

/* ---------- Container ---------- */
.ec-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #111;
    user-select: none;
}

.ec-swiper {
    width: 100%;
}

.ec-swiper .swiper-slide {
    position: relative;
    overflow: hidden;
}

/* ---------- Slide wrapper (link or div) ---------- */
.ec-slide-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

/* ---------- Overlay ---------- */
.ec-slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ---------- Video background (self-hosted MP4/WebM) ---------- */
.ec-slide-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* ---------- Video background (YouTube / Vimeo iframe) ---------- */
.ec-slide-video-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* 16:9 cover trick: always fills the container regardless of its dimensions */
.ec-slide-iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 177.78vh;
    height: 56.25vw;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    border: 0;
}

/* Hidden picture keeps the slide height when video is active */
.ec-slide-picture--hidden {
    visibility: hidden;
    pointer-events: none;
}

/* ---------- Image ---------- */
.ec-slide-picture {
    display: block;
    width: 100%;
    line-height: 0;
}

.ec-slide-img {
    display: block;
    width: 100%;
    height: 300px; /* fallback si ningún media query aplica */
    object-fit: cover;
    object-position: center;
}

/* ---------- Image heights by breakpoint ---------- */
@media (min-width: 2560px) {
    .ec-slide-img { height: 900px; }
    .ec-slide-content { max-width: 60%; margin: auto; padding: 0 80px; }
}
@media (min-width: 1920px) and (max-width: 2559px) {
    .ec-slide-img { height: 750px; }
    .ec-slide-content { max-width: 80%; margin: auto; padding: 0 80px; }
}
@media (min-width: 1440px) and (max-width: 1919px) {
    .ec-slide-img { height: 640px; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
    .ec-slide-img { height: 560px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
    .ec-slide-img { height: 490px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .ec-slide-img { height: 420px; }
}
@media (min-width: 481px) and (max-width: 767px) {
    .ec-slide-description {margin-bottom: -10% !important;}
    .ec-slide-title { font-size: clamp(.8rem, 2.5vw, 4rem) !important;}
    .ec-slide-img { height: 360px; }
}
@media (max-width: 480px) {
    .ec-slide-description {margin-bottom: -10% !important;}
    .ec-slide-title { font-size: clamp(.8rem, 2.5vw, 4rem) !important;}
    .ec-slide-img { height: 300px; }
}

/* ---------- Content overlay ---------- */
.ec-slide-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 0 80px;
}

.ec-slide-inner {
    max-width: 680px;
}

/* ---------- Typography (fluid scaling with clamp) ---------- */
.ec-slide-title {
    font-size: clamp(1.6rem, 2.5vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 .15em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
    word-wrap: break-word;
    font-family: 'Outfit', sans-serif;
}

.ec-slide-subtitle {
    font-size: clamp(1rem, 2.5vw, 4rem);
    font-weight: 400;
    line-height: 1.4;
    margin: 0 !important;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
    font-family: 'Outfit', sans-serif;
}

.ec-slide-description {
    font-size: clamp(.875rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    margin: 0 0 1.4em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    max-width: 560px;
    font-family: 'Outfit', sans-serif;
}

.ec-slide-description p { margin: 0; }

/* ---------- Button ---------- */
.ec-slide-btn-wrap { line-height: 1; }

.ec-slide-btn {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .7em 2.2em;
    border-radius: 3px;
    font-weight: 700;
    font-size: clamp(.8rem, 1vw, 1rem);
    text-transform: uppercase;
    letter-spacing: .06em;
    text-decoration: none;
    border: 2px solid transparent;
    transition: opacity .22s, transform .22s, box-shadow .22s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    cursor: pointer;
}

.ec-slide-btn:hover,
.ec-slide-btn:focus {
    opacity: .88;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

/* ---------- Navigation arrows ---------- */
.ec-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .55);
    background: rgba(0, 0, 0, .25);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background .22s, border-color .22s, transform .22s;
    padding: 0;
}

.ec-slider-btn:hover {
    background: rgba(0, 0, 0, .55);
    border-color: #fff;
    transform: translateY(-50%) scale(1.08);
}

.ec-slider-btn svg {
    width: 26px;
    height: 26px;
    display: block;
    pointer-events: none;
}

.ec-slider-prev { left: 24px; }
.ec-slider-next { right: 24px; }

/* Play / Pause button */
.ec-slider-playpause {
    position: absolute;
    bottom: 14px;
    right: 14px;
    top: auto;
    transform: none;
    width: 36px;
    height: 36px;
    z-index: 20;
}
.ec-slider-playpause:hover {
    transform: scale(1.1);
}
.ec-slider-playpause svg {
    width: 14px;
    height: 14px;
}
.ec-slider-playpause .ec-icon-play  { display: none; }
.ec-slider-playpause .ec-icon-pause { display: block; }
.ec-slider-playpause[data-playing="0"] .ec-icon-play  { display: block; }
.ec-slider-playpause[data-playing="0"] .ec-icon-pause { display: none; }

/* ---------- Pagination ---------- */
.ec-slider-pagination {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex !important;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

.ec-slider-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    pointer-events: all;
    transition: background .2s, transform .2s, width .3s;
    border: none;
    padding: 0;
    display: block;
}

.ec-slider-pagination .swiper-pagination-bullet-active {
    background: #fff;
    transform: scale(1.35);
    width: 24px;
    border-radius: 5px;
}

/* ============================================================
   Animations
   ============================================================ */

/* Elements are invisible until animated */
.ec-anim-el {
    opacity: 0;
    will-change: opacity, transform;
}

/* Active animation state */
.ec-anim-el.is-animated {
    animation-duration: .75s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(.25, .46, .45, .94);
}

.ec-anim-el.is-animated.anim-delay-1 { animation-delay: .15s; }
.ec-anim-el.is-animated.anim-delay-2 { animation-delay: .30s; }
.ec-anim-el.is-animated.anim-delay-3 { animation-delay: .45s; }
.ec-anim-el.is-animated.anim-delay-4 { animation-delay: .60s; }

/* --- Keyframes --- */
@keyframes ec-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ec-fadeInDown {
    from { opacity: 0; transform: translateY(-50px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ec-fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ec-fadeInLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ec-fadeInRight {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ec-zoomIn {
    from { opacity: 0; transform: scale(.6); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes ec-zoomOut {
    from { opacity: 0; transform: scale(1.4); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes ec-slideInLeft {
    from { opacity: 0; transform: translateX(-120%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ec-slideInRight {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ec-slideInUp {
    from { opacity: 0; transform: translateY(120%); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ec-slideInDown {
    from { opacity: 0; transform: translateY(-120%); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ec-bounceIn {
    0%   { opacity: 0; transform: scale(.3); }
    50%  { opacity: 1; transform: scale(1.06); }
    70%  { transform: scale(.92); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes ec-rotateIn {
    from { opacity: 0; transform: rotate(-200deg) scale(.5); }
    to   { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes ec-flipInX {
    from { opacity: 0; transform: perspective(500px) rotateX(90deg); }
    to   { opacity: 1; transform: perspective(500px) rotateX(0); }
}
@keyframes ec-flipInY {
    from { opacity: 0; transform: perspective(500px) rotateY(90deg); }
    to   { opacity: 1; transform: perspective(500px) rotateY(0); }
}

/* --- Map data-animation values to keyframes --- */
.is-animated[data-animation="fadeIn"]       { animation-name: ec-fadeIn; }
.is-animated[data-animation="fadeInDown"]   { animation-name: ec-fadeInDown; }
.is-animated[data-animation="fadeInUp"]     { animation-name: ec-fadeInUp; }
.is-animated[data-animation="fadeInLeft"]   { animation-name: ec-fadeInLeft; }
.is-animated[data-animation="fadeInRight"]  { animation-name: ec-fadeInRight; }
.is-animated[data-animation="zoomIn"]       { animation-name: ec-zoomIn; }
.is-animated[data-animation="zoomOut"]      { animation-name: ec-zoomOut; }
.is-animated[data-animation="slideInLeft"]  { animation-name: ec-slideInLeft; }
.is-animated[data-animation="slideInRight"] { animation-name: ec-slideInRight; }
.is-animated[data-animation="slideInUp"]    { animation-name: ec-slideInUp; }
.is-animated[data-animation="slideInDown"]  { animation-name: ec-slideInDown; }
.is-animated[data-animation="bounceIn"]     { animation-name: ec-bounceIn;  animation-duration: .95s; }
.is-animated[data-animation="rotateIn"]     { animation-name: ec-rotateIn; }
.is-animated[data-animation="flipInX"]      { animation-name: ec-flipInX; }
.is-animated[data-animation="flipInY"]      { animation-name: ec-flipInY; }

/* Elements with animation="none" become immediately visible */
.ec-anim-el[data-animation="none"] {
    opacity: 1;
}

/* ============================================================
   Responsive tweaks
   ============================================================ */

@media (max-width: 1279px) {
    .ec-slide-content { padding: 0 48px; }
    .ec-slider-btn { width: 44px; height: 44px; }
    .ec-slider-btn svg { width: 22px; height: 22px; }
    .ec-slider-prev { left: 16px; }
    .ec-slider-next { right: 16px; }
}

@media (max-width: 1023px) {
    .ec-slide-content { padding: 0 36px; }
    .ec-slide-inner   { max-width: 520px; }
}

@media (max-width: 767px) {
    .ec-slide-content { padding: 0 20px; align-items: flex-end; padding-bottom: 50px; }
    .ec-slide-inner   { max-width: 100%; }
    .ec-slider-btn    { width: 36px; height: 36px; }
    .ec-slider-btn svg { width: 18px; height: 18px; }
    .ec-slider-prev   { left: 8px; }
    .ec-slider-next   { right: 8px; }
    .ec-slider-pagination { bottom: 12px; }
}

@media (max-width: 480px) {
    .ec-slide-content { padding: 0 14px; padding-bottom: 40px; }
    .ec-slide-btn     { padding: .6em 1.6em; }
    .ec-slider-btn    { display: none; }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    .ec-slide-img                { transition: none; }
    .swiper-slide-active .ec-slide-img { transform: none; }
    .ec-anim-el.is-animated      { animation: none; opacity: 1; }
}
