.codec-atelier-calendar {
    max-width: 420px;
    margin: 1.5em 0;
}

.codec-atelier-calendar__grid {
    position: relative;
    max-height: 70vh;
    overflow-y: auto;
}

.codec-atelier-calendar__empty-message {
    padding: 1em;
    background: #f7f7f7;
    border-radius: 6px;
}

.codec-atelier-calendar__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.codec-atelier-calendar__table th,
.codec-atelier-calendar__table td {
    vertical-align: top;
    padding: 6px;
}

.codec-atelier-calendar__table thead th {
    text-align: center;
    background: #fe504f;
    color: #fff;
    font-weight: bold;
    padding: 0.5em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.codec-atelier-calendar__week {
    border-bottom: 1px solid #f2f2f2;
}

.codec-atelier-calendar__day {
    width: 50%;
}

.codec-atelier-calendar__day-date {
    display: block;
    font-weight: bold;
    text-align: center;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    margin-bottom: 0.5em;
}

.codec-atelier-calendar__sessions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.codec-atelier-session-pill {
    border: none;
    border-radius: 0;
    padding: 6px 8px;
    font-size: 0.8em;
    text-align: center;
    cursor: pointer;
    color: #222;
    line-height: 1.3;
    width: 100%;
}

/* La couleur de fond est en style inline (couleur du type) : on l'assombrit par filtre */
.codec-atelier-session-pill:not(:disabled):hover {
    filter: brightness(0.9);
}

.codec-atelier-session-pill--full {
    cursor: not-allowed;
}

/*
 * Sélection visible uniquement sur la fiche produit (mode "select") : la date choisie
 * y reste affichée à côté du formulaire d'ajout au panier. En mode réservation
 * groupée, l'overlay s'ouvre directement, un contour serait superflu.
 */
.codec-atelier-calendar[data-mode="select"] .codec-atelier-session-pill--selected {
    outline: 2px solid #222;
}

.codec-atelier-session-pill__name {
    font-weight: bold;
}

.codec-atelier-session-pill__name,
.codec-atelier-session-pill__time,
.codec-atelier-session-pill__seats {
    display: block;
}

.codec-atelier-session-pill__seats {
    font-size: 0.9em;
}

.codec-atelier-selected-label {
    margin-top: 1.5em;
    padding: 1em;
    background: #f7f7f7;
    border-radius: 6px;
}

/*
 * Réservation multi-places (Flux A) affichée en overlay plutôt qu'en ligne dans la
 * page : sur mobile la boîte de saisie prend tout l'écran (voir media query
 * ci-dessous), ce qui évite de perdre le client dans une longue page qui défile.
 */
body.codec-atelier-modal-open {
    overflow: hidden;
}

.codec-atelier-booking-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 1.5em;
}

.codec-atelier-booking {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5em;
    background: #fff;
    border-radius: 8px;
}

.codec-atelier-booking__intro h3 {
    color: #fe504f;
    margin-top: 0;
}

.codec-atelier-booking__close {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    width: 2em;
    height: 2em;
    line-height: 1;
    border: none;
    background: transparent;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.codec-atelier-booking__close:hover {
    color: #fe504f;
}

@media (max-width: 600px) {
    .codec-atelier-booking-overlay {
        padding: 0;
    }

    .codec-atelier-booking {
        max-width: none;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

.codec-atelier-booking__session-name,
.codec-atelier-booking__session-when,
.codec-atelier-booking__session-location,
.codec-atelier-booking__session-remaining {
    display: block;
}

.codec-atelier-booking__gift-link {
    text-align: center;
    margin: 0.5em 0 1.25em;
}

.codec-atelier-booking__gift-link a {
    color: #fe504f;
}

.codec-atelier-booking__seat-count {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1em;
    flex-wrap: wrap;
    margin-bottom: 1.25em;
}

.codec-atelier-booking__seat-count input {
    width: 4em;
    margin-left: 0.5em;
}

.codec-atelier-booking__contact {
    padding: 1em;
    background: #fff5f5;
    border: 1px solid #ffd6d5;
    border-radius: 6px;
    margin-top: 1em;
}

.codec-atelier-booking__contact p:last-child {
    margin-bottom: 0;
}

.codec-atelier-booking__seats {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin: 1em 0;
}

.codec-atelier-seat {
    border: 1px solid #ffd6d5;
    border-radius: 6px;
    padding: 0.6em 1em;
    background: #fff;
}

.codec-atelier-seat__label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.4em;
}

.codec-atelier-seat__toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em 1.25em;
}

.codec-atelier-seat__option {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.codec-atelier-seat__option input[type="radio"] {
    float: none;
    margin: 0 0.5em 0 0;
    transform: none;
}

.codec-atelier-seat__detail {
    margin-top: 0.5em;
}

.codec-atelier-seat__code-field input {
    width: 100%;
    box-sizing: border-box;
}

.codec-atelier-seat__code-field input::placeholder {
    color: #999;
}

.codec-atelier-seat__buy-note {
    color: #666;
    font-style: italic;
}

.codec-atelier-seat__product-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25em 0.75em;
    margin-bottom: 0.4em;
}

.codec-atelier-seat__product-field select {
    flex: 1 1 12em;
    max-width: 100%;
}

.codec-atelier-booking__contact-summary {
    margin-top: 0;
}

.codec-atelier-booking__contact-edit {
    display: inline-block;
    margin-left: 0.5em;
    font-size: 0.85em;
    color: #fe504f;
    text-decoration: underline;
}

.codec-atelier-booking__contact-edit:hover,
.codec-atelier-booking__contact-edit:focus {
    color: #e0201f;
}

.codec-atelier-seat__error {
    color: #b32d2e;
    margin-bottom: 0;
}

.codec-atelier-booking__message--success {
    color: #1a7a1a;
}

.codec-atelier-booking__message--error {
    color: #b32d2e;
}

.codec-atelier-booking__success-title {
    color: #1a7a1a;
}

.codec-atelier-booking__success-body a {
    text-decoration: underline;
}

/*
 * Boutons de la boîte de réservation : on force le style rose de la marque avec
 * !important, car .woocommerce button.button (thème) est plus spécifique que
 * .codec-atelier-booking .button et gagnerait sinon (fond gris) quand l'overlay
 * s'affiche dans le wrapper .woocommerce (ex. page catégorie).
 */
.codec-atelier-booking .button,
.codec-atelier-booking__success-close {
    display: inline-block;
    border: none;
    border-radius: 3px;
    padding: 0.618em 1.4em;
    font-weight: 700;
    color: #fff !important;
    background-color: rgb(254, 80, 79) !important;
    cursor: pointer;
    transition: background-color 0.2s;
}

.codec-atelier-booking .button:hover,
.codec-atelier-booking .button:focus,
.codec-atelier-booking__success-close:hover,
.codec-atelier-booking__success-close:focus {
    background-color: #e0201f !important;
}

.codec-atelier-booking .button:disabled {
    background-color: #f7a3a2 !important;
    cursor: not-allowed;
}

.codec-atelier-booking__contact input:focus,
.codec-atelier-seat input[type="text"]:focus,
.codec-atelier-seat select:focus {
    outline: none;
    border-color: #fe504f;
    box-shadow: 0 0 0 2px rgba(254, 80, 79, 0.2);
}
