/* Termin Buchung – Frontend. Hohe Spezifität gegen Theme-Overrides (Avada). */

.tb-wrap, .tb-modal { --tb-primary: #3b6ea5; --tb-primary-dark: #2d5580; --tb-border: #dfe3e8; --tb-text: #222; --tb-muted: #6b7280; --tb-bg: #fff; --tb-radius: 10px; }
body .tb-wrap, body .tb-modal { font-size: var(--tb-font, 15px); line-height: 1.5; font-family: inherit; }
@media (max-width: 480px) { body .tb-wrap, body .tb-modal { font-size: calc(var(--tb-font, 15px) - 1px); } }

body .tb-wrap .tb-intro { margin: 0 0 20px; color: var(--tb-muted); }
body .tb-wrap .tb-notice { padding: 14px 16px; background: #fff7e6; border: 1px solid #f5d38f; border-radius: var(--tb-radius); }

/* Kacheln */
body .tb-wrap .tb-grid { display: grid; grid-template-columns: repeat(var(--tb-cols, 3), minmax(0, 1fr)); gap: 20px; margin: 0; }
@media (max-width: 900px) { body .tb-wrap .tb-grid { grid-template-columns: repeat(min(var(--tb-cols, 3), 2), minmax(0, 1fr)); } }
@media (max-width: 560px) { body .tb-wrap .tb-grid { grid-template-columns: 1fr; gap: 14px; } }
body .tb-wrap .tb-card-img { margin: -22px -22px 4px; border-radius: 0; overflow: hidden; }
body .tb-wrap .tb-card-img img { display: block; width: 100%; height: 160px; object-fit: cover; }
body .tb-modal .tb-detail-img { margin: 0 0 12px; border-radius: 8px; overflow: hidden; }
body .tb-modal .tb-detail-img img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
body .tb-wrap .tb-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; background: var(--tb-bg); border: 1px solid var(--tb-border); border-top: 5px solid var(--tb-card-color, var(--tb-primary)); border-radius: var(--tb-radius); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
body .tb-wrap .tb-card h3.tb-card-title { margin: 0 0 4px; font-family: inherit; font-size: 1.15em; font-weight: 700; line-height: 1.3; color: var(--tb-text); text-transform: none; letter-spacing: 0; }
body .tb-wrap .tb-card .tb-card-meta { color: var(--tb-muted); font-size: .92em; }
body .tb-wrap .tb-card .tb-card-desc { color: var(--tb-text); font-size: .95em; flex: 1; }
body .tb-wrap .tb-card .tb-card-desc p:last-child { margin-bottom: 0; }

/* Buttons */
body .tb-wrap button.tb-btn, body .tb-modal button.tb-btn, body .tb-modal a.tb-btn, body .tb-storno-page .tb-btn {
	display: inline-block; padding: 9px 16px; border-radius: 8px; border: 2px solid var(--tb-primary, #3b6ea5); background: var(--tb-primary, #3b6ea5); color: #fff !important;
	font-family: inherit; font-size: .93em; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none !important; text-align: center; transition: background .15s; box-shadow: none; margin: 0; text-transform: none; letter-spacing: 0;
}
body .tb-wrap button.tb-btn:hover, body .tb-modal button.tb-btn:hover, body .tb-modal a.tb-btn:hover, body .tb-storno-page .tb-btn:hover { background: var(--tb-primary-dark, #2d5580); border-color: var(--tb-primary-dark, #2d5580); color: #fff !important; }
body .tb-modal .tb-btn-secondary, body .tb-storno-page .tb-btn-secondary, body .tb-wrap .tb-btn-secondary { background: #fff; color: var(--tb-primary, #3b6ea5) !important; }
body .tb-modal .tb-btn-secondary:hover, body .tb-storno-page .tb-btn-secondary:hover { background: #f1f5f9; color: var(--tb-primary-dark, #2d5580) !important; }
body .tb-modal button.tb-btn[disabled] { opacity: .6; cursor: default; }
body .tb-wrap .tb-card button.tb-btn { align-self: flex-start; }
body .tb-storno-page form { display: flex; gap: 12px; flex-wrap: wrap; --tb-primary: #3b6ea5; --tb-primary-dark: #2d5580; }

/* Modal */
body.tb-modal-open { overflow: hidden; }
body .tb-modal[hidden] { display: none; }
body > .tb-modal, body .tb-modal { position: fixed; inset: 0; z-index: 2147483000; margin: 0; transform: none; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
@media (max-width: 640px) { body > .tb-modal, body .tb-modal { align-items: flex-start; padding: var(--tb-modal-top, 16px) 10px 10px; } }
body .tb-modal .tb-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
@media (max-width: 640px) { body .tb-modal .tb-modal-dialog { max-height: calc(100vh - var(--tb-modal-top, 16px) - 10px); max-height: calc(100dvh - var(--tb-modal-top, 16px) - 10px); padding: 18px 16px 14px; } }
body .tb-modal .tb-modal-dialog { position: relative; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--tb-bg); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); padding: 24px 24px 18px; box-sizing: border-box; }
body .tb-modal .tb-modal-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--tb-muted); font-size: 28px; line-height: 1; cursor: pointer; padding: 0; margin: 0; box-shadow: none; }
body .tb-modal .tb-modal-close:hover { color: var(--tb-text); background: transparent; }
body .tb-modal .tb-modal-title { margin: 0 0 12px; padding: 0; font-family: inherit; font-size: 1.15em; font-weight: 700; line-height: 1.3; color: var(--tb-text); text-transform: none; letter-spacing: 0; }
body .tb-modal .tb-modal-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
body .tb-modal .tb-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; margin-top: 12px; border-top: 1px solid var(--tb-border); flex-wrap: wrap; }
body .tb-modal .tb-modal-footer:empty { display: none; }

/* Schritte */
body .tb-modal .tb-steps { display: flex; gap: 6px; margin: 0 30px 16px 0; flex-wrap: wrap; }
body .tb-modal .tb-step { display: inline-flex; align-items: center; gap: 6px; font-size: .78em; color: var(--tb-muted); }
body .tb-modal .tb-step-num { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: #e5e7eb; color: #374151; font-weight: 600; font-size: .85em; }
body .tb-modal .tb-step.is-active .tb-step-num { background: var(--tb-primary); color: #fff; }
body .tb-modal .tb-step.is-active { color: var(--tb-text); font-weight: 600; }
body .tb-modal .tb-step.is-done .tb-step-num { background: #16a34a; color: #fff; }
@media (max-width: 520px) { body .tb-modal .tb-step-label { display: none; } body .tb-modal .tb-step.is-active .tb-step-label { display: inline; } }

/* Optionen */
body .tb-modal .tb-options { display: grid; gap: 10px; }
body .tb-modal button.tb-option { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; padding: 14px 16px; background: #fff; border: 2px solid var(--tb-border); border-radius: 10px; text-align: left; cursor: pointer; color: var(--tb-text); font: inherit; box-shadow: none; margin: 0; text-transform: none; letter-spacing: 0; transition: border-color .15s, background .15s; }
body .tb-modal button.tb-option:hover { border-color: var(--tb-primary); background: #f6f9fc; color: var(--tb-text); }
body .tb-modal .tb-option-title { font-weight: 600; font-size: 1.02em; }
body .tb-modal .tb-option-meta { color: var(--tb-muted); font-size: .9em; }
body .tb-modal .tb-persons { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 560px) {
	body .tb-modal .tb-persons { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	body .tb-modal button.tb-person { padding: 10px 6px; }
	body .tb-modal .tb-person-avatar { width: 44px; height: 44px; font-size: 1.1em; margin-bottom: 4px; }
	body .tb-modal button.tb-person .tb-option-title { font-size: .9em; line-height: 1.2; }
}
body .tb-modal button.tb-person { align-items: center; text-align: center; }
body .tb-modal .tb-person-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #e5e7eb; color: #374151; font-weight: 700; font-size: 1.4em; margin-bottom: 6px; }
body .tb-modal .tb-person-any { background: var(--tb-primary); color: #fff; }

/* Kalender */
body .tb-modal .tb-cal-wrap { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 560px) { body .tb-modal .tb-cal-wrap { grid-template-columns: 1fr; gap: 12px; } }
body .tb-modal .tb-cal { margin-bottom: 0; }
body .tb-modal .tb-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
body .tb-modal .tb-cal-nav button { width: 30px; height: 30px; border: 1px solid var(--tb-border); background: #fff; border-radius: 8px; cursor: pointer; font-size: 1.3em; color: var(--tb-text); padding: 0; margin: 0; box-shadow: none; line-height: 1; }
body .tb-modal .tb-cal-nav button[disabled] { opacity: .35; cursor: default; }
body .tb-modal .tb-cal-month { font-weight: 600; }
body .tb-modal .tb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
body .tb-modal .tb-cal-head { text-align: center; font-size: .75em; color: var(--tb-muted); padding: 2px 0; }
body .tb-modal button.tb-cal-day { height: 32px; min-height: 32px; line-height: 1; border: 1px solid transparent; background: transparent; border-radius: 6px; color: #9ca3af; font: inherit; font-size: .85em; cursor: default; padding: 0; margin: 0; box-shadow: none; }
body .tb-modal button.tb-cal-day.is-free { background: #eaf2fb; border-color: #c7dbf1; color: var(--tb-primary); font-weight: 600; cursor: pointer; }
body .tb-modal button.tb-cal-day.is-free:hover { background: #d6e6f8; }
body .tb-modal button.tb-cal-day.is-selected { background: var(--tb-primary); border-color: var(--tb-primary); color: #fff; }

/* Slots */
body .tb-modal .tb-slots-title { margin: 0 0 8px; font-weight: 600; }
body .tb-modal .tb-slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
body .tb-modal button.tb-slot { padding: 6px 4px; font-size: .85em; border: 2px solid var(--tb-border); background: #fff; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; color: var(--tb-text); margin: 0; box-shadow: none; }
body .tb-modal button.tb-slot:hover { border-color: var(--tb-primary); color: var(--tb-primary); background: #f6f9fc; }

/* Formular */
body .tb-modal .tb-summary { padding: 12px 14px; background: #f3f6fa; border-radius: 8px; margin-bottom: 14px; line-height: 1.5; }
body .tb-modal .tb-form label { display: block; font-weight: 600; font-size: .92em; margin-bottom: 10px; color: var(--tb-text); }
body .tb-modal .tb-form input[type="text"], body .tb-modal .tb-form input[type="email"], body .tb-modal .tb-form input[type="tel"], body .tb-modal .tb-form input[type="date"], body .tb-modal .tb-form input[type="number"], body .tb-modal .tb-form select, body .tb-modal .tb-form textarea {
	display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--tb-text); box-sizing: border-box; box-shadow: none;
}
body .tb-modal .tb-form input:focus, body .tb-modal .tb-form textarea:focus { outline: none; border-color: var(--tb-primary); box-shadow: 0 0 0 3px rgba(59,110,165,.18); }
body .tb-modal .tb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { body .tb-modal .tb-row { grid-template-columns: 1fr; gap: 0; } }
body .tb-modal .tb-check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
body .tb-modal .tb-check input { margin-top: 3px; }
body .tb-modal .tb-hp { position: absolute; left: -9999px; top: -9999px; }

/* Zustände */
body .tb-modal .tb-loading { padding: 30px 0; text-align: center; color: var(--tb-muted); }
body .tb-modal .tb-muted { color: var(--tb-muted); }
body .tb-modal .tb-error { padding: 12px 14px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 8px; margin-bottom: 12px; }
body .tb-modal .tb-success { text-align: center; }
body .tb-modal .tb-success-icon { width: 64px; height: 64px; margin: 6px auto 12px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 34px; line-height: 64px; }
body .tb-modal .tb-success .tb-summary { text-align: left; display: inline-block; }

/* Zahlung */
body .tb-modal label.tb-pay-option { display: flex; flex-direction: row; gap: 12px; align-items: flex-start; cursor: pointer; width: 100%; padding: 14px 16px; background: #fff; border: 2px solid var(--tb-border); border-radius: 10px; color: var(--tb-text); font: inherit; font-weight: 400; margin: 0; box-sizing: border-box; transition: border-color .15s, background .15s; }
body .tb-modal label.tb-pay-option:hover { border-color: var(--tb-primary); }
body .tb-modal label.tb-pay-option input { margin-top: 4px; flex: 0 0 auto; }
body .tb-modal .tb-pay-body { display: flex; flex-direction: column; gap: 3px; }
body .tb-modal label.tb-pay-option.is-selected { border-color: var(--tb-primary); background: #f6f9fc; }
body .tb-wrap .tb-card-preis { color: var(--tb-text); }

/* Terminart-Detail */
body .tb-modal .tb-detail-meta { margin: 0 0 12px; color: var(--tb-muted); font-weight: 600; }
body .tb-modal .tb-detail-text { line-height: 1.55; }
body .tb-modal .tb-detail-text p:last-child { margin-bottom: 0; }
body .tb-wrap .tb-card .tb-card-kurz { color: var(--tb-text); font-size: .95em; flex: 1; margin: 0; }

@media (max-width: 480px) {
	body .tb-modal button.tb-btn, body .tb-modal a.tb-btn { padding: 8px 12px; font-size: .88em; }
	body .tb-modal .tb-modal-footer { gap: 6px; }
	body .tb-modal .tb-steps { margin-right: 26px; }
}

/* Ladeanzeige */
body .tb-modal .tb-spinner, body .tb-wrap .tb-spinner { display: inline-block; width: 0.9em; height: 0.9em; border: 2px solid rgba(0,0,0,.15); border-top-color: var(--tb-primary, #3b6ea5); border-radius: 50%; animation: tb-spin .8s linear infinite; vertical-align: -0.15em; margin-right: 6px; }
body .tb-modal .tb-cal-month .tb-spinner { margin-left: 6px; margin-right: 0; }
body .tb-modal .tb-cal.is-loading .tb-cal-grid { opacity: .45; transition: opacity .15s; }
body .tb-modal .tb-loading-inline { margin: 8px 0 0; }
@keyframes tb-spin { to { transform: rotate(360deg); } }
