/*
 * Yoga Booking - Styles front-end.
 *
 * Stratégie d'intégration au thème actif :
 * 1) On n'impose AUCUNE police (font-family: inherit partout) : le module hérite
 *    donc automatiquement de la typographie du thème actif.
 * 2) La couleur principale utilise une chaîne de repli CSS qui va chercher, dans l'ordre :
 *    - la couleur définie dans les réglages du plugin (variable --yb-primary injectée en inline) ;
 *    - sinon la variable standard des thèmes de blocs WordPress (FSE) ;
 *    - sinon la variable globale Elementor (si le thème est construit avec Elementor) ;
 *    - sinon une couleur de repli neutre.
 * 3) Les composants (boutons, cartes) reprennent les rayons de bordure et ombres
 *    "raisonnables" les plus communs, mais restent volontairement sobres pour ne
 *    pas entrer en conflit visuel avec le thème.
 *
 * Pour un rendu identique au pixel près, définissez la couleur principale dans
 * Réglages > Yoga Booking, ou surcouchez ces classes dans le CSS additionnel de votre thème.
 */

.yb-booking {
	--yb-color: var(--yb-primary, var(--wp--preset--color--primary, var(--e-global-color-primary, #5b7c5a)));
	font-family: inherit;
	color: inherit;
	line-height: inherit;
	max-width: 100%;
}

.yb-booking * {
	box-sizing: border-box;
	font-family: inherit;
}

.yb-booking .yb-sessions-list {
	display: grid;
	gap: 14px;
	margin: 1em 0;
}

.yb-booking .yb-session-card {
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	padding: 16px 18px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	background: rgba(0, 0, 0, 0.015);
}

.yb-booking .yb-session-info h3 {
	margin: 0 0 4px;
	font-size: 1.05em;
	color: inherit;
}

.yb-booking .yb-session-meta {
	font-size: 0.9em;
	opacity: 0.75;
}

.yb-booking .yb-badge-places {
	font-size: 0.85em;
	opacity: 0.7;
}

.yb-booking .yb-btn {
	background: var(--yb-color);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 10px 18px;
	font-size: 0.95em;
	cursor: pointer;
	transition: opacity .15s ease;
}

.yb-booking .yb-btn:hover { opacity: 0.88; }
.yb-booking .yb-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.yb-booking .yb-btn-secondary {
	background: transparent;
	color: var(--yb-color);
	border: 1px solid var(--yb-color);
}

/* Modale de réservation */
.yb-modal-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,0.45);
	display: flex; align-items: center; justify-content: center;
	z-index: 100000; padding: 16px;
}
.yb-modal { background: #fff; color: #1e1e1e; border-radius: 10px; max-width: 480px; width: 100%; padding: 24px; max-height: 90vh; overflow-y: auto; }
.yb-modal h3 { margin-top: 0; }
.yb-modal label { display: block; margin: 10px 0 4px; font-size: 0.9em; }
.yb-modal input[type=text], .yb-modal input[type=email], .yb-modal input[type=tel] {
	width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.95em;
}
.yb-modal .yb-cards-options label { display: flex; align-items: center; gap: 8px; font-size: 0.95em; }
.yb-modal .yb-modal-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }
.yb-modal .yb-privacy-note { margin: 14px 0 0; font-size: 0.78em; line-height: 1.5; opacity: 0.72; }
.yb-modal .yb-privacy-note a { color: inherit; text-decoration: underline; }
.yb-modal .yb-close { float: right; background: none; border: none; font-size: 1.3em; cursor: pointer; line-height: 1; }
.yb-modal .yb-message { margin-top: 10px; font-size: 0.9em; }
.yb-modal .yb-message.error { color: #b32d2e; }
.yb-modal .yb-message.success { color: #237a24; }

/* =========================================================
 * Calendrier (vue mois / semaine)
 * ========================================================= */
.yb-booking { position: relative; }

.yb-booking .yb-toolbar {
	display: flex; flex-wrap: wrap; gap: 12px;
	align-items: center; justify-content: space-between;
	margin-bottom: 14px;
}
.yb-booking .yb-nav { display: flex; align-items: center; gap: 8px; }
.yb-booking .yb-period-label { font-weight: 600; min-width: 170px; text-align: center; }
.yb-booking .yb-nav .yb-btn { padding: 6px 12px; }

.yb-booking .yb-view-switch { display: flex; }
.yb-booking .yb-view-btn {
	background: transparent; color: inherit;
	border: 1px solid rgba(0,0,0,0.2); border-radius: 0; padding: 7px 16px;
}
.yb-booking .yb-view-btn:first-child { border-radius: 6px 0 0 6px; }
.yb-booking .yb-view-btn:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.yb-booking .yb-view-btn.is-active { background: var(--yb-color); color: #fff; border-color: var(--yb-color); }

.yb-booking .yb-course-filter {
	padding: 7px 10px; border: 1px solid rgba(0,0,0,0.2); border-radius: 6px;
	background: transparent; color: inherit; font-family: inherit;
}

.yb-booking .yb-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; font-size: 0.85em; opacity: 0.85; }
.yb-booking .yb-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.yb-booking .yb-legend-item i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.yb-booking .yb-grid { border: 1px solid rgba(0,0,0,0.12); border-radius: 8px; overflow: hidden; }
.yb-booking .yb-grid-head { display: grid; grid-template-columns: repeat(7, 1fr); background: rgba(0,0,0,0.04); }
.yb-booking .yb-grid-head-cell { padding: 8px 4px; text-align: center; font-size: 0.82em; font-weight: 600; }
.yb-booking .yb-grid-body { display: grid; grid-template-columns: repeat(7, 1fr); }

.yb-booking .yb-day {
	min-height: 104px; padding: 6px; border-top: 1px solid rgba(0,0,0,0.08);
	border-right: 1px solid rgba(0,0,0,0.08); display: flex; flex-direction: column; gap: 4px;
}
.yb-booking .yb-day:nth-child(7n) { border-right: none; }
.yb-booking .yb-day.is-outside { opacity: 0.38; }
.yb-booking .yb-day.is-today { background: rgba(0,0,0,0.035); }
.yb-booking .yb-day-num { font-size: 0.8em; opacity: 0.7; }
.yb-booking .yb-day-week { min-height: 170px; }
.yb-booking .yb-day-empty { opacity: 0.3; font-size: 0.85em; text-align: center; margin-top: 8px; }

.yb-booking .yb-event {
	--yb-event-color: var(--yb-color);
	display: flex; flex-direction: column; gap: 1px;
	width: 100%; text-align: left; cursor: pointer;
	border: none; border-left: 3px solid var(--yb-event-color);
	background: color-mix(in srgb, var(--yb-event-color) 14%, transparent);
	color: inherit; font-family: inherit; font-size: 0.78em;
	padding: 4px 6px; border-radius: 3px; line-height: 1.3;
	transition: background .15s ease;
}
/* Repli pour les navigateurs sans color-mix. */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
	.yb-booking .yb-event { background: rgba(0,0,0,0.05); }
}
.yb-booking .yb-event:hover { background: var(--yb-event-color); color: #fff; }
.yb-booking .yb-event .yb-event-name { font-weight: 600; }
.yb-booking .yb-event .yb-event-places { opacity: 0.8; font-size: 0.92em; }
.yb-booking .yb-event.is-full, .yb-booking .yb-event.is-past { opacity: 0.45; cursor: default; }
.yb-booking .yb-event.is-full:hover, .yb-booking .yb-event.is-past:hover { background: rgba(0,0,0,0.05); color: inherit; }

/* Infobulle de détail au survol */
.yb-booking .yb-tooltip {
	position: absolute; z-index: 50; width: 280px; max-width: 90vw;
	background: #fff; color: #1e1e1e; border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0,0,0,0.18); padding: 14px; pointer-events: none;
	font-size: 0.85em;
}
.yb-booking .yb-tooltip h4 { margin: 0 0 6px; padding-left: 8px; font-size: 1.05em; }
.yb-booking .yb-tooltip-img { width: 100%; height: 110px; object-fit: cover; border-radius: 5px; margin-bottom: 8px; display: block; }
.yb-booking .yb-tooltip-meta { margin: 3px 0; opacity: 0.8; }
.yb-booking .yb-tooltip-desc { margin: 8px 0 0; }

@media (max-width: 640px) {
	.yb-booking .yb-grid-body, .yb-booking .yb-grid-head { grid-template-columns: repeat(7, minmax(84px, 1fr)); }
	.yb-booking .yb-grid { overflow-x: auto; }
	.yb-booking .yb-toolbar { flex-direction: column; align-items: stretch; }
}

/* =========================================================
 * Espace client
 * ========================================================= */
.yb-account {
	--yb-color: var(--yb-primary, var(--wp--preset--color--primary, var(--e-global-color-primary, #5b7c5a)));
	font-family: inherit;
}
.yb-account .yb-account-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.yb-account input[type=email] {
	flex: 1; min-width: 220px; padding: 9px 12px;
	border: 1px solid rgba(0,0,0,0.2); border-radius: 6px; font-family: inherit;
}
.yb-account .yb-btn {
	background: var(--yb-color); color: #fff; border: none;
	border-radius: 6px; padding: 10px 18px; cursor: pointer; font-family: inherit;
}
.yb-account .yb-btn-secondary { background: transparent; color: var(--yb-color); border: 1px solid var(--yb-color); padding: 6px 12px; font-size: 0.88em; }
.yb-account .yb-cards-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.yb-account .yb-card-box { border: 1px solid rgba(0,0,0,0.14); border-radius: 8px; padding: 14px; }
.yb-account .yb-card-box.is-inactive { opacity: 0.5; }
.yb-account .yb-card-credits { margin-top: 6px; }
.yb-account .yb-big { font-size: 1.7em; font-weight: 700; color: var(--yb-color); line-height: 1; }
.yb-account .yb-progress { height: 6px; background: rgba(0,0,0,0.1); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.yb-account .yb-progress span { display: block; height: 100%; background: var(--yb-color); }
.yb-account .yb-card-alert { margin-top: 8px; font-size: 0.85em; color: #b3641d; }
.yb-account .yb-bookings-list { list-style: none; padding: 0; margin: 0; }
.yb-account .yb-bookings-list li {
	display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
	padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.08);
}
.yb-account .yb-bookings-list li.is-cancelled { opacity: 0.5; text-decoration: line-through; }
.yb-account .yb-note { font-size: 0.85em; opacity: 0.7; margin-top: 10px; }
.yb-account .yb-message.error { color: #b32d2e; }
.yb-account .yb-message.success { color: #237a24; }

/* Modale : compléments */
.yb-modal .yb-cards-title { margin: 14px 0 6px; font-weight: 600; font-size: 0.92em; }
.yb-modal .yb-cards-options label { margin: 4px 0; }
.yb-modal .yb-session-meta { opacity: 0.75; font-size: 0.9em; margin-top: 0; }

/* =========================================================
 * Changement de créneau : liste de créneaux (modale + page publique)
 * ========================================================= */
.yb-slot-list { list-style: none; padding: 0; margin: 10px 0 0; max-height: 340px; overflow-y: auto; }
.yb-slot-list li { border-bottom: 1px solid rgba(0,0,0,0.08); }
.yb-slot-list li:last-child { border-bottom: none; }
.yb-slot-list label {
	display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
	padding: 10px 4px; cursor: pointer; margin: 0; font-size: 0.92em;
}
.yb-slot-list label:hover { background: rgba(0,0,0,0.03); }
.yb-slot-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.yb-slot-list em { opacity: 0.65; font-size: 0.88em; }
.yb-slots-intro { font-size: 0.9em; opacity: 0.8; margin: 0; }
.yb-account .yb-booking-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================
 * Page publique de gestion d'une réservation (lien email)
 * ========================================================= */
.yb-manage-page {
	--yb-color: var(--yb-primary, var(--wp--preset--color--primary, var(--e-global-color-primary, #5b7c5a)));
	max-width: 620px; margin: 50px auto 70px; padding: 0 20px; font-family: inherit;
}
.yb-manage-page h1 { margin-bottom: 20px; }
.yb-manage-page h2 { font-size: 1.15em; margin: 32px 0 10px; }
.yb-manage-card {
	border: 1px solid rgba(0,0,0,0.12); border-radius: 8px;
	padding: 16px 18px; background: rgba(0,0,0,0.015);
}
.yb-manage-card h2 { margin: 0 0 6px; font-size: 1.2em; }
.yb-manage-meta { margin: 3px 0; opacity: 0.8; font-size: 0.92em; }
.yb-manage-status { margin: 10px 0 0; font-weight: 600; color: #b32d2e; }
.yb-manage-info { font-size: 0.9em; opacity: 0.8; }
.yb-manage-notice { padding: 12px 14px; border-radius: 6px; margin-bottom: 18px; font-size: 0.93em; }
.yb-manage-notice.is-success { background: #e4f3e4; color: #215c21; }
.yb-manage-notice.is-error { background: #f8e3e3; color: #8a2222; }
.yb-manage-btn {
	background: var(--yb-color); color: #fff; border: none; border-radius: 6px;
	padding: 11px 20px; cursor: pointer; font-family: inherit; font-size: 0.95em; margin-top: 12px;
}
.yb-manage-btn.is-secondary { background: transparent; color: var(--yb-color); border: 1px solid var(--yb-color); }
.yb-manage-btn:hover { opacity: 0.88; }

/* Bandeau de reconnaissance de la cliente dans la modale de réservation */
.yb-modal .yb-recognized {
	background: rgba(0,0,0,0.04); border-left: 3px solid var(--yb-color);
	border-radius: 4px; padding: 12px 14px; margin-top: 14px; font-size: 0.92em;
}
.yb-modal .yb-recognized-credits { margin-top: 6px; }
.yb-modal .yb-recognized .yb-big { font-size: 1.45em; font-weight: 700; color: var(--yb-color); }
.yb-modal .yb-recognized-alert { margin-top: 8px; color: #b3641d; font-size: 0.95em; }

/* =========================================================
 * Liste d'attente
 * ========================================================= */
.yb-booking .yb-event.has-waitlist { opacity: .78; cursor: pointer; border-left-style: dashed; }
.yb-booking .yb-event.has-waitlist:hover { opacity: 1; background: var(--yb-event-color); color: #fff; }
.yb-modal .yb-waitlist-note {
	background: rgba(0,0,0,.04); border-left: 3px solid var(--yb-color);
	border-radius: 4px; padding: 10px 12px; font-size: .9em; margin: 12px 0 0;
}

/* =========================================================
 * Bloc de paiement par virement
 * ========================================================= */
.yb-pay-block {
	border: 1px solid rgba(0,0,0,.12); border-radius: 10px;
	padding: 18px; margin: 22px 0; background: rgba(0,0,0,.015);
}
.yb-pay-block h3 { margin: 0 0 4px; font-size: 1.05em; }
.yb-pay-intro { margin: 0 0 12px; font-size: .92em; opacity: .8; }
.yb-pay-grid { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.yb-pay-details { flex: 1; min-width: 250px; }
.yb-pay-details dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; }
.yb-pay-details dt { font-size: .82em; opacity: .7; }
.yb-pay-details dd { margin: 0; font-size: .95em; }
.yb-pay-details code { background: rgba(0,0,0,.05); padding: 2px 7px; border-radius: 4px; font-size: .95em; }
.yb-pay-amount { font-size: 1.3em; font-weight: 700; color: var(--yb-color); }
.yb-pay-ref { font-weight: 700; }
.yb-pay-note { font-size: .85em; opacity: .8; margin: 12px 0 0; }
.yb-pay-qr { text-align: center; font-size: .8em; opacity: .75; }
.yb-pay-qr svg { display: block; margin: 0 auto 8px; border-radius: 6px; }

/* =========================================================
 * Questionnaire de santé
 * ========================================================= */
.yb-health-form { margin-top: 18px; }
.yb-health-q { margin-bottom: 18px; }
.yb-health-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95em; }
.yb-health-q .yb-req { color: #b3401d; }
.yb-health-q input[type=text],
.yb-health-q select,
.yb-health-q textarea {
	width: 100%; padding: 9px 11px; border: 1px solid rgba(0,0,0,.2);
	border-radius: 6px; font-family: inherit; font-size: .95em;
}
.yb-health-radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-size: .95em; }
.yb-health-consent {
	background: rgba(0,0,0,.04); border-radius: 6px; padding: 13px 15px;
	margin: 22px 0 18px; font-size: .9em; line-height: 1.6;
}
.yb-health-consent label { display: flex; gap: 9px; align-items: flex-start; }

/* Carte cadeau dans la popup de réservation */
.yb-modal .yb-gift-box { margin-top: 14px; }
.yb-modal .yb-gift-toggle {
	background: none; border: none; padding: 0; cursor: pointer;
	color: var(--yb-color); font-size: .9em; font-family: inherit;
	text-decoration: underline; text-underline-offset: 3px;
}
.yb-modal .yb-gift-toggle.is-open { font-weight: 600; }
.yb-modal .yb-gift-fields {
	margin-top: 10px; padding: 12px; border-radius: 6px;
	background: rgba(0,0,0,.035); border-left: 3px solid var(--yb-color);
}
.yb-modal .yb-gift-fields label { margin: 0 0 5px; font-size: .85em; }
.yb-modal .yb-gift-row { display: flex; gap: 8px; }
.yb-modal .yb-gift-row input { flex: 1; text-transform: uppercase; letter-spacing: 1px; }
.yb-modal .yb-gift-msg { margin-top: 8px; font-size: .85em; }
.yb-modal .yb-gift-msg.is-ok { color: #237a24; }
.yb-modal .yb-gift-msg.is-error { color: #b32d2e; }
