/* =============================================================================
   SUNSET RENT ESCAPADES — Frontend Styles
   Plugin Version: 1.0.0
   ============================================================================= */

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
    --sre-accent:       #F47B50;
    --sre-accent-dark:  #d96437;
    --sre-text-dark:    #1a1a2e;
    --sre-text-mid:     #555;
    --sre-text-light:   #888;
    --sre-bg-card:      #ffffff;
    --sre-shadow-sm:    0 2px 14px rgba(0, 0, 0, .07);
    --sre-shadow-md:    0 10px 36px rgba(0, 0, 0, .13);
    --sre-radius-card:  16px;
    --sre-transition:   0.22s ease;
}

/* =============================================================================
   GRILLE DE CARTES
   ============================================================================= */

.sre-escapades-grid {
    display: grid;
    gap: 20px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.sre-cols-1 { grid-template-columns: 1fr; }
.sre-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sre-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sre-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .sre-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .sre-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .sre-cols-2,
    .sre-cols-3,
    .sre-cols-4 { grid-template-columns: 1fr; }
}

/* =============================================================================
   CAROUSEL MOBILE
   ============================================================================= */

@media (max-width: 600px) {

    .sre-carousel-wrapper {
        position: relative;
        overflow: hidden;
    }

    /* Transforme la grille en piste de défilement horizontal */
    .sre-escapades-grid {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
        padding: 0 20px 4px;
        scrollbar-width: none;
        grid-template-columns: unset !important;
    }

    .sre-escapades-grid::-webkit-scrollbar {
        display: none;
    }

    /* Chaque carte occupe toute la largeur et se cale */
    .sre-escapade-card {
        scroll-snap-align: start;
        flex: 0 0 calc(100% - 40px);
        width: calc(100% - 40px);
        max-width: none;
    }

    /* Dots de pagination */
    .sre-carousel-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 14px 0 4px;
    }

    .sre-carousel-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #d1d5db;
        transition: background 0.25s ease, transform 0.25s ease;
        cursor: pointer;
        border: none;
        padding: 0;
        flex-shrink: 0;
        appearance: none;
    }

    .sre-carousel-dot.sre-dot-active {
        background: var(--sre-accent);
        transform: scale(1.25);
    }
}

@media (min-width: 601px) {
    .sre-carousel-dots {
        display: none;
    }
}

.sre-no-escapades {
    text-align: center;
    color: var(--sre-text-mid);
    padding: 40px 20px;
    font-size: 15px;
}

/* =============================================================================
   CARTE INDIVIDUELLE
   ============================================================================= */

.sre-escapade-card {
    background: transparent;
    border-radius: var(--sre-radius-card);
    overflow: visible;
    position: relative;
    box-shadow: var(--sre-shadow-sm);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform var(--sre-transition), box-shadow var(--sre-transition);
    outline: none;
}

.sre-escapade-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sre-shadow-md);
}

.sre-escapade-card:focus-visible {
    outline: 3px solid var(--sre-accent);
    outline-offset: 2px;
}

/* ── Image ── */
.sre-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e0e7ef;
    border-radius: var(--sre-radius-card);
}

.sre-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.sre-escapade-card:hover .sre-card-image-wrapper img {
    transform: scale(1.05);
}

.sre-card-no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e7ef 0%, #c8d6e8 100%);
}

/* ── Badge ── */
.sre-badge {
    position: absolute;
    top: 14px;
    right: 0;
    background: var(--sre-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 2px;
    letter-spacing: 0.1px;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(244, 123, 80, .40);
    pointer-events: none;
    z-index: 2;
    line-height: 1.3;
}

/* ── Corps (overlay sur l'image) ── */
.sre-card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 18px 18px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, .72) 0%,
        rgba(0, 0, 0, .30) 60%,
        transparent 100%
    );
    border-radius: 0 0 var(--sre-radius-card) var(--sre-radius-card);
}

.sre-card-description {
    font-size: 13.5px;
    color: #fff;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

/* =============================================================================
   OVERLAY & MODALE
   ============================================================================= */

body.sre-body-modal-open {
    overflow: hidden;
}

.sre-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sre-modal-overlay.sre-open {
    display: flex;
    animation: sreFadeIn .2s ease;
}

@keyframes sreFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Fenêtre modale ── */
.sre-modal {
    background: #fff;
    border-radius: 20px;
    max-width: 560px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .22);
    animation: sreSlideUp .28s cubic-bezier(.22, 1, .36, 1);
    scroll-behavior: smooth;
}

@keyframes sreSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sre-modal::-webkit-scrollbar { width: 5px; }
.sre-modal::-webkit-scrollbar-track { background: #f1f5f9; }
.sre-modal::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Bouton fermer ── */
.sre-modal-close {
    background-color: #ffffff00 !important;
    position: sticky;
    top: 12px;
    float: right;
    margin: 12px 14px -40px auto;
    width: 34px;
    height: 34px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    flex-shrink: 0;
}

.sre-modal-close img {
    width: 18px !important;
    height: 18px !important;
    stroke: #475569;
    max-width: none !important;
}

.sre-modal-close:hover {
    background: #e2e8f0;
}

.sre-modal-close:focus-visible {
    outline: 3px solid var(--sre-accent);
    outline-offset: 2px;
}

/* ── En-tête ── */
.sre-modal-header {
    padding: 20px 28px 0 28px;
    clear: both;
}

.sre-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--sre-text-dark);
    margin: 0 0 6px;
    line-height: 1.2;
}

.sre-modal-price {
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--sre-accent);
    padding: 5px 16px;
    border-radius: 30px;
    margin: 0 0 4px;
}

/* ── Corps de la modale ── */
.sre-modal-body {
    padding: 18px 28px 32px;
}

.sre-modal-description {
    font-size: 14.5px;
    color: var(--sre-text-mid);
    line-height: 1.7;
}

.sre-modal-description p:last-child {
    margin-bottom: 0;
}

.sre-modal-description h2,
.sre-modal-description h3,
.sre-modal-description h4 {
    color: var(--sre-text-dark);
    margin-top: 20px;
}

/* =============================================================================
   RESPONSIVE — MODALE
   ============================================================================= */

@media (max-width: 640px) {
    .sre-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .sre-modal {
        border-radius: 22px 22px 0 0;
        max-height: 90vh;
        width: 100%;
        animation: sreSlideUpMobile .3s cubic-bezier(.22, 1, .36, 1);
    }

    @keyframes sreSlideUpMobile {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    .sre-modal-header,
    .sre-modal-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .sre-badge {
        font-size: 12px;
        padding: 6px 14px;
    }
}
