/* cs-demo-shortcode.css — trigger card + popup 80×80 démo */

/* ── Trigger card ── */
.cs-demo-trigger {
    position: relative;
    display: block;
    width: 100%;
    max-width: 520px;
    margin: 1.5rem auto;
}

.cs-demo-trigger__img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a3a5c 0%, #0073aa 100%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

/* Bouton centré au-dessus de l'image */
.cs-demo-trigger__btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2.2rem;
    background: rgba(0, 115, 170, 0.92);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    transition: background 0.2s, box-shadow 0.2s;
}

.cs-demo-trigger:hover .cs-demo-trigger__btn,
.cs-demo-trigger__btn:hover {
    background: rgba(0, 90, 140, 0.97);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.cs-demo-trigger__btn:active {
    transform: translate(-50%, -50%) scale(0.97);
}

/* ── Popup 80 % × 80 % centré ── */
/* Injecté dans <body> par le JS → position:fixed toujours relatif au viewport */
.cs-demo-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
    align-items: center;
    justify-content: center;
}

.cs-demo-popup.is-open {
    display: flex;
}

.cs-demo-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    cursor: pointer;
}

/* Boîte 80 % × max 92 vh — s'adapte au contenu sans forcer le scroll */
.cs-demo-popup__content {
    position: relative;
    z-index: 1;
    width: min(80%, 1200px);
    max-height: 92vh;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Bandeau header supprimé — la croix est en absolute top-right */
.cs-demo-popup__header {
    display: none;
}

/* Croix fermeture — absolute top-right, flottante au-dessus du contenu */
.cs-demo-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(30, 30, 30, 0.82);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.18s, transform 0.1s;
}

.cs-demo-popup__close:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: scale(1.08);
}

.cs-demo-popup__close:active {
    transform: scale(0.95);
}

/* ── Sélecteur département / type de pêche (injecté par JS) ── */
.cs-demo-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #0c2d48 0%, #145374 100%);
    border-bottom: none;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cs-demo-selector__label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.cs-demo-selector__label svg {
    opacity: 0.7;
}

.cs-demo-select {
    flex: 1;
    min-width: 140px;
    padding: 0.5rem 2rem 0.5rem 0.65rem;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 12px;
}

.cs-demo-select option {
    background: #1a3a5c;
    color: #fff;
}

.cs-demo-select option:disabled {
    color: rgba(255, 255, 255, 0.4);
}

.cs-demo-select:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

.cs-demo-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.2);
}

.cs-demo-select:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Séparateur chevron entre les selects */
.cs-demo-selector__sep {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Bloquer le scroll du body quand le popup est ouvert */
body.cs-demo-popup-open {
    overflow: hidden;
}

/* Le portail remplit l'espace restant et défile en interne */
.cs-demo-popup .cartes-stripe-account {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

/* Cacher le bouton "Espèces disponibles" en mode démo (remplacé par le sélecteur) */
.cs-demo-mode .cs-open-cards-sheet {
    display: none !important;
}

/* ── Mode démo : carte plus compacte pour tenir dans la modale ── */
.cs-demo-mode .cartes-stripe-map-canvas {
    height: clamp(200px, 32vh, 380px);
}

/* Calendrier compact en mode démo */
.cs-demo-mode .cs-calendar-nav {
    height: clamp(110px, 16vh, 150px);
}
.cs-demo-mode .cs-calendar-card {
    padding: 10px;
    margin-top: 8px;
}

/* Plus d'espace sous le bouton "Infos Pêche & Marée" dans les day cards */
.cs-demo-popup .cs-day-btn {
    padding-bottom: 12px !important;
}

/* Renommer "Infos Pêche & Marée" → "Infos Pêche" en démo */
.cs-demo-popup .cs-day-marees-btn {
    font-size: 0;
    line-height: 0;
}
.cs-demo-popup .cs-day-marees-btn::after {
    content: 'Infos Pêche';
    font-size: 11px;
    line-height: 1.2;
}

/* Masquer le hint "Cliquez sur un jour…" en démo */
.cs-demo-popup .cs-calendar-hint {
    display: none !important;
}

/* Espace intérieur du portail pour décoller les cards des bords de la modale */
.cs-demo-popup .cartes-stripe-account {
    padding: 12px 16px;
}

/* ── Blur sur les bords de la carte — grand cercle net au centre ── */
.cs-demo-mode .cs-map-canvas-wrap {
    position: relative;
}
.cs-demo-mode .cs-map-canvas-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    -webkit-mask-image: radial-gradient(circle closest-side at 50% 50%, transparent 75%, black 95%);
    mask-image:         radial-gradient(circle closest-side at 50% 50%, transparent 75%, black 95%);
    pointer-events: none;
    z-index: 3;
}

/* ── Paywall overlay après timeout ── */
.cs-demo-paywall {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 20, 36, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    border-radius: 14px;
}

.cs-demo-paywall.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.cs-demo-paywall__card {
    max-width: 420px;
    width: 90%;
    text-align: center;
    padding: 2.2rem 2rem;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    animation: csPaywallSlideUp 0.5s ease forwards;
}

@keyframes csPaywallSlideUp {
    to { transform: translateY(0); }
}

.cs-demo-paywall__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #0c2d48, #145374);
    color: #fff;
}

.cs-demo-paywall__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0c2d48;
    margin: 0 0 0.6rem;
}

.cs-demo-paywall__text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #3a4a5c;
    margin: 0 0 1.5rem;
}

.cs-demo-paywall__text strong {
    color: #0c2d48;
}

.cs-demo-paywall__cta {
    display: inline-block;
    padding: 0.85rem 2.4rem;
    background: linear-gradient(135deg, #0073aa 0%, #005a8c 100%);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 115, 170, 0.4);
    transition: transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.01em;
}

.cs-demo-paywall__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 115, 170, 0.55);
}

.cs-demo-paywall__cta:active {
    transform: translateY(0) scale(0.98);
}

.cs-demo-paywall__retry {
    display: block;
    margin: 0.9rem auto 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 0.82rem;
    color: #6b7c8f;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.cs-demo-paywall__retry:hover {
    color: #0073aa;
}

/* ── Responsive mobile : popup quasi-plein écran ── */
@media (max-width: 700px) {
    .cs-demo-popup__content {
        width: 96%;
        max-height: 95vh;
        border-radius: 10px;
    }

    .cs-demo-trigger__btn {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }

    .cs-demo-selector {
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 0.75rem;
        gap: 0.4rem;
    }

    .cs-demo-selector__label {
        display: none;
    }

    .cs-demo-selector__sep {
        display: none;
    }

    .cs-demo-select {
        min-width: 0;
    }

    .cs-demo-mode .cs-active-card-header {
        flex-wrap: wrap;
    }
}
