/**
 * Biores Booking - Frontend Styles
 * Compatible avec tous les thèmes
 */

.biores-booking-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit !important;
}

.biores-booking-container * {
    font-family: inherit !important;
}

/* Titres des étapes - FORCÉMENT VISIBLES */
.biores-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #333 !important;
    display: block;
}

/* Grille des services */
.biores-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.biores-service-card {
    background: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    min-height: 200px;
}

.biores-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(74, 124, 155, 0.25);
}

.biores-service-card.selected {
    background: linear-gradient(135deg, #f8fbfd 0%, #eef5f9 100%);
    box-shadow: 0 15px 35px rgba(74, 124, 155, 0.3);
    border: 2px solid #4a7c9b;
}

/* Image du service (droite) */
.biores-service-image {
    width: 40%;
    min-width: 180px;
    max-width: 280px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    order: 2; /* Image à droite */
}

.biores-service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.biores-service-card:hover .biores-service-image img {
    transform: scale(1.05);
}

/* Contenu de la carte (gauche) */
.biores-service-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    order: 1; /* Contenu à gauche */
}

/* Responsive : image en haut sur mobile */
@media (max-width: 600px) {
    .biores-booking-container {
        padding: 10px !important;
    }
    
    .biores-step-title {
        font-size: 1.25rem !important;
        margin-bottom: 15px !important;
    }
    
    .biores-services-grid {
        gap: 15px !important;
    }
    
    .biores-service-card {
        flex-direction: column !important;
        border-radius: 16px !important;
        min-height: auto !important;
    }
    
    .biores-service-image {
        width: 100% !important;
        height: 240px !important;
        min-width: auto !important;
        max-width: none !important;
        order: -1 !important;
        border-radius: 16px 16px 0 0 !important;
        position: relative !important;
    }
    
    .biores-service-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center 20% !important;
        border-radius: 16px 16px 0 0 !important;
        display: block !important;
    }
    
    .biores-service-content {
        order: 2 !important;
        padding: 20px !important;
    }
    
    .biores-service-title {
        font-size: 1.25rem !important;
        margin-bottom: 10px !important;
    }
    
    .biores-service-desc {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 15px !important;
    }
    
    .biores-service-meta {
        margin-top: 15px !important;
        padding-top: 15px !important;
    }
    
    .biores-service-price {
        font-size: 1.6rem !important;
    }
    
    .biores-service-duration {
        font-size: 0.85rem !important;
        padding: 6px 12px !important;
    }
}

.biores-service-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 15px 0;
    color: #2c3e50 !important;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Badges de type de service */
.biores-service-types {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.biores-service-type-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.biores-service-type-badge.presentiel {
    background: #e8f5e9;
    color: #2e7d32;
}

.biores-service-type-badge.visio {
    background: #e3f2fd;
    color: #1976d2;
}

.biores-service-type-badge.telephone {
    background: #fff3e0;
    color: #f57c00;
}

.biores-service-desc {
    font-size: 1rem;
    color: #5a6c7d !important;
    margin: 0 0 20px 0;
    line-height: 1.7;
}

.biores-service-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f4f8;
}

