/**
 * Bistro Bullauge Reservierungen – Frontend
 *
 * Layout is provided by the plugin. In bbr-theme-inherit mode visual controls
 * (colors, borders, backgrounds, buttons, typography) are deliberately left to
 * the active WordPress theme. In bbr-theme-custom mode the plugin provides a
 * neutral complete visual baseline. Admin design overrides can be applied in
 * either mode.
 */

.bbr-reservation-form-wrapper {
    --bbr-space-xs: .375rem;
    --bbr-space-sm: .75rem;
    --bbr-space-md: 1rem;
    --bbr-space-lg: clamp(1.25rem, 2vw, 1.75rem);
    --bbr-space-xl: clamp(1.5rem, 3vw, 2.5rem);
    --bbr-brand: var(--bbr-custom-accent, #c1bb9b);
    --bbr-brand-contrast: #2f2d25;
    max-width: min(100%, var(--bbr-custom-max-width, 58rem));
    width: 100%;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.bbr-reservation-form-wrapper *,
.bbr-reservation-form-wrapper *::before,
.bbr-reservation-form-wrapper *::after {
    box-sizing: border-box;
}

.bbr-reservation-form-title {
    margin: 0 0 var(--bbr-space-sm);
    font-family: inherit;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
}

.bbr-reservation-form-description {
    margin: 0 0 var(--bbr-space-xl);
}

.bbr-reservation-form-description > :first-child { margin-top: 0; }
.bbr-reservation-form-description > :last-child { margin-bottom: 0; }

.bbr-required-note {
    margin: 0 0 var(--bbr-space-lg);
    font-size: .925em;
    opacity: .78;
}

.bbr-required-marker {
    margin-inline-start: .18em;
    font-weight: 700;
}

.bbr-reservation-form {
    display: grid;
    gap: var(--bbr-custom-section-spacing, var(--bbr-space-lg));
    color: inherit;
}

.bbr-reservation-form.bbr-loading {
    opacity: .72;
    pointer-events: none;
}

.bbr-form-section {
    min-width: 0;
    margin: 0;
    padding: var(--bbr-custom-form-padding, 1.75rem);
}

/* In true theme mode there is no plugin background/color. We retain only a
 * subtle currentColor border when the theme itself does not provide one. */
.bbr-theme-inherit .bbr-form-section {
    border: 1px solid color-mix(in srgb, var(--bbr-brand) 42%, currentColor 10%);
    border-radius: var(--bbr-custom-form-radius, .85rem);
    background: color-mix(in srgb, var(--bbr-brand) 7%, transparent);
    box-shadow: 0 .15rem .65rem rgba(0, 0, 0, .025);
}

.bbr-theme-custom {
    color: var(--bbr-custom-text, #1d2327);
}

.bbr-theme-custom .bbr-form-section {
    border: 1px solid var(--bbr-custom-border, #c1bb9b);
    border-radius: var(--bbr-custom-form-radius, .85rem);
    background: var(--bbr-custom-section-bg, #fbfaf6);
    box-shadow: 0 .15rem .65rem rgba(0, 0, 0, .025);
}

.bbr-form-section legend {
    max-width: 100%;
    margin: 0;
    padding: 0 .45rem;
    font-family: inherit;
    font-size: 1.08em;
    font-weight: 700;
    line-height: 1.3;
}

.bbr-section-intro {
    margin: 0 0 var(--bbr-space-md);
    font-size: .925em;
    opacity: .78;
}

.bbr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--bbr-space-md);
    margin: 0;
}

.bbr-grid + .bbr-grid { margin-top: var(--bbr-space-md); }

.bbr-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--bbr-space-xs);
}

.bbr-field label {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.35;
}

/* Layout only in theme mode. The theme keeps control over appearance. */
.bbr-theme-inherit .bbr-field input:not([type="checkbox"]):not([type="radio"]),
.bbr-theme-inherit .bbr-field textarea,
.bbr-theme-inherit .bbr-field select {
    width: 100%;
    max-width: 100%;
    min-height: 3rem;
    margin: 0;
    padding: .72rem .85rem;
    border-radius: var(--bbr-custom-input-radius, .6rem);
    font-family: inherit;
}

/* Full neutral controls only when theme inheritance is disabled. */
.bbr-theme-custom .bbr-field input:not([type="checkbox"]):not([type="radio"]),
.bbr-theme-custom .bbr-field textarea,
.bbr-theme-custom .bbr-field select {
    appearance: auto;
    width: 100%;
    max-width: 100%;
    min-height: 2.9rem;
    margin: 0;
    padding: .68rem .8rem;
    border: 1px solid var(--bbr-custom-input-border, #b8b18d);
    border-radius: var(--bbr-custom-input-radius, .6rem);
    background-color: var(--bbr-custom-input-bg, #fff);
    color: var(--bbr-custom-input-text, #1d2327);
    font: inherit;
    line-height: 1.35;
    box-shadow: none;
}

.bbr-field textarea {
    min-height: 8rem;
    resize: vertical;
}

.bbr-field input:not([type="checkbox"]):not([type="radio"]):focus-visible,
.bbr-field textarea:focus-visible,
.bbr-field select:focus-visible,
.bbr-checkbox-row input:focus-visible,
.bbr-submit-button:focus-visible {
    outline: 2px solid var(--bbr-custom-accent, #c1bb9b);
    outline-offset: 2px;
}

.bbr-field [aria-invalid="true"] {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

.bbr-field-hint {
    font-size: .875em;
    line-height: 1.4;
    opacity: .75;
}

.bbr-availability-inline-notice,
.bbr-reservation-message {
    margin: 0;
    padding: .8rem 1rem;
    border: 1px solid color-mix(in srgb, var(--bbr-brand) 48%, currentColor 12%);
    border-radius: var(--bbr-custom-input-radius, .6rem);
    background: color-mix(in srgb, var(--bbr-brand) 8%, transparent);
    color: inherit;
    font-size: .925em;
    line-height: 1.5;
    white-space: pre-wrap;
}

.bbr-availability-inline-notice { margin-top: var(--bbr-space-xs); }
.bbr-reservation-message { display: none; margin-bottom: var(--bbr-space-lg); }

.bbr-reservation-message.is-success,
.bbr-reservation-message.is-error,
.bbr-reservation-message.is-info,
.bbr-availability-inline-notice.is-success,
.bbr-availability-inline-notice.is-error,
.bbr-availability-inline-notice.is-info { display: block; }

.bbr-reservation-message.is-success::before,
.bbr-reservation-message.is-error::before,
.bbr-reservation-message.is-info::before,
.bbr-availability-inline-notice.is-success::before,
.bbr-availability-inline-notice.is-error::before,
.bbr-availability-inline-notice.is-info::before {
    display: inline-block;
    margin-inline-end: .45em;
    font-weight: 700;
}

.bbr-reservation-message.is-success::before { content: "✓"; }
.bbr-reservation-message.is-error::before { content: "!"; }
.bbr-reservation-message.is-info::before,
.bbr-availability-inline-notice.is-info::before { content: "i"; }
.bbr-availability-inline-notice.is-error::before { content: "!"; }
.bbr-availability-inline-notice.is-success::before { content: "✓"; }

.bbr-checkbox-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .65rem;
    align-items: start;
    margin: 0;
}

.bbr-checkbox-row input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin: .18rem 0 0;
}

.bbr-theme-custom .bbr-checkbox-row input[type="checkbox"] {
    accent-color: var(--bbr-custom-accent, #2271b1);
}

.bbr-checkbox-row label {
    margin: 0;
    font-family: inherit;
    line-height: 1.45;
}

.bbr-form-footer { display: grid; gap: var(--bbr-space-md); }

.bbr-form-actions {
    display: flex;
    align-items: center;
    gap: var(--bbr-space-sm);
    flex-wrap: wrap;
    margin: 0;
}

.bbr-form-actions .bbr-submit-button {
    width: auto;
    min-height: 3rem;
    margin: 0;
    padding: .78rem 1.25rem;
    border: 1px solid color-mix(in srgb, var(--bbr-brand) 72%, #000 8%);
    border-radius: var(--bbr-custom-button-radius, .65rem);
    background: var(--bbr-custom-button-bg, var(--bbr-brand));
    color: var(--bbr-custom-button-text, var(--bbr-brand-contrast));
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.bbr-form-actions .bbr-submit-button:hover {
    filter: brightness(.96);
    box-shadow: 0 .3rem .75rem rgba(0, 0, 0, .08);
    transform: translateY(-1px);
}

.bbr-theme-custom .bbr-form-actions .bbr-submit-button {
    background: var(--bbr-custom-button-bg, #c1bb9b);
    color: var(--bbr-custom-button-text, #2f2d25);
}

.bbr-submit-disabled,
.bbr-form-actions .bbr-submit-button[disabled] {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}

.bbr-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

@media (max-width: 700px) {
    .bbr-reservation-form-wrapper { padding: 0; border-radius: 0; }
    .bbr-grid { grid-template-columns: 1fr; }
    .bbr-form-section { padding: min(var(--bbr-custom-form-padding, 1.25rem), 1.5rem); }
    .bbr-form-actions,
    .bbr-form-actions .bbr-submit-button { width: 100%; }
    .bbr-form-actions .bbr-submit-button { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .bbr-reservation-form-wrapper *,
    .bbr-reservation-form-wrapper *::before,
    .bbr-reservation-form-wrapper *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* 2.0.0 – Zusammenfassung und Erfolgsansicht */
.bbr-reservation-summary{padding:var(--bbr-custom-form-padding,1.75rem);border:1px solid color-mix(in srgb,var(--bbr-brand) 45%,currentColor 10%);border-radius:var(--bbr-custom-form-radius,.85rem);background:color-mix(in srgb,var(--bbr-brand) 10%,transparent)}
.bbr-reservation-summary>strong{display:block;margin-bottom:.9rem;font-size:1.08em}.bbr-summary-grid,.bbr-success-details{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.8rem}.bbr-summary-grid span,.bbr-success-details span{display:flex;flex-direction:column;gap:.2rem}.bbr-summary-grid small,.bbr-success-details small{opacity:.68}.bbr-success-view{padding:clamp(1.5rem,4vw,3rem);text-align:center;border:1px solid color-mix(in srgb,var(--bbr-brand) 55%,currentColor 8%);border-radius:var(--bbr-custom-form-radius,.85rem);background:color-mix(in srgb,var(--bbr-brand) 10%,transparent)}.bbr-success-icon{width:3.5rem;height:3.5rem;margin:0 auto 1rem;border-radius:50%;display:grid;place-items:center;background:var(--bbr-brand);color:var(--bbr-brand-contrast);font-size:2rem;font-weight:800}.bbr-success-view h3{margin:.4rem 0 .65rem;font-size:clamp(1.35rem,3vw,1.8rem)}.bbr-success-details{margin:1.5rem 0;text-align:left;padding:1rem;border-top:1px solid color-mix(in srgb,var(--bbr-brand) 35%,transparent);border-bottom:1px solid color-mix(in srgb,var(--bbr-brand) 35%,transparent)}.bbr-success-note{margin-bottom:0;opacity:.8}@media(max-width:700px){.bbr-summary-grid,.bbr-success-details{grid-template-columns:1fr 1fr}}
