/**
 * CPP Hero Slider - Front-Office Styles
 *
 * @author    Costume Privé Paris
 * @copyright 2024 Costume Privé Paris
 */

/* ========================================
   FORCE FULL WIDTH - BREAK OUT OF CONTAINER
   ======================================== */

.cpp-hero-slider {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    overflow: hidden;
}

.cpp-hero-slider *,
.cpp-hero-slider *::before,
.cpp-hero-slider *::after {
    box-sizing: border-box;
}

/* ========================================
   SLIDES CONTAINER
   ======================================== */

.cpp-slides-wrapper {
    position: relative;
    width: 100%;
    height: 60vh;
    max-height: 550px;
    min-height: 350px;
}

.cpp-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0c1219;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cpp-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* ========================================
   OVERLAY
   ======================================== */

.cpp-slide::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cpp-overlay-color, rgba(0,0,0,0.35));
    z-index: 1;
}

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

.cpp-hero-content {
    text-align: left;
    padding: 2rem 2.5rem;
    max-width: 480px;
    z-index: 2;
    position: absolute;
    left: 5%;
    top: 35%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.cpp-hero-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: 38px !important;
    font-weight: 800 !important;
    font-style: normal !important;
    line-height: 1.15 !important;
    text-transform: none !important;
    letter-spacing: -0.02em !important;
    color: var(--cpp-text-color, #ffffff) !important;
    text-shadow: 0 2px 15px rgba(0,0,0,0.3) !important;
    margin: 0 0 0.75rem 0 !important;
    padding: 0 !important;
}

.cpp-hero-subtitle {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    font-style: normal !important;
    letter-spacing: 0 !important;
    color: var(--cpp-text-color, #ffffff) !important;
    text-shadow: 0 1px 8px rgba(0,0,0,0.25) !important;
    margin: 0 0 0.4rem 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.cpp-hero-tagline {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    color: var(--cpp-text-color, rgba(255,255,255,0.8)) !important;
    text-shadow: none !important;
    margin: 0 0 1.25rem 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.cpp-hero-cta {
    display: inline-block !important;
    padding: 14px 32px !important;
    background-color: var(--cpp-btn-bg, #e85a5a) !important;
    color: var(--cpp-btn-text, #ffffff) !important;
    text-decoration: none !important;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border: none !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    margin: 0 !important;
}

.cpp-hero-cta:hover,
.cpp-hero-cta:focus {
    background-color: var(--cpp-btn-hover-bg, #c9a962) !important;
    color: var(--cpp-btn-hover-text, #1a2a3a) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25) !important;
    text-decoration: none !important;
}

/* ========================================
   NAVIGATION DOTS
   ======================================== */

.cpp-slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 12px;
}

.cpp-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: 2px solid rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.cpp-slider-dot:hover {
    background: rgba(255,255,255,0.6);
}

.cpp-slider-dot.active {
    background: #ffffff;
    border-color: #ffffff;
    transform: scale(1.2);
}

/* ========================================
   NAVIGATION ARROWS
   ======================================== */

.cpp-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #ffffff;
    font-size: 20px;
}

.cpp-slider-arrow:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.cpp-slider-arrow.prev {
    left: 30px;
}

.cpp-slider-arrow.next {
    right: 30px;
}

.cpp-slider-arrow svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ========================================
   TABLET STYLES (768px - 1024px)
   ======================================== */

@media screen and (max-width: 1024px) {
    .cpp-hero-slider {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        left: 50%;
        right: 50%;
    }

    .cpp-slides-wrapper {
        height: 75vh;
        min-height: 500px;
        max-height: 700px;
    }

    .cpp-hero-content {
        padding: 2rem;
        max-width: 90%;
    }

    .cpp-hero-title {
        font-size: clamp(36px, 6vw, 48px) !important;
        letter-spacing: 0.08em !important;
    }

    .cpp-hero-subtitle {
        font-size: clamp(16px, 2.5vw, 20px) !important;
    }

    .cpp-hero-tagline {
        font-size: clamp(14px, 2vw, 18px) !important;
        margin-bottom: 2.5rem !important;
    }

    .cpp-hero-cta {
        padding: 14px 35px !important;
        font-size: 13px !important;
    }

    .cpp-slider-arrow {
        width: 44px;
        height: 44px;
    }

    .cpp-slider-arrow.prev {
        left: 15px;
    }

    .cpp-slider-arrow.next {
        right: 15px;
    }
}

/* ========================================
   MOBILE STYLES (< 768px)
   ======================================== */

@media screen and (max-width: 767px) {
    /* Force full-width - SANS hauteur fixe, laisse le contenu définir */
    .cpp-hero-slider {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        left: 0 !important;
        right: 0 !important;
        position: relative !important;
        transform: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Wrapper avec hauteur fixe raisonnable */
    .cpp-slides-wrapper {
        height: 55vw !important;
        min-height: 200px !important;
        max-height: 260px !important;
    }

    .cpp-slide {
        background-position: center center !important;
        background-size: cover !important;
    }

    /* Contenu en bas du slide avec gradient */
    .cpp-hero-content {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 40px 15px 15px !important;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        text-align: center !important;
        transform: none !important;
    }

    .cpp-hero-title {
        font-size: 1.6rem !important;
        margin-bottom: 0.5rem !important;
        text-align: center !important;
    }

    .cpp-hero-subtitle {
        font-size: 1rem !important;
        text-align: center !important;
        margin-bottom: 0.5rem !important;
    }

    .cpp-hero-tagline {
        font-size: 0.85rem !important;
        margin-bottom: 1.25rem !important;
        text-align: center !important;
    }

    .cpp-hero-cta {
        padding: 12px 28px !important;
        font-size: 14px !important;
        border-radius: 50px !important;
    }
}

/* ========================================
   SMALL MOBILE (< 480px)
   ======================================== */

@media screen and (max-width: 479px) {
    .cpp-slides-wrapper {
        height: 60vw !important;
        min-height: 240px !important;
        max-height: 320px !important;
    }

    .cpp-hero-content {
        padding: 1rem 0.75rem !important;
    }

    .cpp-hero-title {
        font-size: 1.2rem !important;
    }

    .cpp-hero-subtitle {
        font-size: 0.85rem !important;
    }

    .cpp-hero-tagline {
        font-size: 0.75rem !important;
    }

    .cpp-hero-cta {
        padding: 10px 20px !important;
        font-size: 12px !important;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.cpp-slider-arrow:focus,
.cpp-slider-dot:focus,
.cpp-hero-cta:focus {
    outline: 2px solid #c9a962;
    outline-offset: 2px;
}

.cpp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes cpp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpp-slide.active .cpp-hero-content {
    animation: cpp-fadeIn 0.8s ease 0.2s both;
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .cpp-slide,
    .cpp-hero-cta,
    .cpp-slider-arrow,
    .cpp-slider-dot {
        transition: none !important;
    }

    .cpp-slide.active .cpp-hero-content {
        animation: none !important;
    }
}

/* ========================================
   DEVICE VISIBILITY
   ======================================== */

/* Desktop: > 1024px */
@media screen and (min-width: 1025px) {
    .cpp-slide.cpp-hide-desktop {
        display: none !important;
    }
    /* Hide navigation if only desktop slides exist and there's only one */
    .cpp-hero-slider.cpp-single-slide-desktop .cpp-slider-arrow,
    .cpp-hero-slider.cpp-single-slide-desktop .cpp-slider-dots {
        display: none !important;
    }
}

/* Tablet: 768px - 1024px */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .cpp-slide.cpp-hide-tablet {
        display: none !important;
    }
    .cpp-hero-slider.cpp-single-slide-tablet .cpp-slider-arrow,
    .cpp-hero-slider.cpp-single-slide-tablet .cpp-slider-dots {
        display: none !important;
    }
}

/* Mobile: < 768px */
@media screen and (max-width: 767px) {
    .cpp-slide.cpp-hide-mobile {
        display: none !important;
    }
    .cpp-hero-slider.cpp-single-slide-mobile .cpp-slider-arrow,
    .cpp-hero-slider.cpp-single-slide-mobile .cpp-slider-dots {
        display: none !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .cpp-hero-slider {
        height: auto !important;
        page-break-inside: avoid;
    }

    .cpp-slides-wrapper {
        height: auto !important;
    }

    .cpp-slide {
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .cpp-slider-arrow,
    .cpp-slider-dots {
        display: none !important;
    }
}
