/* ── Reset & Base ─────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
    max-width: 680px;
    margin: 0 auto 20px;
    text-align: center;
    color: white;
}
.page-header h1 { font-size: 1.7rem; font-weight: 700; margin-bottom: 4px; }
.page-header p  { opacity: .75; font-size: .95rem; }

/* ── Container ───────────────────────────────────────────── */
.booking-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    max-width: 680px;
    margin: 0 auto;
}

/* ── Steps ───────────────────────────────────────────────── */
.step { display: none; }
.step.active { display: block; }

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px;
    background: transparent;
}

.step-item {
    flex: 1;
    text-align: center;
    position: relative;
    color: #bbb;
    font-size: .82rem;
    font-weight: 600;
}

.step-item.active { color: #667eea; }
.step-item.completed { color: #28a745; }

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: .9rem;
}

.step-item.active .step-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.step-item.completed .step-number {
    background: #28a745;
    color: white;
}

/* ── Headings ────────────────────────────────────────────── */
h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 18px;
}

/* ── Calendar ────────────────────────────────────────────── */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.nav-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    transition: opacity .2s;
}
.nav-button:hover { opacity: .85; }

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

.day-header {
    text-align: center;
    font-weight: 700;
    padding: 8px;
    font-size: .75rem;
    color: #888;
    text-transform: uppercase;
}

.day {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px 4px;
    border: 1.5px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    background: white;
    transition: all .15s;
    font-size: .88rem;
    font-weight: 500;
}

.day:hover:not(.empty):not(.closed):not(.past):not(.booked-out) {
    border-color: #667eea;
    background: #f0f2ff;
    color: #667eea;
}

