/* Terminbuchung – Section & Fullscreen-Overlay */

#booking {
    padding-bottom: 24px;
}

.booking-emergency-notice {
    max-width: 42em;
    margin: 0 0 20px;
    padding: 14px 16px;
    border-left: 4px solid var(--color-emergency);
    background-color: var(--color-emergency-bg);
    color: #333;
    font-size: 15px;
    line-height: 1.5;
}

.booking-emergency-notice a {
    color: var(--color-primary);
    font-weight: bold;
    white-space: nowrap;
}

.booking-emergency-notice a:hover {
    color: var(--color-accent);
}

#booking-overlay .booking-emergency-notice {
    max-width: 720px;
    margin: 16px auto 0;
    padding-left: 20px;
    padding-right: 20px;
}

.booking-intro {
    max-width: 42em;
}

.btn-booking-open {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 28px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-sm);
    background-color: var(--color-primary);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
    box-sizing: border-box;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-booking-open:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

#booking-overlay {
    position: fixed;
    z-index: 70;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    overflow: hidden;
}

#booking-overlay.hidden {
    display: none;
}

.booking-overlay-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.booking-overlay-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: var(--color-primary);
    color: #fff;
}

.booking-overlay-header h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

#booking-overlay .btn-close {
    position: relative;
    right: auto;
    top: auto;
    flex-shrink: 0;
    margin-left: 12px;
    background-color: transparent;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
}

#booking-overlay .btn-close::before,
#booking-overlay .btn-close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 2px;
    background: #fff;
}

#booking-overlay .btn-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

#booking-overlay .btn-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

#booking-form {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 20px 48px;
}

.booking-field {
    margin-bottom: 28px;
}

.booking-field > label,
.booking-field > .booking-label {
    display: block;
    margin-bottom: 10px;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 15px;
}

.booking-hint {
    margin: 0 0 10px;
    color: #5c5c5c;
    font-size: 14px;
    line-height: 1.4;
}

/* Tieranzahl – Segment-Slider */
.animal-count-slider {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d0d5dc;
}

.animal-count-slider input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.animal-count-slider label {
    flex: 1;
    margin: 0;
    padding: 14px 8px;
    text-align: center;
    background-color: #f1f3f6;
    color: var(--color-primary);
    font-weight: normal;
    cursor: pointer;
    border-right: 1px solid #d0d5dc;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.animal-count-slider label:last-of-type {
    border-right: none;
}

.animal-count-slider input:checked + label {
    background-color: var(--color-primary);
    color: #fff;
    font-weight: bold;
}

/* Tierart – Bild-Auswahl */
.animal-type-picker {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow: visible;
}

.animal-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 14px 10px;
    min-height: 130px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    background-color: #f9f9f9;
    color: var(--color-primary);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.animal-type-card:hover:not(.unavailable) {
    border-color: #6aabe1;
}

.animal-type-card.unavailable {
    position: relative;
    cursor: help;
    background-color: #f0f0f0;
    border-color: #ddd;
    color: #888;
}

.animal-type-card.unavailable:hover,
.animal-type-card.unavailable:focus-within {
    z-index: 20;
}

.animal-type-card.unavailable[data-unavailable-hint]::after {
    content: attr(data-unavailable-hint);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    bottom: auto;
    transform: translateX(-50%);
    z-index: 30;
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    padding: 8px 10px;
    border-radius: 6px;
    background-color: #fff8e6;
    border: 1px solid #e6a800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #5c4a00;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.animal-type-card.unavailable[data-unavailable-hint]:hover::after,
.animal-type-card.unavailable[data-unavailable-hint]:focus-within::after {
    opacity: 1;
    visibility: visible;
}

.animal-type-card.unavailable .animal-type-icon img {
    filter: grayscale(100%);
    opacity: 0.65;
}

.animal-type-card.unavailable .animal-type-label {
    color: #888;
}

.animal-type-card.selected:not(.unavailable),
.animal-type-card:has(input:checked):not(.unavailable) {
    border-color: #13356d;
    background-color: #eef3fa;
    box-shadow: 0 0 0 1px #13356d;
}

.animal-type-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.animal-type-card.unavailable input {
    pointer-events: none;
}

.animal-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 6px;
}

.animal-type-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.animal-type-label {
    font-size: 13px;
    line-height: 1.25;
    font-weight: normal;
}

@media (min-width: 576px) {
    .animal-type-picker {
        grid-template-columns: repeat(3, 1fr);
    }

    .animal-type-label {
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    .animal-type-picker {
        grid-template-columns: repeat(5, 1fr);
    }
}

.booking-animal-type-detail-wrap {
    margin-top: 14px;
}

.booking-animal-type-detail-wrap label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 15px;
}

