body { 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
    font-family: sans-serif;
}

.form-section, .modal-option { 
    transition: all 0.3s ease-in-out; 
}

.selected-service, .selected-option, .selected-slot { 
    transform: scale(1.05); 
    box-shadow: 0 0 0 3px #3b82f6; 
}

.selected-slot { 
    background-color: #3b82f6 !important; 
    color: white !important; 
    border-color: #3b82f6 !important; 
}

.disabled-button { 
    background-color: #9ca3af; 
    cursor: not-allowed; 
    opacity: 0.6; 
}

.price-highlight { 
    animation: highlight 1s ease-out; 
}

@keyframes highlight { 
    0% { transform: scale(1); } 
    50% { transform: scale(1.1); color: #22c55e; } 
    100% { transform: scale(1); } 
}

.step-hidden { 
    opacity: 0; 
    transform: translateY(10px); 
    max-height: 0; 
    overflow: hidden; 
    margin: 0 !important; 
    padding: 0 !important; 
}

.step-visible { 
    opacity: 1; 
    transform: translateY(0); 
    max-height: 1000px; 
}

.pulse-button { 
    animation: pulse 2s infinite; 
}

@keyframes pulse { 
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); } 
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); } 
}

.flatpickr-input {
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.75rem;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.flatpickr-input.selected-slot {
     transform: scale(1.05); 
     box-shadow: 0 0 0 3px #3b82f6;
     background-color: #3b82f6 !important; 
     color: white !important; 
     border-color: #3b82f6 !important;
}

.upsell-item.selected-upsell {
    background-color: #e0f2fe;
    border-color: #3b82f6;
    transform: scale(1.02);
}

/* Basic z-index fixes for dropdowns */
.booking-wecleaned-wrapper .flatpickr-calendar {
    z-index: 1000 !important;
}

/* ===================================================================================
   FIX MODAL POSITIONING - Centrage correct du modal
   =================================================================================== */

/* Modal overlay - doit couvrir tout l'écran */
#options-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;
    
    /* Centrage du contenu */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Background overlay */
    background-color: rgba(0, 0, 0, 0.75) !important;
    
    /* Smooth transition */
    transition: opacity 0.3s ease-in-out !important;
}

/* Modal content container */
#options-modal .bg-white {
    position: relative !important;
    max-width: 600px !important; /* Taille fixe plus raisonnable sur PC */
    max-height: 90vh !important;
    margin: auto !important;
    
    /* Ensure it's centered */
    transform: none !important;
    
    /* Add some breathing room */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    
    /* Responsive width */
    width: 90% !important;
}

/* Hide modal when needed */
#options-modal.hidden {
    display: none !important;
}

/* Ensure modal content is scrollable if needed */
#options-modal .bg-white {
    overflow-y: auto !important;
}

/* Fix for mobile devices */
@media (max-width: 640px) {
    #options-modal .bg-white {
        max-width: 95vw !important;
        max-height: 95vh !important;
        margin: 10px !important;
        width: 95% !important;
    }
}

/* ===================================================================================
   FIX MODAL BUTTONS LAYOUT - Boutons à droite sur mobile
   =================================================================================== */

/* Container des boutons du modal */
#options-modal .flex.justify-between.items-center {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

/* Sur mobile, mettre les boutons à droite */
@media (max-width: 640px) {
    #options-modal .flex.justify-between.items-center {
        justify-content: flex-end !important;
        gap: 10px !important;
    }
    
    /* Le total à gauche, boutons à droite */
    #modal-total-price {
        flex: 1 !important;
        text-align: left !important;
    }
    
    /* Boutons groupés à droite */
    #modal-cancel-btn,
    #modal-confirm-btn {
        flex: none !important;
        min-width: 80px !important;
    }
}

/* ===================================================================================
   FIX CRITIQUE POUR LE DROPDOWN SELECT DÉPARTEMENT
   =================================================================================== */

/* Force le comportement natif du select et empêche les conflits CSS */
.booking-wecleaned-wrapper select,
.booking-wecleaned-wrapper #department {
    /* Reset complet des propriétés qui peuvent causer des problèmes */
    position: static !important;
    transform: none !important;
    will-change: auto !important;
    contain: none !important;
    isolation: auto !important;
    
    /* Force l'apparence native du select */
    appearance: auto !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    
    /* Z-index élevé pour le dropdown */
    z-index: 9999 !important;
    
    /* Assure que le select prend toute la largeur */
    width: 100% !important;
    display: block !important;
    
    /* Empêche les transformations CSS qui cassent le positionnement */
    backface-visibility: visible !important;
    perspective: none !important;
}