.day.empty { cursor: default; background: transparent; border: none; }
.day.closed { background: #f8d7da; color: #dc3545; border-color: #f5c6cb; cursor: not-allowed; }
.day.booked-out { background: #fff3cd; color: #856404; border-color: #ffc107; cursor: not-allowed; position: relative; }
.day.booked-out::after { content: 'ausgebucht'; position: absolute; bottom: 1px; left: 0; right: 0; font-size: .5rem; text-transform: uppercase; letter-spacing: .3px; color: #856404; }
.day.selected { background: linear-gradient(135deg, #667eea, #764ba2); color: white; border-color: #667eea; }
.day.past { color: #ccc; cursor: not-allowed; background: #fafafa; }
.day.today { font-weight: 800; }

/* ── People Selector ─────────────────────────────────────── */
.people-selector { margin: 20px 0; }

.number-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 12px;
}

.stepper-btn {
    width: 54px; height: 54px;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    font-size: 1.4rem;
    font-weight: 700;
}

.stepper-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
    transform: scale(1.05);
}

.stepper-btn:disabled { opacity: .3; cursor: not-allowed; border-color: #ccc; color: #ccc; }

.stepper-display { text-align: center; min-width: 100px; }
.stepper-value { font-size: 3rem; font-weight: 800; color: #667eea; line-height: 1; margin-bottom: 4px; }
.stepper-label { font-size: .78rem; color: #888; text-transform: uppercase; letter-spacing: .8px; }

.people-quick-select {
    display: flex; gap: 8px; justify-content: center; margin-top: 14px;
}

.quick-btn {
    min-width: 46px; padding: 8px 16px;
    background: white; border: 2px solid #dee2e6;
    border-radius: 8px; cursor: pointer;
    font-size: .9rem; font-weight: 600; transition: all .2s;
}

.quick-btn:hover { border-color: #667eea; color: #667eea; transform: translateY(-1px); }
.quick-btn.active { background: linear-gradient(135deg, #667eea, #764ba2); color: white; border-color: #667eea; }

/* ── Time Slots ──────────────────────────────────────────── */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.time-slot {
    padding: 12px 6px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
    font-size: .88rem;
    font-weight: 600;
}

.time-slot:hover { border-color: #667eea; color: #667eea; }
.time-slot.selected { background: linear-gradient(135deg, #667eea, #764ba2); color: white; border-color: #667eea; }
.time-slot.unavailable { background: #f8f9fa; color: #ccc; cursor: not-allowed; border-color: #eee; }

/* ── Form ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block; margin-bottom: 4px;
    font-weight: 600; color: #495057; font-size: .85rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
input[type="text"], input[type="email"], input[type="tel"] {
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid #ced4da;
    border-radius: 6px;
    font-size: .9rem;
    transition: border-color .2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}

.input-error { border-color: #dc3545 !important; }

.email-error {
    color: #dc3545;
    font-size: .75rem;
    margin-top: 4px;
}

.optional-label {
    font-weight: 400;
    color: #888;
}

/* ── Buttons ─────────────────────────────────────────────── */
.button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 7px;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    margin-right: 8px;
    transition: all .15s;
    box-shadow: 0 3px 10px rgba(102,126,234,.3);
}

.button:hover { transform: translateY(-1px); box-shadow: 0 5px 15px rgba(102,126,234,.45); }
.button-secondary { background: #6c757d; box-shadow: none; }
.button-secondary:hover { background: #5a6268; transform: none; box-shadow: none; }
.button:disabled { background: #ccc; cursor: not-allowed; box-shadow: none; transform: none; opacity: 0.5; }

.button-group { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Messages ────────────────────────────────────────────── */
.loading { text-align: center; padding: 20px; color: #aaa; }

.message { padding: 12px 15px; border-radius: 6px; margin-bottom: 16px; font-size: .88rem; font-weight: 500; }
.message-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.message-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Booking Summary ─────────────────────────────────────── */
.booking-summary {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #eee;
}
.booking-summary h3 { font-size: .9rem; color: #333; margin-bottom: 12px; font-weight: 700; }

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: .9rem;
}
.summary-item:last-child { border-bottom: none; }
.summary-label { font-weight: 600; color: #666; }

/* ── Confirmation ────────────────────────────────────────── */
.confirmation { text-align: center; padding: 30px 20px; }
.confirmation-icon { font-size: 4rem; color: #28a745; margin-bottom: 16px; }
.confirmation h2 { color: #28a745; margin-bottom: 8px; }
.error-icon { font-size: 4rem; color: #dc3545; margin-bottom: 16px; }

/* ── Special Requests ────────────────────────────────────── */
.special-requests-group {
    margin-top: 14px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}
.special-requests-group label { font-weight: 600; color: #495057; margin-bottom: 6px; display: block; font-size: .85rem; }
.special-requests-group textarea {
    width: 100%; min-height: 80px; padding: 9px 11px;
    border: 1.5px solid #ced4da; border-radius: 6px;
    font-size: .9rem; font-family: inherit; resize: vertical; transition: border-color .2s;
}
.special-requests-group textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,.15); }
.hint { font-size: .75rem; color: #888; margin-top: 4px; }

/* ── Area Selector ───────────────────────────────────────── */
.area-selector { margin-bottom: 20px; display: none; }
.area-selector.visible { display: block; }
.area-selector label { display: block; font-weight: 600; color: #495057; font-size: .85rem; margin-bottom: 8px; }
.area-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.area-chip {
    padding: 10px 18px; border: 2px solid #dee2e6; border-radius: 10px;
    cursor: pointer; font-size: .9rem; font-weight: 600; transition: all .2s;
    background: white; color: #333; text-align: center;
}
.area-chip:hover { border-color: #667eea; color: #667eea; transform: translateY(-1px); }
.area-chip.selected { background: linear-gradient(135deg, #667eea, #764ba2); color: white; border-color: #667eea; }

/* Mobile time select — hidden on desktop */
.time-slots-select { display: none; }

/* Remove 300ms tap delay on touch devices */
button, .day, .time-slot, .quick-btn, .nav-button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    body { padding: 10px; }
    .booking-container { padding: 20px 14px; }
    .step-indicator { margin-bottom: 18px; }
    .step-item > div:not(.step-number) { font-size: .68rem; }
    .number-stepper { padding: 16px; gap: 14px; }
    .stepper-value { font-size: 2.2rem; }
    /* Stack buttons vertically, full width */
    .button-group { flex-direction: column; }
    .button-group .button,
    .button-group button {
        width: 100%;
        margin-right: 0;
        text-align: center;
        padding: 13px 22px;
        font-size: .95rem;
    }
    /* Calendar tap targets */
    .day { padding: 10px 2px; min-height: 40px; }
    .day-header { padding: 5px 2px; font-size: .7rem; }
    /* ── Mobile: hide grid, show native select ── */
    #timeSlots { display: none; }
    .time-slots-select {
        display: block;
        width: 100%;
        margin: 10px 0;
        padding: 14px 42px 14px 16px;
        font-size: 16px;
        font-family: inherit;
        font-weight: 600;
        color: #333;
        border: 2px solid #dee2e6;
        border-radius: 10px;
        background-color: white;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
        transition: border-color .2s;
    }
    .time-slots-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102,126,234,.15);
    }
    /* Quick-select fills row */
    .people-quick-select { gap: 6px; flex-wrap: wrap; }
    .quick-btn { flex: 1; min-width: 44px; padding: 10px 8px; }
    /* font-size 16px prevents iOS auto-zoom on focus */
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    input[type="text"], input[type="email"], input[type="tel"] {
        padding: 12px 11px;
        font-size: 16px;
    }
    .special-requests-group textarea { font-size: 16px; padding: 12px 11px; }
    .nav-button { padding: 9px 14px; font-size: .85rem; }
    .page-header h1 { font-size: 1.4rem; }
    .calendar-header { flex-direction: column; align-items: center; gap: 8px; }
    .calendar-header h3 { order: -1; margin: 0; font-size: 1.2rem; }
    .calendar-header .nav-button { width: 100%; text-align: center; }
    .confirmation { padding: 20px 12px; }
    .confirmation-icon, .error-icon { font-size: 3rem; }
}

/* ── Widget mode (embedded via iframe with ?widget=1) ────── */
body.widget-mode {
    background: transparent;
    padding: 0;
    min-height: unset;
}
body.widget-mode .page-header { display: none; }
body.widget-mode .booking-container {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
    padding: 20px 16px;
}

/* Very small phones */
@media (max-width: 420px) {
    body { padding: 0; }
    .page-header { padding: 14px 12px 10px; margin-bottom: 0; }
    .page-header h1 { font-size: 1.25rem; }
    .booking-container { border-radius: 0; padding: 14px 10px; }
    /* Step numbers only, no text */
    .step-item > div:not(.step-number) { display: none; }
    .step-number { width: 28px; height: 28px; font-size: .8rem; }
    .step-indicator { padding-bottom: 14px; margin-bottom: 16px; }
    /* Calendar breaks out of card padding */
    .calendar-header { margin: 0 -10px 10px; padding: 0 10px; }
    .calendar { gap: 2px; margin: 0 -10px 12px; }
    .day { aspect-ratio: 1; padding: 0; font-size: .85rem; min-height: unset; border-radius: 4px; }
    .day-header { font-size: .65rem; padding: 5px 2px; }
    /* Time scroll strip */
    .time-slots { margin: 10px -10px 12px; padding: 4px 10px 12px; }
    .stepper-value { font-size: 1.9rem; }
    .stepper-btn { width: 48px; height: 48px; }
    .number-stepper { padding: 14px; gap: 12px; }
}
