/* ==========================================================================
   Puentec Carousel - Modern Fullscreen Hero Banner
   ========================================================================== */

/* --- Fullscreen container: breaks out of any parent wrapper --- */
.puentec-carousel {
    position: relative !important;
    width: 100vw !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #000 !important;
    max-width: none !important;
}

/* --- Slide wrapper: full viewport height --- */
.puentec-carousel-wrapper {
    position: relative;
    width: 100%;
    height: 75vh;
    min-height: 480px;
    max-height: 800px;
    overflow: hidden;
    border-radius: 0;
}

/* --- Individual slide --- */
.puentec-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.puentec-carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

/* --- Image container --- */
.puentec-carousel-image-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.puentec-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    display: block;
}

/* Desktop/mobile image toggling */
.puentec-carousel-desktop-image {
    display: block;
}

.puentec-carousel-mobile-image {
    display: none;
}

/* --- Overlay gradient for text legibility --- */
.puentec-carousel-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 30%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 3;
    pointer-events: none;
}

/* --- Content overlay (title, description, CTA) --- */
.puentec-carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    color: #fff;
    padding: 60px 80px 80px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Animate content in when slide is active */
.puentec-carousel-slide .puentec-carousel-content {
    opacity: 0;
    transform: translateY(30px);
}

.puentec-carousel-slide.active .puentec-carousel-content {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

/* --- Title --- */
.puentec-carousel-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 12px 0;
    color: #fff;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    max-width: 700px;
}

/* --- Description --- */
.puentec-carousel-description {
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    font-weight: 400;
    line-height: 1.6;
    margin: 0 0 28px 0;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
    max-width: 560px;
}

/* --- CTA Button --- */
.puentec-carousel-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #111;
    padding: 14px 32px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.puentec-carousel-button:hover {
    background: #111;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.puentec-carousel-button:active {
    transform: translateY(0);
}

/* --- Navigation Arrows --- */
.puentec-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 300;
    opacity: 0;
}

.puentec-carousel:hover .puentec-carousel-arrow {
    opacity: 1;
}

.puentec-carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.08);
}

.puentec-carousel-prev {
    left: 24px;
}

.puentec-carousel-next {
    right: 24px;
}

/* --- Dot Navigation / Progress Indicators --- */
.puentec-carousel-dots {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
}

.puentec-carousel-dot {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    border: none;
    padding: 0;
    transition: all 0.3s ease;
}

.puentec-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

.puentec-carousel-dot.active {
    width: 56px;
    background: rgba(255, 255, 255, 0.4);
}

.puentec-carousel-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #fff;
    width: 0%;
    border-radius: 4px;
    transition: width 0.1s linear;
}

.puentec-carousel-dot.active .puentec-carousel-progress {
    animation: fillProgress var(--autoplay-speed, 3000ms) linear forwards;
}

@keyframes fillProgress {
    from { width: 0%; }
    to { width: 100%; }
}

/* --- Focus states for accessibility --- */
.puentec-carousel-arrow:focus-visible,
.puentec-carousel-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.puentec-carousel-arrow:focus:not(:focus-visible),
.puentec-carousel-dot:focus:not(:focus-visible) {
    outline: none;
}

/* --- Loading state --- */
.puentec-carousel-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
}

.puentec-carousel-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

/* Empty slide guard */
.puentec-carousel-slide:empty {
    display: none;
}

/* ==========================================================================
   Tablet Breakpoint
   ========================================================================== */
@media (max-width: 1024px) {
    .puentec-carousel-wrapper {
        height: 60vh;
        min-height: 400px;
    }

    .puentec-carousel-content {
        padding: 40px 48px 60px;
    }

    .puentec-carousel-prev {
        left: 16px;
    }

    .puentec-carousel-next {
        right: 16px;
    }
}

/* ==========================================================================
   Mobile Breakpoint
   ========================================================================== */
@media (max-width: 768px) {
    .puentec-carousel-desktop-image {
        display: none;
    }

    .puentec-carousel-mobile-image {
        display: block;
    }

    .puentec-carousel-wrapper {
        height: 85vh;
        min-height: 500px;
        max-height: none;
    }

    .puentec-carousel-content {
        padding: 24px 24px 80px;
        align-items: center;
        text-align: center;
    }

    .puentec-carousel-title {
        font-size: clamp(1.4rem, 6vw, 2rem);
        text-align: center;
        max-width: 100%;
    }

    .puentec-carousel-description {
        font-size: 0.95rem;
        text-align: center;
        max-width: 100%;
    }

    .puentec-carousel-button {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    /* Arrows always visible on mobile (no hover) */
    .puentec-carousel-arrow {
        opacity: 1;
        width: 40px;
        height: 40px;
        font-size: 20px;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border: none;
    }

    .puentec-carousel-arrow:hover {
        transform: translateY(-50%) scale(1);
    }

    .puentec-carousel-prev {
        left: 12px;
    }

    .puentec-carousel-next {
        right: 12px;
    }

    .puentec-carousel-dots {
        bottom: 20px;
    }

    .puentec-carousel-dot {
        width: 28px;
        height: 3px;
    }

    .puentec-carousel-dot.active {
        width: 40px;
    }
}

/* Touch devices: always show content */
@media (hover: none) {
    .puentec-carousel-arrow {
        opacity: 1;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .puentec-carousel-wrapper {
        height: 75vh;
        min-height: 420px;
    }

    .puentec-carousel-content {
        padding: 20px 20px 72px;
    }
}
