/*
 * Sindesi Direct Booking — modal "Termin anfragen".
 *
 * Namespace CSS: .sdb-* (sindesi direct booking) per non collidere con la
 * chat modal (.sc-*). Look-and-feel coerente coi colori Sindesi (#0280DE +
 * gradient a #08B4BB) già usati nel resto del prodotto.
 *
 * Layout responsive: mobile-first. Il breakpoint 640px passa dai 2 colonne
 * (grid slot) a lista verticale.
 */

/* === Overlay === */
.sdb-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 16px;
    animation: sdb-fade-in 160ms ease-out;
}
@keyframes sdb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sdb-modal {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sdb-slide-up 200ms ease-out;
}
@keyframes sdb-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Header === */
.sdb-modal__header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #edf2f7;
}
.sdb-modal__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}
.sdb-modal__subtitle {
    margin: 0;
    font-size: 13px;
    color: #718096;
}

/* === Body === */
.sdb-modal__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* === Week nav === */
.sdb-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.sdb-week-nav__label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}
.sdb-week-nav__btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    border-radius: 8px;
    color: #1a202c;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 120ms;
}
.sdb-week-nav__btn:hover:not(:disabled) {
    background-color: #edf2f7;
}
.sdb-week-nav__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === Day picker === */
.sdb-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}
.sdb-day {
    padding: 10px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: #ffffff;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    transition: all 120ms;
}
.sdb-day:hover:not(:disabled):not(.is-selected) {
    background-color: #edf2f7;
}
.sdb-day.is-selected {
    background-color: #0280DE;
    background-image: linear-gradient(135deg, #0280DE, #08B4BB);
    border-color: #0280DE;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 128, 222, 0.3);
}
.sdb-day:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.sdb-day__weekday {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.sdb-day__date {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

/* === Slot grid === */
.sdb-slots-label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin: 0 0 10px;
}
.sdb-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
@media (max-width: 640px) {
    .sdb-slots { grid-template-columns: repeat(3, 1fr); }
}
.sdb-slot {
    padding: 10px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    transition: all 120ms;
}
.sdb-slot:hover:not(.is-selected) {
    background-color: #edf2f7;
}
.sdb-slot.is-selected {
    background-color: #0280DE;
    background-image: linear-gradient(135deg, #0280DE, #08B4BB);
    border-color: #0280DE;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 128, 222, 0.3);
}

.sdb-slots-empty {
    padding: 20px;
    text-align: center;
    color: #718096;
    font-size: 13px;
    background-color: #f7fafc;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* === Loading === */
.sdb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #718096;
    font-size: 13px;
    gap: 8px;
}
.sdb-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e0;
    border-top-color: #0280DE;
    border-radius: 50%;
    animation: sdb-spin 700ms linear infinite;
}
@keyframes sdb-spin {
    to { transform: rotate(360deg); }
}

/* === Preview === */
.sdb-preview {
    background-color: #f7fafc;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.sdb-preview__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 6px;
}
.sdb-preview__row:last-child { margin-bottom: 0; }
.sdb-preview__row--total {
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
}
.sdb-preview__label { font-weight: 500; }
.sdb-preview__value { font-weight: 600; color: #1a202c; }

/* === Preisvorschlag (v0.32.15, solo per listing verhandelbar) === */
.sdb-price-negotiable {
    margin: 16px 0 8px;
    padding: 14px 14px 12px;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.sdb-price-negotiable__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}
.sdb-price-negotiable__input-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 120ms, box-shadow 120ms;
}
.sdb-price-negotiable__input-wrap:focus-within {
    border-color: #0280DE;
    box-shadow: 0 0 0 3px rgba(2, 128, 222, 0.15);
}
.sdb-price-negotiable__currency {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background-color: #edf2f7;
    color: #4a5568;
    font-size: 13px;
    font-weight: 600;
    border-right: 1px solid #e2e8f0;
}
.sdb-price-negotiable__input {
    flex: 1;
    border: 0;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
    background-color: transparent;
    outline: none;
}
.sdb-price-negotiable__input::placeholder {
    color: #a0aec0;
    font-weight: 500;
}
.sdb-price-negotiable__hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #718096;
}

/* === Note textarea === */
.sdb-note-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}
.sdb-note {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    color: #1a202c;
    resize: vertical;
    min-height: 60px;
    background-color: #ffffff;
}
.sdb-note:focus {
    outline: none;
    border-color: #0280DE;
    box-shadow: 0 0 0 3px rgba(2, 128, 222, 0.15);
}

/* === Error === */
.sdb-error {
    background-color: #fef5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* === Footer / actions === */
.sdb-modal__footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #edf2f7;
    display: flex;
    gap: 8px;
}
.sdb-modal__footer .sdb-btn { flex: 1; }
.sdb-btn {
    padding: 14px 18px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 80ms, box-shadow 120ms;
}
.sdb-btn--secondary {
    border: 1px solid #e2e8f0;
    background-color: #f7fafc;
    color: #1a202c;
}
.sdb-btn--secondary:hover { background-color: #edf2f7; }
.sdb-btn--primary {
    background-color: #0280DE;
    background-image: linear-gradient(135deg, #0280DE, #08B4BB);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 128, 222, 0.3);
}
.sdb-btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 128, 222, 0.4);
}
.sdb-btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