/* Quand le select est ouvert/focus */
.booking-wecleaned-wrapper select:focus,
.booking-wecleaned-wrapper #department:focus {
    position: static !important;
    z-index: 99999 !important;
    transform: none !important;
    /* Empêche les animations qui peuvent interférer */
    transition: none !important;
}

/* Force tous les conteneurs parents à ne pas clipper le dropdown */
.booking-wecleaned-wrapper,
.booking-wecleaned-wrapper *,
.booking-wecleaned-wrapper .container,
.booking-wecleaned-wrapper .bg-white,
.booking-wecleaned-wrapper .rounded-2xl,
.booking-wecleaned-wrapper .space-y-6,
.booking-wecleaned-wrapper .space-y-6 > div,
.booking-wecleaned-wrapper .grid,
.booking-wecleaned-wrapper .grid > div {
    /* Empêche le clipping du dropdown */
    overflow: visible !important;
    contain: none !important;
    
    /* Reset des transformations qui peuvent causer des problèmes */
    transform: none !important;
    will-change: auto !important;
    
    /* Assure un stacking context normal */
    isolation: auto !important;
    position: static !important;
}

/* Spécifiquement pour le conteneur du champ département */
.booking-wecleaned-wrapper #department,
.booking-wecleaned-wrapper select[name="department"] {
    /* Force le positionnement normal */
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    
    /* Empêche les transformations CSS */
    transform: none !important;
    translate: none !important;
    rotate: none !important;
    scale: none !important;
    
    /* Z-index très élevé */
    z-index: 999999 !important;
}

/* Override agressif pour les frameworks CSS qui peuvent interférer */
.booking-wecleaned-wrapper select:not([multiple]) {
    /* Force l'apparence native sur tous les navigateurs */
    background-image: none !important;
    background: white !important;
    
    /* Empêche les styles personnalisés qui cassent le dropdown */
    appearance: auto !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    
    /* Assure le bon positionnement */
    position: relative !important;
    display: block !important;
    
    /* Empêche les transformations */
    transform: none !important;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}

/* Fix spécial pour Tailwind CSS qui peut override les selects */
.booking-wecleaned-wrapper select {
    background-image: none !important;
    padding-right: 2.5rem !important;
}

/* Assure que le dropdown apparaît au bon endroit */
.booking-wecleaned-wrapper select option {
    position: static !important;
    transform: none !important;
}

/* ===================================================================================
   VALIDATION STYLES - États d'erreur et de succès
   =================================================================================== */