.booking-animal-type-detail-wrap input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d5dc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 15px;
    box-sizing: border-box;
}

.booking-animal-type-detail-wrap .booking-hint {
    margin-top: 8px;
    margin-bottom: 0;
}

/* Wunschtierarzt */
.vet-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.vet-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 14px 10px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    background-color: #f9f9f9;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.vet-card:hover:not(.unavailable) {
    border-color: #6aabe1;
}

.vet-card.unavailable {
    position: relative;
    opacity: 0.55;
    cursor: help;
    background-color: #f0f0f0;
}

.vet-card.unavailable[data-unavailable-hint]::after {
    content: attr(data-unavailable-hint);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    z-index: 10;
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    padding: 8px 10px;
    border-radius: 6px;
    background-color: #fff8e6;
    border: 1px solid #e6a800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #5c4a00;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.vet-card.unavailable[data-unavailable-hint]:hover::after,
.vet-card.unavailable[data-unavailable-hint]:focus-within::after {
    opacity: 1;
    visibility: visible;
}

.vet-card.unavailable .vet-photo img {
    filter: grayscale(100%);
}

.vet-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vet-card.selected:not(.unavailable),
.vet-card:has(input:checked):not(.unavailable) {
    border-color: #13356d;
    background-color: #eef3fa;
    box-shadow: 0 0 0 1px #13356d;
}

.vet-card.unavailable input {
    pointer-events: none;
}

.vet-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e8edf3;
}

.vet-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vet-photo-none {
    color: #6a8ab0;
}

.vet-photo-none svg {
    width: 40px;
    height: 40px;
}

.vet-label {
    color: var(--color-primary);
    font-size: 14px;
    line-height: 1.25;
}

@media (min-width: 576px) {
    .vet-picker {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Kalender & Zeitfenster */
.booking-schedule-placeholder {
    margin: 8px 0 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background-color: #f5f7f9;
    border: 1px dashed #c5ccd4;
}

.booking-schedule-picker {
    margin-top: 8px;
}

.booking-calendar {
    max-width: 360px;
    margin-bottom: 20px;
}

.booking-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.booking-calendar-month-label {
    font-weight: bold;
    font-size: 16px;
}

.booking-calendar-nav {
    width: 36px;
    height: 36px;
    border: 1px solid #c5ccd4;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--color-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.booking-calendar-nav:hover:not(:disabled) {
    border-color: var(--color-primary);
    background-color: #f0f7f4;
}

.booking-calendar-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.booking-calendar-weekdays,
.booking-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.booking-calendar-grid {
    overflow: visible;
}

.booking-calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    padding-bottom: 4px;
}

.booking-calendar-day {
    aspect-ratio: 1;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: #f5f7f9;
    color: #999;
    font-family: inherit;
    font-size: 14px;
    cursor: default;
}

.booking-calendar-day--empty {
    visibility: hidden;
    pointer-events: none;
}

.booking-calendar-day--past {
    background: #f0f0f0;
    color: #bbb;
}

.booking-calendar-day--unavailable {
    background: #eceff2;
    color: #aaa;
}

.booking-calendar-day--too-short-notice {
    position: relative;
    background: #eceff2;
    color: #aaa;
    cursor: help;
}

.booking-calendar-day--too-short-notice:hover,
.booking-calendar-day--too-short-notice:focus-visible {
    z-index: 20;
}

.booking-calendar-day--too-short-notice[data-unavailable-hint]::after {
    content: attr(data-unavailable-hint);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    z-index: 30;
    width: max-content;
    max-width: min(240px, calc(100vw - 32px));
    padding: 8px 10px;
    border-radius: 6px;
    background-color: #fff8e6;
    border: 1px solid #e6a800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #5c4a00;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.booking-calendar-day--too-short-notice[data-unavailable-hint]:hover::after,
.booking-calendar-day--too-short-notice[data-unavailable-hint]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.booking-calendar-day--available {
    background-color: #e8f5ef;
    border-color: #b8dcc8;
    color: var(--color-primary);
    font-weight: bold;
    cursor: pointer;
}

.booking-calendar-day--available:hover {
    background-color: #d4eddf;
    border-color: var(--color-primary);
}

.booking-calendar-day--selected {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.booking-calendar-day--today:not(.booking-calendar-day--selected) {
    box-shadow: inset 0 0 0 2px var(--color-accent);
}

.booking-day-schedule {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background-color: #f5f7f9;
    border: 1px solid #dde3ea;
}

.booking-day-schedule-label {
    margin: 0 0 8px;
    font-weight: bold;
}

.booking-available-window {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: bold;
    color: var(--color-primary);
}

/* Datum & Zeit */
.booking-datetime-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.booking-datetime-row .booking-input-group {
    flex: 1 1 140px;
    min-width: 120px;
}

.booking-input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #5c5c5c;
    font-weight: normal;
}

.booking-input-group input[type="date"],
.booking-input-group input[type="time"],
.booking-input-group input[type="text"],
.booking-input-group input[type="tel"],
.booking-input-group input[type="email"],
.booking-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d0d5dc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    color: #0f0f0f;
}

.booking-input-group input:disabled,
.booking-field textarea:disabled {
    background-color: #f5f5f5;
    color: #999;
}

.booking-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d0d5dc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    color: #0f0f0f;
    resize: vertical;
    min-height: 100px;
}

