/* Table Reservation — kabdalis2 design system (Heavy JS — CSS only).
   All .kabdalis-table-reservation / .table-reservation-* / .booking-widget-modal-*
   class names are JS-locked. view.js adds .tr to the wrapper at runtime to
   activate the kabdalis2 styling — save() output unchanged.

   Modal classes (booking-widget-modal-*) are shared with skischool-booking
   and snowmobile-booking. */

/* Form primitives (.b-input/.b-select/.b-textarea) come from theme widget-frame.css.
   Theme CSS is enqueued to BOTH editor and frontend — no redeclaration needed. */

/* Wrapper — stacks kicker / title / form vertically. save() outputs a flat
   .b-kicker + h2 + .table-reservation-form as direct children of .tr, so a
   simple column layout puts them in the right reading order. */
.kabdalis-table-reservation.tr{
    padding: var(--card-pad);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.table-reservation-title{
    font-family: var(--font-display);
    font-weight: var(--display-w);
    letter-spacing: var(--display-ls);
    font-size: 1.3rem;
    line-height: 1.1;
    margin: 0;
    color: var(--ink);
}
.tr__lead{
    margin: 6px 0 0;
    color: var(--ink-soft);
    line-height: 1.5;
    max-width: 48ch;
    font-size: .92rem;
}

/* Modal scaffold (.booking-widget-modal-*) lives in shared/booking-modal.css */

/* Form */
.table-reservation-form{
    display: flex; flex-direction: column; gap: 13px;
}
.table-reservation-field{ display: flex; flex-direction: column; gap: 6px; }
.table-reservation-label{
    font-family: var(--font-mono);
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
    font-weight: 600;
}
.table-reservation-message{
    padding: 11px 14px; border-radius: var(--radius-sm);
    font-size: .9rem; line-height: 1.45; margin-bottom: 14px;
}
.table-reservation-message:empty{ display: none; }
.table-reservation-message-success{ background: var(--ok-bg); color: var(--ok); }
.table-reservation-message-error{ background: var(--no-bg); color: var(--no); }

/* Form controls (contact fields, time/restaurant selects, comment textarea).
   The view.js emits these classes; base styling lives here (previously only the
   skischool/snowmobile blocks defined them, so the modal inputs were unstyled
   on a table-reservation-only page). */
.kabdalis-table-reservation .table-reservation-input,
.kabdalis-table-reservation .table-reservation-select{
    width: 100%; height: 46px; padding: 0 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    font: inherit; font-size: .94rem;
    transition: border-color .15s, box-shadow .15s;
}
.kabdalis-table-reservation .table-reservation-input:focus,
.kabdalis-table-reservation .table-reservation-select:focus{
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* The chevron/appearance recipe lives in shared/kab-ui.css; keep room for it. */
.kabdalis-table-reservation select.table-reservation-select{ padding-right: 38px; }
.kabdalis-table-reservation .table-reservation-textarea{
    width: 100%; padding: 11px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    font: inherit; font-size: .94rem; resize: vertical;
    transition: border-color .15s, box-shadow .15s;
}
.kabdalis-table-reservation .table-reservation-textarea:focus{
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.kabdalis-table-reservation .required-indicator{ color: var(--no); }
.kabdalis-table-reservation .field-error{
    border-color: var(--no) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--no) 16%, transparent) !important;
}

/* .field-error-message + .is-invalid live in shared/booking-modal.css */
.table-reservation-input.is-invalid,
.table-reservation-select.is-invalid{
    border-color: var(--no);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--no) 16%, transparent);
}

/* Guest count widget (+/-) */
.table-reservation-guest-btn{
    width: 34px; height: 34px; border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.table-reservation-guest-btn:hover{ border-color: var(--accent); color: var(--accent); }
.table-reservation-guest-count{
    font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700;
    min-width: 28px; text-align: center;
}

/* Date display + calendar */
.table-reservation-date-display{
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface); cursor: pointer;
    transition: border-color .15s ease;
}
.table-reservation-date-display:hover{ border-color: var(--accent); }
.table-reservation-date-text{ color: var(--ink); }

.table-reservation-calendar-overlay{
    position: absolute; inset: 0; z-index: 2;
    display: none; background: var(--surface);
}
.table-reservation-calendar-overlay.is-open{ display: block; }
.table-reservation-calendar-dialog{
    padding: 18px;
    display: flex; flex-direction: column; gap: 12px;
}
.table-reservation-calendar-month{
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 600; color: var(--ink);
}
.table-reservation-calendar-prev,
.table-reservation-calendar-next{
    width: 32px; height: 32px; border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    display: grid; place-items: center; cursor: pointer;
}
.table-reservation-calendar-prev:hover,
.table-reservation-calendar-next:hover{ border-color: var(--accent); color: var(--accent); }
.table-reservation-calendar-grid{
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.table-reservation-calendar-day{
    aspect-ratio: 1 / 1;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    background: transparent; border: 1px solid transparent;
    font-family: var(--font-mono); font-size: .82rem;
    color: var(--ink); cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.table-reservation-calendar-day:not(.table-reservation-calendar-day-past):not(.table-reservation-calendar-day-disabled):hover{
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.table-reservation-calendar-day-past,
.table-reservation-calendar-day-disabled{
    color: var(--muted); opacity: .55; cursor: not-allowed;
}
.table-reservation-calendar-day.is-selected{
    background: var(--accent); color: var(--on-accent);
    border-color: var(--accent);
}

/* "No available dates" empty state — rendered by view.js when the booking
   calendar has no open slots for the current period. Friendlier than the
   old one-line "Inga tillgängliga datum" string. */
.table-reservation-no-availability{
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid var(--line);
}
.table-reservation-no-availability-icon{
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-size: 1rem;
}
.table-reservation-no-availability-text{
    flex: 1 1 auto;
    min-width: 0;
}
.table-reservation-no-availability-title{
    font-family: var(--font-display);
    font-weight: var(--display-w);
    font-size: 1rem;
    line-height: 1.25;
    color: var(--ink);
}
.table-reservation-no-availability-body{
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-size: .88rem;
    line-height: 1.5;
}

/* Contact info-box — "Har du frågor? · phone · email". Lays out icons + text
   on a single line with comfortable spacing; wraps gracefully on narrow
   columns (the 30%-sidebar case that broke the opening-hours date earlier). */
.booking-widget-info-box{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    font-size: .88rem;
    color: var(--ink-soft);
    line-height: 1.4;
}
.booking-widget-info-text{
    color: var(--ink);
    font-weight: 600;
    flex: 0 0 auto;
}
.booking-widget-info-link{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: color .15s ease;
}
.booking-widget-info-link:hover{ color: var(--ink); }
.booking-widget-info-link i{
    font-size: .85rem;
    line-height: 1;
}
.booking-widget-info-separator{
    color: var(--muted);
    font-size: .8rem;
    user-select: none;
}

/* Loader */
.table-reservation-loader{
    position: absolute; inset: 0; z-index: 3;
    display: none;
    align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.table-reservation-loader.is-loading{ display: flex; }
/* .tr-spin lives in shared/booking-modal.css; rotation keyframe (b-spin) in the theme's widget-frame.css */
