/* RGPD Google Maps - Styles inspirés iOS */

.rgpd-google-maps-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Fix for Safari border-radius clipping with transforms */
    isolation: isolate;
    border-radius: inherit;
}

/* Aperçu de carte stylisé (illustration CSS, AUCUN appel à Google Maps) */
.rgpd-map-preview {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #e9ebee url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20400%20300'%20preserveAspectRatio%3D'xMidYMid%20slice'%3E%3Crect%20width%3D'400'%20height%3D'300'%20fill%3D'%23e9ebee'%2F%3E%3Cpath%20d%3D'M0%20222%20C80%20202%20132%20236%20210%20226%20C290%20216%20342%20240%20400%20226%20L400%20300%20L0%20300%20Z'%20fill%3D'%23a9d3f0'%2F%3E%3Crect%20x%3D'246'%20y%3D'32'%20width%3D'122'%20height%3D'88'%20rx%3D'12'%20fill%3D'%23cfe8c6'%2F%3E%3Crect%20x%3D'28'%20y%3D'150'%20width%3D'88'%20height%3D'54'%20rx%3D'9'%20fill%3D'%23cfe8c6'%2F%3E%3Cg%20stroke%3D'%23ffffff'%20fill%3D'none'%20stroke-linecap%3D'round'%3E%3Cpath%20d%3D'M-20%2078%20L420%20104'%20stroke-width%3D'11'%2F%3E%3Cpath%20d%3D'M66%20-20%20L116%20320'%20stroke-width%3D'11'%2F%3E%3Cpath%20d%3D'M250%20-20%20L300%20320'%20stroke-width%3D'8'%2F%3E%3Cpath%20d%3D'M-20%20168%20L420%20150'%20stroke-width%3D'6'%2F%3E%3Cpath%20d%3D'M-20%2036%20L420%2026'%20stroke-width%3D'5'%2F%3E%3Cpath%20d%3D'M172%20-20%20L150%20320'%20stroke-width%3D'4'%2F%3E%3Cpath%20d%3D'M-20%20124%20L420%20132'%20stroke-width%3D'4'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / cover no-repeat;
}

/* Léger voile pour faire ressortir la carte de consentement */
.rgpd-map-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.34) 100%);
}

.rgpd-consent-container {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: 420px;
    margin: 32px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    /* Carte flottante façon iOS — surchargée par les réglages Elementor */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rgpd-consent-content {
    max-width: 500px;
    width: 100%;
    padding: 32px;
    box-sizing: border-box;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Icône */
.rgpd-consent-icon i,
.rgpd-consent-icon svg {
    width: 1em;
    height: 1em;
}

/* Image */
.rgpd-consent-image {
    display: block;
    margin: 0 auto 20px;
    max-width: 100%;
    height: auto;
}

.rgpd-consent-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Titre */
.rgpd-consent-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 19px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

/* Message */
.rgpd-consent-message {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #3C3C43;
    margin: 0 0 22px;
}

.rgpd-consent-message p {
    margin: 0 0 10px;
}

.rgpd-consent-message p:last-child {
    margin-bottom: 0;
}

/* Bouton style iOS */
.rgpd-consent-button {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    border: none;
    border-radius: 14px;
    padding: 13px 26px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.2px;
}

.rgpd-consent-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.rgpd-consent-button:hover::before {
    left: 100%;
}

.rgpd-consent-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.rgpd-consent-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

/* État de chargement */
.rgpd-consent-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.rgpd-consent-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Carte Google Maps */
.elementor-custom-embed {
    width: 100%;
    height: 100%;
    animation: fadeIn 0.5s ease-in-out;
    border-radius: inherit;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.elementor-custom-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    border-radius: inherit;
}

/* Responsive */
@media (max-width: 767px) {
    .rgpd-consent-container {
        margin: 16px;
    }

    .rgpd-consent-content {
        padding: 30px 20px;
    }

    .rgpd-consent-title {
        font-size: 20px;
    }

    .rgpd-consent-message {
        font-size: 14px;
    }

    .rgpd-consent-button {
        font-size: 15px;
        padding: 14px 24px;
        width: 100%;
        max-width: 280px;
    }

    .rgpd-consent-image {
        max-width: 200px;
    }
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
    .elementor-element.elementor-element-edit-mode .rgpd-consent-container {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .elementor-element.elementor-element-edit-mode .rgpd-consent-title {
        color: #F2F2F7;
    }

    .elementor-element.elementor-element-edit-mode .rgpd-consent-message {
        color: #C7C7CC;
    }
}

/* Animation d'apparition de la carte */
.rgpd-map-reveal {
    animation: mapReveal 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes mapReveal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Style pour l'édition Elementor */
.elementor-editor-active .rgpd-google-maps-container {
    min-height: 300px;
}

/* Amélioration de l'accessibilité */
.rgpd-consent-button:focus {
    outline: 3px solid rgba(0, 122, 255, 0.5);
    outline-offset: 2px;
}

.rgpd-consent-button:focus:not(:focus-visible) {
    outline: none;
}

/* Support pour les navigateurs qui ne supportent pas backdrop-filter :
   on opacifie la carte pour garder un texte lisible sans flou */
@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
    .rgpd-consent-container {
        background: rgba(255, 255, 255, 0.96);
    }
}

/* ===================================================================
   Mode simplifié — carte compacte (ex. blocs d'adresse en colonnes)
   La classe .rgpd-mode-simplified est posée sur le wrapper via
   prefix_class. Les contrôles dimensionnels étant masqués dans ce mode
   (condition Elementor), ce preset gouverne l'espacement sans conflit.
   =================================================================== */
.rgpd-mode-simplified .rgpd-consent-container {
    max-width: 300px;
    margin: 16px;
}

.rgpd-mode-simplified .rgpd-consent-content {
    padding: 20px 16px;
}

.rgpd-mode-simplified .rgpd-consent-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.rgpd-mode-simplified .rgpd-consent-image {
    max-width: 88px;
    margin-bottom: 8px;
}

.rgpd-mode-simplified .rgpd-consent-title {
    font-size: 16px;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.rgpd-mode-simplified .rgpd-consent-message {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 16px;
}

.rgpd-mode-simplified .rgpd-consent-button {
    font-size: 14px;
    padding: 12px 20px;
    border-radius: 12px;
}

/* Laisse la hauteur réglée (250px par défaut) gouverner dans l'éditeur */
.rgpd-mode-simplified .rgpd-google-maps-container {
    min-height: 0;
}

/* Accessibilité : respecter la préférence de mouvement réduit.
   !important pour neutraliser aussi les transitions inline éventuelles. */
@media (prefers-reduced-motion: reduce) {
    .rgpd-consent-container,
    .rgpd-consent-button,
    .rgpd-consent-button::before,
    .elementor-custom-embed,
    .rgpd-map-reveal {
        animation: none !important;
        transition: none !important;
    }
}