/* Champs avec erreur */
.border-red-500 {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.focus\:border-red-500:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

/* Champs valides */
.border-green-500 {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981 !important;
}

.focus\:border-green-500:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

/* Messages d'erreur */
.text-red-500 {
    color: #ef4444 !important;
}

/* Animation pour les messages d'erreur */
.error-message {
    animation: slideInError 0.3s ease-out;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================================================================
   AMÉLIORATION DES CHAMPS DE FORMULAIRE - Cadres raffinés
   =================================================================================== */

/* Styles de base pour tous les champs */
.booking-wecleaned-wrapper input,
.booking-wecleaned-wrapper textarea,
.booking-wecleaned-wrapper select {
    transition: all 0.2s ease-in-out;
    
    /* Cadre raffiné gris comme le département */
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    padding: 0.75rem !important;
    background-color: white !important;
    
    /* Ombre subtile */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    
    /* Typographie */
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    color: #374151 !important;
}

/* Styles spécifiques pour les champs texte */
.booking-wecleaned-wrapper input[type="text"],
.booking-wecleaned-wrapper input[type="email"],
.booking-wecleaned-wrapper input[type="tel"],
.booking-wecleaned-wrapper textarea {
    /* Assure une apparence cohérente */
    width: 100% !important;
    display: block !important;
}

/* Placeholder styling */
.booking-wecleaned-wrapper input::placeholder,
.booking-wecleaned-wrapper textarea::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* États de focus améliorés */
.booking-wecleaned-wrapper input:focus,
.booking-wecleaned-wrapper textarea:focus {
    /* Bordure bleue au focus */
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6, 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    outline: none !important;
    
    /* Animation subtile */
    transform: translateY(-1px);
}


/* Empêche l'animation transform sur les selects pour éviter les problèmes de dropdown */
.booking-wecleaned-wrapper select:focus {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Labels avec astérisque rouge */
.booking-wecleaned-wrapper label .text-red-500 {
    font-weight: bold;
    margin-left: 2px;
}

/* Amélioration du textarea d'adresse */
.booking-wecleaned-wrapper textarea {
    resize: vertical;
    min-height: 100px;
}

/* Amélioration du date picker */
.booking-wecleaned-wrapper #service_date {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Amélioration des états de validation en temps réel */
.booking-wecleaned-wrapper .field-valid {
    position: relative;
}

.booking-wecleaned-wrapper .field-valid::after {
    content: "✓";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
}

.booking-wecleaned-wrapper .field-error {
    position: relative;
}

.booking-wecleaned-wrapper .field-error::after {
    content: "✗";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #ef4444;
    font-weight: bold;
    font-size: 16px;
}

/* Responsive improvements */
@media (max-width: 640px) {
    .booking-wecleaned-wrapper .space-y-6 > div {
        margin-bottom: 1.5rem;
    }
    
    .booking-wecleaned-wrapper textarea {
        min-height: 80px;
    }
    
    .booking-wecleaned-wrapper input,
    .booking-wecleaned-wrapper textarea,
    .booking-wecleaned-wrapper select {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

/* Amélioration de l'accessibilité */
.booking-wecleaned-wrapper input:focus,
.booking-wecleaned-wrapper textarea:focus,
.booking-wecleaned-wrapper select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Auto-focus styling */
.booking-wecleaned-wrapper .auto-focus {
    animation: focusGlow 0.5s ease-out;
}

@keyframes focusGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* ===================================================================================
   MASQUER LE FOOTER SUR LA PAGE DE RÉSERVATION
   =================================================================================== */

/* Quand le formulaire de réservation est présent, masquer le footer */
body:has(.booking-wecleaned-wrapper) footer,
body:has(.booking-wecleaned-wrapper) .footer,
body:has(.booking-wecleaned-wrapper) #footer,
body:has(.booking-wecleaned-wrapper) .site-footer,
body:has(.booking-wecleaned-wrapper) .main-footer {
    display: none !important;
}

/* Fallback pour les navigateurs qui ne supportent pas :has() */
.booking-wecleaned-wrapper ~ footer,
.booking-wecleaned-wrapper ~ .footer,
.booking-wecleaned-wrapper ~ #footer,
.booking-wecleaned-wrapper ~ .site-footer,
.booking-wecleaned-wrapper ~ .main-footer {
    display: none !important;
}

/* Alternative avec une classe sur le body */
.booking-page footer,
.booking-page .footer,
.booking-page #footer,
.booking-page .site-footer,
.booking-page .main-footer {
    display: none !important;
}

/* Masquer aussi les éléments de footer communs dans WordPress */
.booking-wecleaned-wrapper ~ .wp-block-group__inner-container,
.booking-wecleaned-wrapper ~ .wp-site-blocks > footer {
    display: none !important;
}

/* Assurer que la page de réservation prend toute la hauteur */
body:has(.booking-wecleaned-wrapper) {
    min-height: 100vh !important;
}

.booking-wecleaned-wrapper {
    min-height: 100vh !important;
    padding-bottom: 2rem !important;
}

/* ===================================================================================
   LOADING OVERLAY STYLES - Animation de chargement professionnelle
   =================================================================================== */

#booking-loading-overlay {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#booking-loading-overlay[style*="opacity: 1"] {
    opacity: 1 !important;
}

/* Animation de rotation pour l'icône de chargement */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Animation d'apparition pour le modal de chargement */
#booking-loading-overlay .bg-white {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Effet de pulsation pour l'icône de chargement */
#booking-loading-overlay .bg-blue-100 {
    animation: pulse-loading 2s ease-in-out infinite;
}

@keyframes pulse-loading {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Assurer que l'overlay couvre bien tout l'écran */
#booking-loading-overlay .fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 99999 !important;
}

/* Responsive pour l'overlay de chargement */
@media (max-width: 640px) {
    #booking-loading-overlay .max-w-md {
        max-width: 90% !important;
        margin: 0 5% !important;
    }
}