.biores-service-price {
    font-size: 2rem;
    font-weight: 800;
    color: #4a7c9b !important;
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.biores-service-duration {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a7c9b !important;
    background: linear-gradient(135deg, #e8f0f5 0%, #d4e4ed 100%);
    padding: 8px 16px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.biores-service-duration::before {
    content: '⏱';
    font-size: 14px;
}

/* Calendrier personnalisé */
.biores-calendar-wrapper {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#biores-calendar {
    min-height: auto;
}

/* Calendrier custom - deux mois */
.biores-calendar-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .biores-calendar-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.biores-calendar {
    font-family: inherit;
}

.biores-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.biores-cal-nav {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.biores-cal-nav:hover {
    background: #0056b3;
}

.biores-cal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    text-transform: capitalize;
}

.biores-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.biores-cal-weekday {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 5px 2px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.biores-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
    background: #f8f9fa;
    border: 1px solid transparent;
    min-height: 32px;
}

.biores-cal-day:hover:not(.empty):not(.past):not(.disabled) {
    background: #e3f2fd;
    border-color: #007bff;
}

.biores-cal-day.today {
    background: #fff3cd;
    font-weight: 700;
}

.biores-cal-day.selected {
    background: #007bff !important;
    color: white !important;
    border-color: #0056b3;
}

.biores-cal-day.past,
.biores-cal-day.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f5f5f5;
}

.biores-cal-day.empty {
    background: transparent;
    cursor: default;
}

/* Jours avec créneaux disponibles */
.biores-cal-day.has-slots,
.biores-cal-day.available {
    background: #d4edda;
    border-color: #28a745;
    font-weight: 600;
}

.biores-cal-day.has-slots:hover,
.biores-cal-day.available:hover {
    background: #c3e6cb;
    border-color: #218838;
}

/* Jours sans créneaux configurés */
.biores-cal-day.no-slots,
.biores-cal-day.unavailable {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
    text-decoration: line-through;
}

.biores-cal-day.no-slots:hover,
.biores-cal-day.unavailable:hover {
    background: #f8f9fa;
    border-color: transparent;
}

/* Jours d'indisponibilite (ferme) */
.biores-cal-day.blackout {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    cursor: not-allowed;
    text-decoration: line-through;
}

.biores-cal-day.blackout:hover {
    background: #f8d7da;
    border-color: #f5c6cb;
}

/* Jours avec des réservations existantes - Orange/Jaune */
/* S'applique dès qu'il y a une réservation ce jour-là, peu importe le service */
.biores-cal-day.has-bookings {
    background: #ff9800 !important; /* Orange vif */
    border-color: #e65100 !important;
    color: white !important;
    font-weight: 600;
}

.biores-cal-day.has-bookings:hover {
    background: #f57c00 !important; /* Orange plus foncé au hover */
    border-color: #bf360c !important;
}

/* Légende pour les jours avec réservations */
.biores-calendar-legend {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
}

.biores-legend-item {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    margin-bottom: 5px;
}

.biores-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 6px;
    border: 1px solid;
}

.biores-legend-color.has-bookings {
    background: #ff9800;
    border-color: #e65100;
}

/* Liste des créneaux horizontale */
.biores-slots-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.biores-slot-btn {
    background: linear-gradient(135deg, #5593c6 0%, #4682b8 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 100px;
    text-align: center;
}

.biores-slot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #4682b8 0%, #5593c6 100%);
}

.biores-slot-btn.selected {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.biores-slot-btn:disabled,
.biores-slot-btn.unavailable {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.biores-slot-btn.checking {
    opacity: 0.7;
    cursor: wait;
}

/* Message quand aucun créneau */
.biores-no-slots {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.biores-loading {
    color: #666;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Récapitulatif */
.biores-selection-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.biores-selection-summary p {
    margin: 8px 0;
    color: #333;
}

.biores-selection-summary strong {
    color: #555;
}

/* Toggle Présentiel / Visio */
.biores-type-toggle {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.biores-type-option {
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.biores-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.biores-type-label {
    display: block;
    padding: 20px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    transition: all 0.2s;
    text-align: center;
}

.biores-type-option input[type="radio"]:checked + .biores-type-label {
    border-color: #007bff;
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.biores-type-price {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #28a745;
    margin-top: 8px;
}

/* Formulaire */
.biores-add-to-cart-form {
    margin-bottom: 15px;
}

#biores-add-to-cart-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 700;
    background: #28a745;
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

#biores-add-to-cart-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Bouton retour */
.biores-back-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 10px;
    text-decoration: underline;
}

.biores-back-btn:hover {
    color: #333;
}

.biores-step-navigation {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.biores-calendar-navigation {
    margin-top: 20px;
    text-align: center;
}

/* Messages */
.biores-loading,
.biores-no-slots,
.biores-error {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.biores-loading {
    color: #666;
    background: #f5f5f5;
}

.biores-no-slots {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.biores-error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .biores-services-grid {
        grid-template-columns: 1fr;
    }
    
    .biores-type-toggle {
        flex-direction: column;
    }
}

/* Assurer visibilité sur tous les fonds */
.biores-step {
    position: relative;
}

.biores-step > * {
    position: relative;
    z-index: 1;
}

/* Masquer la description longue dans le panier WooCommerce */
.woocommerce-cart-form .product-description,
.woocommerce-cart-form .product-excerpt,
.woocommerce-cart-form td.product-name .variation-description,
.woocommerce-cart-form .product-details .description,
.cart_item .product-description {
    display: none !important;
}

/* Optionnel : cacher aussi dans le checkout */
.woocommerce-checkout-review-order-table .product-description,
.woocommerce-checkout-review-order-table .product-excerpt {
    display: none !important;
}

/* ============================================
   STYLES - MES Rendez-vous (Mon Compte)
   ============================================ */

.biores-my-bookings-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
}

.biores-my-bookings-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
}

/* ============================================
   MY ACCOUNT - MES RÉSERVATIONS
   ============================================ */

.biores-myaccount-bookings {
    max-width: 1200px;
    margin: 0 auto;
}

.biores-myaccount-bookings h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 35px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #5593c6;
}

.biores-myaccount-bookings h3:first-of-type {
    margin-top: 10px;
}

.biores-no-bookings {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #666;
    font-size: 1.1rem;
}

/* Liste des réservations */
.biores-bookings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.biores-booking-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.biores-booking-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.biores-booking-info {
    flex: 1;
    min-width: 0;
}

.biores-booking-service {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #222;
}

.biores-booking-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #555;
    line-height: 1.4;
}

.biores-meta-item {
    white-space: nowrap;
}

.biores-meta-sep {
    color: #ccc;
    font-size: 0.75rem;
}

.biores-meta-order {
    color: #888;
}

/* Lien Jitsi visioconférence */
.biores-booking-jitsi a {
    color: #5593c6;
    text-decoration: none;
    font-weight: 500;
}

.biores-booking-jitsi a:hover {
    text-decoration: underline;
}

/* Actions */
.biores-booking-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.biores-btn-reschedule {
    background: #5593c6 !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 5px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.biores-btn-reschedule:hover {
    background: #4682b8 !important;
    box-shadow: 0 2px 6px rgba(85, 147, 198, 0.3) !important;
}

.biores-btn-cancel {
    background: transparent !important;
    color: #c08080 !important;
    border: 1px solid #dbb !important;
    padding: 7px 16px !important;
    border-radius: 5px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.biores-btn-cancel:hover {
    background: #fdf0f0 !important;
    border-color: #c08080 !important;
    color: #a06060 !important;
}

.biores-btn-cancel.no-refund {
    color: #b08060 !important;
    border-color: #dcb !important;
}

.biores-btn-cancel.no-refund:hover {
    background: #fdf5f0 !important;
    border-color: #b08060 !important;
}

.biores-cancel-expired,
.biores-past-booking {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    padding: 10px 0;
}

/* ============================================
   MODALS
   ============================================ */

.biores-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.biores-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.biores-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.biores-modal-close:hover {
    color: #333;
}

.biores-modal-content h3 {
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    padding-right: 30px;
}

.biores-modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* ============================================
   CALENDRIER REPROGRAMMATION
   ============================================ */

.biores-reschedule-calendar-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.biores-reschedule-calendar {
    font-family: inherit;
}

.biores-reschedule-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.biores-reschedule-cal-nav {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.biores-reschedule-cal-nav:hover {
    background: #0056b3;
}

.biores-reschedule-cal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.biores-reschedule-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.biores-reschedule-cal-weekday {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 8px 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.biores-reschedule-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    min-height: 38px;
    transition: all 0.2s;
}

.biores-reschedule-cal-day:hover:not(.empty):not(.past):not(.disabled) {
    background: #e3f2fd;
    border-color: #007bff;
}

.biores-reschedule-cal-day.today {
    background: #fff3cd;
    font-weight: 700;
}

.biores-reschedule-cal-day.selected {
    background: #007bff !important;
    color: white !important;
    border-color: #0056b3;
}

.biores-reschedule-cal-day.past,
.biores-reschedule-cal-day.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f5f5f5;
}

.biores-reschedule-cal-day.empty {
    background: transparent;
    cursor: default;
}

/* Slots reprogrammation */
#biores-reschedule-slots {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#biores-reschedule-slots h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

#biores-reschedule-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.biores-reschedule-slot-btn {
    background: #28a745;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.biores-reschedule-slot-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.biores-reschedule-slot-btn.selected {
    background: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.3);
}

/* Weekend - jours de fermeture */
.biores-cal-day.weekend {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.biores-cal-day.weekend:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .biores-booking-card {
        flex-direction: column;
    }
    
    .biores-booking-actions {
        width: 100%;
    }
    
    .biores-btn-reschedule,
    .biores-btn-cancel {
        width: 100%;
        text-align: center;
    }
}
