/* ============================================================
   QuickPage Booking — Styles front-end
   Variables CSS injectées dynamiquement via le shortcode :
   --qp-primary  --qp-text  --qp-bg  --qp-border  --qp-radius
   ============================================================ */

/* ----- Reset de base ----- */
.qp-booking-wrap *,
.qp-booking-wrap *::before,
.qp-booking-wrap *::after {
    box-sizing: border-box;
}

/* ----- Conteneur principal ----- */
.qp-booking-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--qp-text, #333);
    max-width: 640px;
    margin: 0 auto;
}

/* ----- Section ----- */
.qp-section {
    margin-bottom: 24px;
}

.qp-hint {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.qp-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--qp-text, #333);
}

/* ----- Bouton retour ----- */
.qp-back-btn {
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 12px;
    cursor: pointer;
    color: var(--qp-primary, #0073aa);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.qp-back-btn:hover {
    opacity: 0.75;
}

/* ============================================================
   CALENDRIER
   ============================================================ */

.qp-calendar {
    background: var(--qp-bg, #fff);
    border: 1px solid var(--qp-border, #e0e0e0);
    border-radius: var(--qp-radius, 8px);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* En-tête navigation */
.qp-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--qp-border, #e0e0e0);
}

.qp-month-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--qp-text, #333);
    letter-spacing: .01em;
}

.qp-nav-btn {
    background: none;
    border: 1px solid var(--qp-border, #e0e0e0);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--qp-primary, #0073aa);
    transition: background .15s, color .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qp-nav-btn:hover:not(:disabled) {
    background: var(--qp-primary, #0073aa);
    color: #fff;
    border-color: var(--qp-primary, #0073aa);
}
.qp-nav-btn:disabled {
    opacity: .3;
    cursor: default;
}

/* Grille 7 colonnes */
.qp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    padding: 12px;
}

/* Noms des jours */
.qp-day-name {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    padding: 4px 0 10px;
}

/* Cellule jour */
.qp-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--qp-radius, 8px) / 1.5);
    cursor: default;
    transition: background .15s, color .15s;
    margin: 2px;
    min-height: 38px;
}

.qp-day-num {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1;
}

/* Aujourd'hui */
.qp-day.qp-today .qp-day-num {
    color: var(--qp-primary, #0073aa);
    font-weight: 700;
}
.qp-day.qp-today::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--qp-primary, #0073aa);
    position: absolute;
    bottom: 5px;
}

/* Passés + indisponibles */
.qp-day.qp-past,
.qp-day.qp-unavailable,
.qp-day.qp-empty {
    opacity: .35;
}

/* Complet */
.qp-day.qp-fully-booked {
    opacity: .55;
}
.qp-full-label {
    font-size: 0.58rem;
    color: #999;
    margin-top: 2px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Disponible */
.qp-day.qp-available {
    cursor: pointer;
}
.qp-day.qp-available:hover {
    background: color-mix(in srgb, var(--qp-primary, #0073aa) 12%, transparent);
    color: var(--qp-primary, #0073aa);
}
.qp-day.qp-available:hover .qp-day-num {
    font-weight: 700;
}

/* Sélectionné */
.qp-day.qp-selected {
    background: var(--qp-primary, #0073aa);
    color: #fff !important;
}
.qp-day.qp-selected .qp-day-num {
    color: #fff;
    font-weight: 700;
}
.qp-day.qp-selected::after {
    background: #fff !important;
}


/* ============================================================
   CRÉNEAUX HORAIRES
   ============================================================ */

.qp-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.qp-slot {
    min-width: 90px;
    padding: 10px 16px;
    border: 2px solid var(--qp-primary, #0073aa);
    border-radius: var(--qp-radius, 8px);
    background: #fff;
    color: var(--qp-primary, #0073aa);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.qp-slot:hover:not(:disabled) {
    background: var(--qp-primary, #0073aa);
    color: #fff;
}
.qp-slot.qp-slot-selected {
    background: var(--qp-primary, #0073aa);
    color: #fff;
}
.qp-slot.qp-slot-booked,
.qp-slot:disabled {
    border-color: var(--qp-border, #e0e0e0);
    color: #bbb;
    cursor: not-allowed;
    background: #fafafa;
}
.qp-slot-full {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: .7;
}


/* ============================================================
   FORMULAIRE
   ============================================================ */

#qp-booking-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 480px) {
    .qp-form-row {
        grid-template-columns: 1fr;
    }
}

.qp-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.qp-field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--qp-text, #333);
}

.qp-req {
    color: #c00;
}

.qp-field input,
.qp-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--qp-border, #e0e0e0);
    border-radius: calc(var(--qp-radius, 8px) / 1.5);
    font-size: 0.95rem;
    color: var(--qp-text, #333);
    background: var(--qp-bg, #fff);
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.qp-field input:focus,
.qp-field textarea:focus {
    outline: none;
    border-color: var(--qp-primary, #0073aa);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--qp-primary, #0073aa) 18%, transparent);
}
.qp-field textarea {
    resize: vertical;
    min-height: 80px;
}


/* ============================================================
   BOUTONS
   ============================================================ */

.qp-btn-primary {
    align-self: flex-start;
    padding: 12px 24px;
    background: var(--qp-primary, #0073aa);
    color: #fff;
    border: none;
    border-radius: var(--qp-radius, 8px);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.qp-btn-primary:hover:not(:disabled) {
    opacity: .88;
}
.qp-btn-primary:active {
    transform: translateY(1px);
}
.qp-btn-primary:disabled {
    opacity: .55;
    cursor: default;
}

.qp-btn-secondary {
    margin-top: 12px;
    padding: 10px 20px;
    background: none;
    color: var(--qp-primary, #0073aa);
    border: 2px solid var(--qp-primary, #0073aa);
    border-radius: var(--qp-radius, 8px);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.qp-btn-secondary:hover {
    background: var(--qp-primary, #0073aa);
    color: #fff;
}


/* ============================================================
   NOTICES
   ============================================================ */

.qp-notice {
    padding: 12px 16px;
    border-radius: var(--qp-radius, 8px);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 8px;
}
.qp-notice-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}
.qp-notice-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}