/* Datei-Upload */
.booking-file-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.booking-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-booking-file-select {
    align-self: flex-start;
    padding: 10px 18px;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    background-color: #fff;
    color: var(--color-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-booking-file-select:hover:not(:disabled) {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-booking-file-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.booking-file-count {
    color: #5c5c5c;
    font-size: 14px;
}

.booking-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.booking-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #d0d5dc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.booking-file-name {
    flex: 1;
    min-width: 0;
    color: var(--color-primary);
    font-size: 14px;
    word-break: break-word;
}

.booking-file-size {
    flex-shrink: 0;
    color: #5c5c5c;
    font-size: 13px;
}

.btn-booking-file-remove {
    flex-shrink: 0;
    padding: 4px 10px;
    border: 1px solid #c62828;
    border-radius: 4px;
    background-color: #fff;
    color: #c62828;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-booking-file-remove:hover {
    background-color: #c62828;
    color: #fff;
}

.booking-field > label[for] {
    display: block;
    margin-bottom: 10px;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 15px;
}

.booking-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    cursor: pointer;
    font-weight: normal;
    color: #0f0f0f;
}

.booking-checkbox input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #13356d;
}

.booking-consent-field {
    margin-top: 8px;
    margin-bottom: 20px;
}

.booking-consent-field .booking-checkbox {
    margin-top: 0;
    font-size: 14px;
    line-height: 1.45;
}

.booking-consent-field .booking-checkbox a {
    color: var(--color-primary);
}

.booking-time-disabled .booking-datetime-row {
    opacity: 0.45;
    pointer-events: none;
}

/* Leistungen – Multi-Select */
#booking-services-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.booking-service-category {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.booking-service-category-title {
    margin: 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #d8e2ef;
    color: var(--color-primary);
    font-size: 15px;
    font-weight: bold;
    line-height: 1.3;
}

.booking-service-category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.booking-service-card {
    display: block;
    position: relative;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.booking-service-card:hover:not(.unavailable) {
    border-color: #6aabe1;
}

.booking-service-card.selected {
    border-color: #13356d;
    background-color: #eef3fa;
}

.booking-service-card.unavailable {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: #f0f0f0;
}

.booking-service-card input {
    position: absolute;
    left: 16px;
    top: 18px;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #13356d;
}

.booking-service-card.unavailable input {
    pointer-events: none;
}

.booking-service-name {
    display: block;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.booking-service-desc {
    display: block;
    color: #5c5c5c;
    font-size: 14px;
    line-height: 1.35;
}

#booking-duration-display {
    padding: 12px 16px;
    background-color: #eef3fa;
    border-radius: 6px;
    color: var(--color-primary);
    font-size: 15px;
}

#booking-duration-display.empty {
    color: #5c5c5c;
    background-color: #f1f3f6;
}

.booking-contact-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-booking-submit {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 8px auto 0;
    padding: 16px 24px;
    border: none;
    border-radius: 4px;
    background-color: var(--color-primary);
    color: #fff;
    font-family: inherit;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-booking-submit:hover:not(:disabled) {
    background-color: var(--color-accent);
}

.btn-booking-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

#booking-form-message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.5;
}

#booking-form-message.success {
    background-color: #e8f5e9;
    color: #1b5e20;
    border-left: 4px solid #2e7d32;
    font-weight: bold;
}

#booking-form-message.error {
    background-color: #ffebee;
    color: #b71c1c;
}

#booking-form-message.hidden {
    display: none;
}

body.booking-overlay-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .booking-overlay-header h2 {
        font-size: 24px;
    }

    #booking-form {
        padding: 28px 32px 56px;
    }

    .booking-contact-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}
