/* ==========================================================================
   WooCommerce Salles Booking - Styles Frontend
   ========================================================================== */

/* Container principal */
.wcsb-booking-container {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

/* Formulaire de réservation */
#wcsb-booking-form {
    max-width: 100%;
}

.wcsb-form-group {
    margin-bottom: 20px;
}

.wcsb-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.wcsb-form-group input[type="date"],
.wcsb-form-group input[type="time"],
.wcsb-form-group select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Types de réservation */
.wcsb-booking-types {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wcsb-type-option {
    flex: 1;
    min-width: 120px;
}

.wcsb-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.wcsb-type-option label {
    display: block;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.wcsb-type-option input[type="radio"]:checked + label {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

.wcsb-type-option label:hover {
    border-color: #0073aa;
}

/* Créneaux horaires */
.wcsb-slots-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.wcsb-slot-item {
    display: block;
    position: relative;
}

.wcsb-slot-item input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.wcsb-slot-item .wcsb-slot-label {
    display: block;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    font-size: 14px;
}

.wcsb-slot-item input[type="radio"]:checked + .wcsb-slot-label {
    border-color: #0073aa;
    background: #e6f2ff;
    color: #0073aa;
    font-weight: 600;
}

.wcsb-slot-item .wcsb-slot-label:hover {
    border-color: #0073aa;
    background: #f0f7ff;
}

/* Messages */
.wcsb-no-slots,
.wcsb-error {
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.wcsb-no-slots {
    background: #fff8e1;
    border: 1px solid #ffd54f;
    color: #856404;
}

.wcsb-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Réservation récurrente */
.wcsb-recurring-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wcsb-recurring-options {
    margin-top: 15px;
    display: none;
}

.wcsb-recurring-options.active {
    display: block;
}

.wcsb-recurring-preview {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.wcsb-recurring-dates {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.wcsb-recurring-dates li {
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
}

.wcsb-recurring-dates li:last-child {
    border-bottom: none;
}

/* Résumé et prix */
.wcsb-summary {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 6px;
}

.wcsb-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.wcsb-summary-row:last-child {
    border-bottom: none;
    font-size: 18px;
    font-weight: 700;
    color: #0073aa;
}

.wcsb-summary-label {
    font-weight: 600;
}

.wcsb-summary-value {
    color: #333;
}

/* Bouton d'ajout au panier */
#wcsb-add-to-cart {
    width: 100%;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 20px;
}

#wcsb-add-to-cart:hover {
    background: #005a87;
}

#wcsb-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Informations produit */
.wcsb-product-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f7ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.wcsb-product-info h3 {
    margin-top: 0;
    color: #0073aa;
}

.wcsb-product-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

/* Loading state */
.wcsb-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.wcsb-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: wcsb-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes wcsb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wcsb-booking-types {
        flex-direction: column;
    }

    .wcsb-type-option {
        width: 100%;
        min-width: 100%;
    }

    .wcsb-slots-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .wcsb-summary-row {
        flex-direction: column;
        gap: 5px;
    }
}

/* Checkbox et radio personnalisés */
input[type="checkbox"].wcsb-checkbox,
input[type="radio"].wcsb-radio {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

/* Badge de disponibilité */
.wcsb-availability-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.wcsb-availability-badge.available {
    background: #d4edda;
    color: #155724;
}

.wcsb-availability-badge.unavailable {
    background: #f8d7da;
    color: #721c24;
}

/* Calendrier (si intégration future) */
.wcsb-calendar {
    max-width: 500px;
    margin: 20px auto;
}

/* Animation d'apparition */
@keyframes wcsb-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcsb-fade-in {
    animation: wcsb-fade-in 0.3s ease;
}

/* Masquer sélecteur de quantité dans le panier pour produits avec réservation */
.woocommerce-cart-form__cart-item.wcsb-booking-item .product-quantity input,
.woocommerce-cart-form__cart-item.wcsb-booking-item .product-quantity .quantity {
    display: none !important;
}

.woocommerce-cart-form__cart-item.wcsb-booking-item .product-quantity::before {
    content: "×1";
    font-weight: bold;
}
