/* ==========================================================================
   Booking Widget – Formularz rezerwacji wizyt
   Design system: LepszySen (--ls-* tokens)
   Figma: 5889-14824 (sekcja), 5889-11791 / 5889-11624 (specjalista),
          dark: 5886-5000, 5902-17333, 5902-17160
   ========================================================================== */

.booking {
    /* Tokeny sekcji (light) */
    --booking-bg-start: #f7fcff;
    --booking-bg-end: #d2e5f6;
    --booking-bg-border: #d2e5f6;
    --booking-blob: #d2e5f6;
    --booking-blob-core: #f7fcff;
    --booking-glow: rgba(255, 255, 255, 0.5);
    --booking-card-bg: #ffffff;
    --booking-card-border: #d2e5f6;
    --booking-divider: #f2f2f2;
    --booking-title: #051929;
    --booking-text: rgba(0, 0, 0, 0.6);
    --booking-text-strong: #051929;
    --booking-accent: #032a49;
    --booking-accent-text: #ffffff;
    --booking-soft: #f7fcff;
    --booking-soft-text: #91b4d4;
    --booking-switch-bg: #ffffff;
    --booking-switch-border: #d2e5f6;
    --booking-switch-text: #032a49;
    --booking-select-bg: #ffffff;
    --booking-select-border: #e6e6e6;
    --booking-select-text: #666666;
    --booking-select-icon: #051929;
    --booking-selected-bg: #f7fcff;
    --booking-selected-border: #d2e5f6;
    --booking-selected-text: #051929;
    --booking-selected-muted: #666666;
    --booking-list-border: #d9d9d9;
    --booking-list-head-bg: #f7fcff;
    --booking-list-head-text: #666666;
    --booking-option-bg: #ffffff;
    --booking-option-hover: #f7fcff;
    --booking-option-text: #032a49;
    --booking-option-muted: #666666;
    --booking-option-line: #f2f2f2;
    --booking-ok: #00871d;
    --booking-no: #870000;
    --booking-time-border: #d2e5f6;
    --booking-time-text: #91b4d4;
    --booking-pin: #666666;
    --booking-shadow: 0 5.9px 5.3px rgba(150, 150, 150, 0.03), 0 19.9px 17.9px rgba(150, 150, 150, 0.04), 0 89px 80px rgba(150, 150, 150, 0.07);

    padding: 16px 0;
    position: relative;
    scroll-margin-top: 24px;
}

[data-theme="dark"] .booking {
    --booking-bg-start: #18364d;
    --booking-bg-end: #011d33;
    --booking-bg-border: #032a49;
    --booking-blob: #123756;
    --booking-blob-core: #011d33;
    --booking-glow: rgba(23, 56, 81, 0.5);
    --booking-card-bg: #051929;
    --booking-card-border: #032a49;
    --booking-divider: #5c7184;
    --booking-title: #ffffff;
    --booking-text: #b3b3b3;
    --booking-text-strong: #ffffff;
    --booking-accent: #c2e1ff;
    --booking-accent-text: #032a49;
    --booking-soft: #032a49;
    --booking-soft-text: #91b4d4;
    --booking-switch-bg: #032a49;
    --booking-switch-border: #5c7184;
    --booking-switch-text: rgba(194, 225, 255, 0.5);
    --booking-select-bg: #032a49;
    --booking-select-border: #e6e6e6;
    --booking-select-text: #999999;
    --booking-select-icon: #ffffff;
    --booking-selected-bg: #224d76;
    --booking-selected-border: #5c7184;
    --booking-selected-text: #ffffff;
    --booking-selected-muted: #b3b3b3;
    --booking-list-border: #5c7184;
    --booking-list-head-bg: #c2e1ff;
    --booking-list-head-text: #032a49;
    --booking-option-bg: #032a49;
    --booking-option-hover: #0b3a60;
    --booking-option-text: #ffffff;
    --booking-option-muted: #999999;
    --booking-option-line: rgba(242, 242, 242, 0.25);
    --booking-ok: #54fd78;
    --booking-no: #fd5f5f;
    --booking-time-border: #5c7184;
    --booking-time-text: #91b4d4;
    --booking-pin: #b3b3b3;
    --booking-shadow: 0 6px 6px rgba(0, 0, 0, 0.12), 0 20px 18px rgba(0, 0, 0, 0.16), 0 60px 60px rgba(0, 0, 0, 0.22);
}

/* Figma: sekcja kalendarza ma 16 px marginesu od krawędzi ekranu (jak hero) */
@media (min-width: 1201px) {
    .booking {
        margin-left: -34px;
        margin-right: -34px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .booking {
        margin-left: -16px;
        margin-right: -16px;
    }
}

/* --- Kontener z gradientem (Figma „Napisy białe": 1408×676, pad 50, r16) --- */
.booking__container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 676px;
    padding: 50px;
    border-radius: 16px;
    border: 1px solid var(--booking-bg-border);
    /* Figma: gradient od prawego górnego do lewego dolnego rogu */
    background: linear-gradient(245deg, var(--booking-bg-start) 0%, var(--booking-bg-end) 100%);
    overflow: hidden;
    isolation: isolate;
    transition: background var(--ls-transition), border-color var(--ls-transition);
}

/* --- Dekoracje tła: niebieski gradient, fala, rozmyta elipsa --- */
.booking__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.booking__bg-blob {
    position: absolute;
    left: 3.5%;
    top: -80px;
    width: 761px;
    height: 761px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--booking-blob-core) 0%, var(--booking-blob-core) 25%, var(--booking-blob) 55%, transparent 72%);
    filter: blur(60px);
}

/* Fala z Figmy (FALA 1, obrót 180°, op. 0.5): w jasnym motywie dwie warstwy
   SVG z wbudowanym 0.3 ≈ 0.5; w ciemnym jedna (wariant ciemny jest jaśniejszy). */
.booking__bg-wave {
    position: absolute;
    left: -335px;
    top: -248px;
    width: 1512px;
    height: 1074px;
    transform: rotate(180deg);
    /* URL-e fali (light/dark) podaje motyw w atrybucie style (components/booking.php). */
    background-image: var(--booking-wave-light, none), var(--booking-wave-light, none);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

[data-theme="dark"] .booking__bg-wave {
    background-image: var(--booking-wave-dark, none);
}

.booking__bg-glow {
    position: absolute;
    left: 34%;
    top: -280px;
    width: 1177px;
    height: 1154px;
    border-radius: 50%;
    background: var(--booking-glow);
    filter: blur(80px);
}

/* --- Karta (Figma Calendar: 850×576, r16, border) --- */
.booking__card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 850px;
    background: var(--booking-card-bg);
    border: 1px solid var(--booking-card-border);
    border-radius: 16px;
    transition: background-color var(--ls-transition), border-color var(--ls-transition);
}

/* Nagłówek karty: tytuł + przełącznik typu (pad 10/24, h 68) */
.booking__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--booking-divider);
}

.booking__title {
    margin: 0;
    font-family: var(--ls-font-family);
    font-size: 24px;
    font-weight: 500;
    line-height: 36px;
    letter-spacing: -0.12px;
    color: var(--booking-title);
}

/* --- Przełącznik typu wizyty (Figma: 359×48, pad 4, przyciski 176×40) --- */
.booking__type-switcher {
    display: flex;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--booking-switch-border);
    background: var(--booking-switch-bg);
}

.booking__type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 176px;
    height: 40px;
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--booking-switch-text);
    font-family: var(--ls-font-family);
    font-size: 16px;
    font-weight: 500;
    line-height: 22.4px;
    letter-spacing: 0.32px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.booking__type-btn--active {
    background: var(--booking-accent);
    color: var(--booking-accent-text);
}

.booking__type-btn:not(.booking__type-btn--active):hover {
    background: var(--booking-soft);
    color: var(--booking-title);
}

/* Kroki 2–3: bez przełącznika typu (zmiana typu wymaga powrotu do kroku 1) */
.booking__container:not([data-step="1"]) .booking__type-switcher {
    display: none;
}

/* --- Kroki (widoczność) --- */
.booking__step {
    display: none;
}

.booking__step--active {
    display: block;
}

/* --- Krok 1: kolumna kalendarza (550) + godziny (300) --- */
.booking__picker {
    display: flex;
    align-items: stretch;
}

.booking__calendar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 24px;
}

.booking__cal-title--mobile,
.booking__times-header {
    display: none;
}

/* Miejsce wizyty + „Zobacz na mapie" */
.booking__location {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 32px;
}

.booking__location-text {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    font-family: var(--ls-font-family);
    font-size: 13px;
    font-weight: 500;
    line-height: 18.2px;
    letter-spacing: 0.065px;
    color: var(--booking-text);
}

.booking__nowrap {
    white-space: nowrap;
}

.booking__location-text svg {
    flex-shrink: 0;
    color: var(--booking-pin);
}

.booking__map-link {
    flex-shrink: 0;
    font-family: var(--ls-font-family);
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    letter-spacing: 0.07px;
    color: var(--booking-text-strong);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
}

.booking__map-link:hover {
    opacity: 0.7;
}

.booking__container[data-type="stacjonarnie"] .booking__location--online,
.booking__container[data-type="online"] .booking__location--stationary {
    display: none;
}

/* --- Wybór specjalisty --- */
.booking__specialist {
    position: relative;
    z-index: 5;
}

.booking__specialist-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 10px;
    border: 1px solid var(--booking-select-border);
    border-radius: 10px;
    background: var(--booking-select-bg);
    color: var(--booking-select-text);
    font-family: var(--ls-font-family);
    font-size: 14px;
    font-weight: 500;
    line-height: 19.6px;
    letter-spacing: 0.07px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.booking__specialist-toggle:hover {
    border-color: var(--booking-soft-text);
}

.booking__specialist-toggle:focus-visible,
.booking__specialist-list:focus-visible {
    outline: 2px solid var(--booking-soft-text);
    outline-offset: 2px;
}

.booking__specialist-chevron {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--booking-select-icon);
    transition: transform 0.2s ease;
}

.booking__specialist.is-open .booking__specialist-chevron {
    transform: rotate(180deg);
}

.booking__specialist-value {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.booking__specialist.has-value .booking__specialist-toggle {
    background: var(--booking-selected-bg);
    border-color: var(--booking-selected-border);
    color: var(--booking-selected-text);
}

.booking__specialist-value-photo {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 4px;
    border-radius: 50%;
    object-fit: cover;
}

.booking__specialist-value-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking__specialist-value-text--muted {
    color: var(--booking-selected-muted);
}

.booking__specialist-dot {
    flex-shrink: 0;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
}

.booking__specialist.has-error .booking__specialist-toggle,
.booking__specialist.has-error.is-open .booking__specialist-toggle {
    border-color: #dc3232;
}

.booking__specialist-error {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #dc3232;
}

[data-theme="dark"] .booking__specialist-error {
    color: var(--booking-no);
}

/* Otwarta lista — nachodzi na kalendarz (Figma 5889-11791) */
.booking__specialist-list {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 46px 0 0;
    list-style: none;
    border: 1px solid var(--booking-list-border);
    border-radius: 10px;
    background: var(--booking-option-bg);
    box-shadow: var(--booking-shadow);
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.booking__specialist-list[hidden] {
    display: none;
}

/* Gdy lista jest otwarta, przycisk staje się jej nagłówkiem */
.booking__specialist.is-open .booking__specialist-toggle {
    position: relative;
    z-index: 2;
    border-color: var(--booking-list-border);
    border-radius: 10px 10px 0 0;
    background: var(--booking-list-head-bg);
    color: var(--booking-list-head-text);
}

[data-theme="dark"] .booking__specialist.is-open .booking__specialist-chevron {
    color: var(--booking-list-head-text);
}

/* Nagłówek otwartej listy ma własne tło — cena dziedziczy jego kolor tekstu */
.booking__specialist.is-open .booking__specialist-value-text--muted {
    color: inherit;
    opacity: 0.75;
}

.booking__specialist-option {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 60px;
    padding: 6px 10px;
    background: var(--booking-option-bg);
    border-top: 1px solid var(--booking-option-line);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.booking__specialist-option:first-child {
    border-top: none;
}

.booking__specialist-option.is-active,
.booking__specialist-option:hover:not(.is-unavailable) {
    background: var(--booking-option-hover);
}

.booking__specialist-option[aria-selected="true"] .booking__specialist-name {
    font-weight: 700;
}

.booking__specialist-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--booking-soft);
    color: var(--booking-option-text);
    font-family: 'Gambetta', var(--ls-font-family);
    font-size: 20px;
    font-style: italic;
}

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

.booking__specialist-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.booking__specialist-name {
    font-family: var(--ls-font-family);
    font-size: 14px;
    font-weight: 500;
    line-height: 19.6px;
    letter-spacing: 0.07px;
    color: var(--booking-option-text);
}

.booking__specialist-role {
    font-family: 'Gambetta', var(--ls-font-family);
    font-size: 13px;
    font-style: italic;
    font-weight: 500;
    line-height: 18.2px;
    letter-spacing: 0.26px;
    color: var(--booking-option-text);
}

.booking__specialist-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
    font-family: var(--ls-font-family);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    letter-spacing: 0.24px;
    color: var(--booking-ok);
}

.booking__specialist-status::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

.booking__specialist-option.is-unavailable {
    cursor: not-allowed;
}

.booking__specialist-option.is-unavailable .booking__specialist-photo {
    opacity: 0.5;
}

.booking__specialist-option.is-unavailable .booking__specialist-name,
.booking__specialist-option.is-unavailable .booking__specialist-role {
    color: var(--booking-option-muted);
}

.booking__specialist-option.is-unavailable .booking__specialist-status {
    color: var(--booking-no);
}

/* --- Kalendarz (Figma: 502×307) --- */
.booking__cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.booking__cal-month {
    font-family: var(--ls-font-family);
    font-size: 16px;
    font-weight: 500;
    line-height: 22.4px;
    letter-spacing: 0.32px;
    color: var(--booking-text);
}

[data-theme="dark"] .booking__cal-month {
    color: #ffffff;
}

.booking__cal-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--booking-text);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.booking__cal-arrow--next {
    background: var(--booking-soft);
    color: var(--booking-soft-text);
}

.booking__cal-arrow:hover:not(:disabled) {
    background: var(--booking-accent);
    color: var(--booking-accent-text);
}

.booking__cal-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.booking__cal-weekdays,
.booking__cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: 6px;
}

.booking__cal-weekdays {
    margin-bottom: 6px;
}

.booking__cal-weekday {
    font-family: var(--ls-font-family);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    letter-spacing: 0.24px;
    color: var(--booking-text);
    text-align: center;
    text-transform: uppercase;
}

.booking__cal-grid {
    row-gap: 4px;
}

/* Dzień — Figma: koło 44×44 */
.booking__cal-day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--booking-text);
    font-family: var(--ls-font-family);
    font-size: 16px;
    font-weight: 500;
    line-height: 22.4px;
    letter-spacing: 0.32px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.booking__cal-day--empty,
.booking__cal-day--disabled {
    cursor: default;
    pointer-events: none;
}

.booking__cal-day--disabled {
    opacity: 1;
}

/* Wolne dni: jasne koło + pogrubiona cyfra (Figma) */
.booking__cal-day--available {
    background: var(--booking-soft);
    color: var(--booking-soft-text);
    font-weight: 700;
}

.booking__cal-day--available:not(.booking__cal-day--selected):hover {
    background: var(--booking-card-border);
    color: var(--booking-accent);
}

[data-theme="dark"] .booking__cal-day--available:not(.booking__cal-day--selected):hover {
    background: #0b3a60;
    color: #c2e1ff;
}

/* Dzisiaj: kropka pod cyfrą */
.booking__cal-day--today::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 2px;
    background: currentColor;
}

.booking__cal-day--selected,
.booking__cal-day--selected:hover {
    background: var(--booking-accent);
    color: var(--booking-accent-text);
    font-weight: 700;
}

.booking__cal-day:focus-visible,
.booking__time-btn:focus-visible,
.booking__type-btn:focus-visible,
.booking__cal-arrow:focus-visible {
    outline: 2px solid var(--booking-soft-text);
    outline-offset: 2px;
}

/* --- Strefa czasowa --- */
.booking__timezone {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.booking__timezone-title {
    font-family: var(--ls-font-family);
    font-size: 16px;
    font-weight: 500;
    line-height: 22.4px;
    letter-spacing: 0.32px;
    color: var(--booking-title);
}

.booking__timezone-value {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--ls-font-family);
    font-size: 14px;
    font-weight: 500;
    line-height: 19.6px;
    letter-spacing: 0.07px;
    color: var(--booking-title);
}

.booking__timezone-value svg {
    flex-shrink: 0;
}

/* --- Godziny (Figma Time: 300, pad 16/16/0, border-left) --- */
.booking__times {
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex: 0 0 300px;
    min-height: 0;
    padding: 16px 16px 0;
    border-left: 1px solid var(--booking-divider);
}

.booking__times-label {
    margin: 0;
    font-family: var(--ls-font-family);
    font-size: 16px;
    font-weight: 500;
    line-height: 22.4px;
    letter-spacing: 0.32px;
    color: var(--booking-option-text);
}

[data-theme="dark"] .booking__times-label {
    color: #ffffff;
}

/* Lista przewijana w obrębie wysokości kalendarza */
.booking__times-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 0;
    min-height: 0;
    margin: 0 -4px;
    padding: 4px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--booking-time-border) transparent;
}

.booking__time-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 46px;
    padding: 12px 24px;
    border: 1px solid var(--booking-time-border);
    border-radius: 8px;
    background: transparent;
    color: var(--booking-time-text);
    font-family: var(--ls-font-family);
    font-size: 16px;
    font-weight: 700;
    line-height: 22.4px;
    letter-spacing: 0.32px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.booking__time-btn:hover {
    border-color: var(--booking-accent);
    color: var(--booking-accent);
}

[data-theme="dark"] .booking__time-btn:hover {
    border-color: #91b4d4;
    color: #c2e1ff;
    background: rgba(145, 180, 212, 0.08);
}

.booking__time-btn--selected,
.booking__time-btn--selected:hover,
[data-theme="dark"] .booking__time-btn--selected,
[data-theme="dark"] .booking__time-btn--selected:hover {
    background: var(--booking-accent);
    border-color: var(--booking-accent);
    color: var(--booking-accent-text);
}

/* Przycisk „Dalej" pojawia się po wybraniu godziny */
.booking__times .booking__step-actions {
    display: none;
    padding: 12px 0 16px;
    margin-top: -14px;
}

.booking__container--time-selected .booking__times .booking__step-actions {
    display: flex;
}

.booking__times .booking__next-btn {
    width: 100%;
    justify-content: center;
}

/* --- Przyciski kroków --- */
.booking__step-actions {
    display: flex;
    justify-content: flex-end;
}

.booking__step-actions--split {
    justify-content: space-between;
    margin-top: 28px;
}

.booking__next-btn,
.booking__submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--ls-radius-pill);
    background: var(--booking-accent);
    color: var(--booking-accent-text);
    font-family: var(--ls-font-family);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.32px;
    cursor: pointer;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.booking__next-btn:hover:not(:disabled),
.booking__submit-btn:hover:not(:disabled) {
    background: #04375e;
    box-shadow: 0 4px 16px rgba(3, 42, 73, 0.25);
}

[data-theme="dark"] .booking__next-btn:hover:not(:disabled),
[data-theme="dark"] .booking__submit-btn:hover:not(:disabled) {
    background: #a9d3fa;
    color: #051929;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.booking__next-btn:disabled,
.booking__submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.booking__back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border: 1px solid var(--booking-time-border);
    border-radius: var(--ls-radius-pill);
    background: transparent;
    color: var(--booking-title);
    font-family: var(--ls-font-family);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease;
}

.booking__back-btn:hover {
    border-color: var(--booking-accent);
}

/* --- Kroki 2 i 3 --- */
.booking__step-body {
    padding: 32px 40px 40px;
}

.booking__summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 28px;
    padding: 14px 20px;
    border: 1px solid var(--booking-card-border);
    border-radius: var(--ls-radius-sm);
    background: var(--booking-soft);
}

.booking__summary-item {
    font-size: 15px;
    font-weight: 500;
    color: var(--booking-title);
}

.booking__summary-sep {
    color: var(--booking-soft-text);
    font-size: 15px;
    user-select: none;
}

/* Usługa i cena w osobnym wierszu podsumowania */
.booking__summary-item--line {
    flex-basis: 100%;
}

.booking__form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.booking__field--full {
    grid-column: 1 / -1;
}

.booking__label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--booking-title);
}

.booking__required {
    color: #dc3232;
}

.booking__input,
.booking__textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--booking-select-border);
    border-radius: var(--ls-radius-sm);
    background: var(--booking-card-bg);
    color: var(--booking-title);
    font-family: var(--ls-font-family);
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .booking__input,
[data-theme="dark"] .booking__textarea {
    border-color: #5c7184;
    background: #032a49;
}

.booking__input:focus,
.booking__textarea:focus {
    outline: none;
    border-color: var(--booking-accent);
    box-shadow: 0 0 0 3px rgba(145, 180, 212, 0.25);
}

.booking__textarea {
    min-height: 80px;
    resize: vertical;
}

.booking__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--booking-text);
    cursor: pointer;
}

.booking__checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--booking-accent);
}

/* --- Krok 3: potwierdzenie --- */
.booking__confirmation {
    padding: 24px 0;
    text-align: center;
}

.booking__confirm-icon {
    margin-bottom: 20px;
    color: #46b450;
}

.booking__confirm-icon svg {
    display: inline-block;
}

.booking__confirm-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 500;
    color: var(--booking-title);
}

.booking__confirm-text {
    max-width: 480px;
    margin: 0 auto 32px;
    font-size: 16px;
    color: var(--booking-text);
}

.booking__confirm-details {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 28px;
    border-radius: var(--ls-radius-sm);
    background: var(--booking-soft);
    text-align: left;
}

.booking__confirm-row {
    display: flex;
    gap: 12px;
}

.booking__confirm-label {
    min-width: 96px;
    font-weight: 500;
    color: var(--booking-title);
}

.booking__confirm-value {
    color: var(--booking-text);
}

/* --- Błędy --- */
.booking__error {
    margin: 20px 0 0;
    padding: 12px 16px;
    border: 1px solid #dc3232;
    border-radius: var(--ls-radius-sm);
    background: #fef0f0;
    color: #dc3232;
    font-size: 14px;
}

/* --- WP Override: Prevent block editor styles from breaking layout --- */
.booking *,
.booking *::before,
.booking *::after {
    box-sizing: border-box;
}

.booking button {
    font-family: var(--ls-font-family);
}

/* ==========================================================================
   Responsywność
   ========================================================================== */
@media (max-width: 992px) {
    .booking__container {
        min-height: 0;
        padding: 32px 24px;
    }

    .booking__type-btn {
        min-width: 140px;
    }

    .booking__times {
        flex-basis: 260px;
    }
}

/* ==========================================================================
   Mobile (≤768px): nagłówek w kolumnie + dwuetapowy wybór dnia i godziny.
   Oba panele leżą w tej samej komórce siatki i przesuwają się (translateX).
   ========================================================================== */
@media (max-width: 768px) {
    .booking {
        padding: 24px 0;
    }

    .booking__container {
        padding: 16px;
        border-radius: 16px;
    }

    .booking__bg-blob {
        left: -40%;
        width: 520px;
        height: 520px;
    }

    .booking__bg-wave {
        left: -900px;
        top: -120px;
    }

    .booking__head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }

    .booking__title {
        font-size: 22px;
        line-height: 1.3;
        text-align: center;
    }

    .booking__type-btn {
        flex: 1;
        min-width: 0;
    }

    .booking__location {
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .booking__cal-title--mobile {
        display: block;
        margin: 4px 0 0;
        font-size: 18px;
        font-weight: 600;
        color: var(--booking-title);
        text-align: center;
    }

    .booking__picker {
        display: grid;
        grid-template-columns: 1fr;
        overflow: hidden;
    }

    .booking__picker .booking__calendar,
    .booking__picker .booking__times {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        will-change: transform, opacity;
    }

    .booking__picker .booking__calendar {
        padding: 16px;
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .booking__picker .booking__times {
        padding: 16px;
        border-left: none;
        transform: translateX(40%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .booking__picker--show-times .booking__calendar {
        transform: translateX(-40%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .booking__picker--show-times .booking__times {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .booking__times-header {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .booking__times-back {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        margin-left: -8px;
        padding: 0;
        border: none;
        background: transparent;
        color: var(--booking-title);
        cursor: pointer;
    }

    .booking__times-step-title {
        font-size: 18px;
        font-weight: 600;
        color: var(--booking-title);
    }

    .booking__times {
        gap: 16px;
    }

    /* Na telefonie lista nie przewija się wewnątrz — pełna wysokość */
    .booking__times-list {
        flex: none;
        overflow: visible;
    }

    .booking__time-btn {
        min-height: 52px;
        font-size: 17px;
        border-radius: 12px;
    }

    .booking__times .booking__step-actions {
        margin-top: 0;
        padding: 4px 0 0;
    }

    .booking__cal-day {
        width: 40px;
        height: 40px;
    }

    .booking__cal-arrow {
        width: 44px;
        height: 44px;
    }

    .booking__cal-weekdays,
    .booking__cal-grid {
        column-gap: 2px;
    }

    /* Większy obszar kliknięcia linku do mapy */
    .booking__map-link {
        padding: 10px 0;
        margin: -10px 0;
    }

    .booking__specialist-option {
        gap: 12px;
    }

    .booking__step-body {
        padding: 24px 16px;
    }

    .booking__form-grid {
        grid-template-columns: 1fr;
    }

    .booking__step-actions--split {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .booking__back-btn,
    .booking__next-btn,
    .booking__submit-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    /* Dni zostają 40×40 (cel dotykowy) — mniejsze odstępy w karcie */
    .booking__container {
        padding: 12px;
    }

    .booking__picker .booking__calendar,
    .booking__picker .booking__times {
        padding-left: 12px;
        padding-right: 12px;
    }

    .booking__cal-weekdays,
    .booking__cal-grid {
        column-gap: 0;
    }

    .booking__specialist-status {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .booking__picker .booking__calendar,
    .booking__picker .booking__times {
        transition: none;
    }
}

/* --- Usługa z cennikiem (lista pod wyborem specjalisty, ten sam wygląd) --- */
.booking__service {
    z-index: 4; /* pod otwartą listą specjalistów */
}

.booking__service[hidden] {
    display: none;
}

.booking__service-value-name {
    min-width: 0;
}

.booking__service-value-price {
    flex-shrink: 0;
    overflow: visible;
}

.booking__service-option {
    justify-content: space-between;
    min-height: 52px;
    padding: 10px 14px;
}

.booking__service-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-family: var(--ls-font-family);
    font-size: 14px;
    font-weight: 500;
    line-height: 19.6px;
    letter-spacing: 0.07px;
    color: var(--booking-option-text);
}

.booking__service-option[aria-selected="true"] .booking__service-name {
    font-weight: 700;
}

.booking__service-hint {
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: var(--booking-option-muted);
}

.booking__service-price {
    flex-shrink: 0;
    font-family: var(--ls-font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--booking-option-text);
    white-space: nowrap;
}

/* --- Informacja o płatności w kroku 2 --- */
.booking__pay-note {
    margin: 20px 0 0;
    padding: 12px 16px;
    border-radius: var(--ls-radius-sm);
    background: var(--booking-soft);
    color: var(--booking-text);
    font-size: 14px;
    line-height: 1.5;
}

/* --- Krok 3: stan płatności po powrocie z ING Pay --- */
.booking__confirm-icon--error {
    color: #dc3232;
}

.booking__confirm-icon--wait,
.booking__confirm-icon--clock {
    color: var(--booking-accent);
}

[data-theme="dark"] .booking__confirm-icon--error {
    color: var(--booking-no, #fd5f5f);
}

.booking__spinner {
    animation: booking-spin 0.9s linear infinite;
}

@keyframes booking-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .booking__spinner {
        animation-duration: 2.4s;
    }
}

.booking__confirm-details[hidden] {
    display: none;
}

.booking__confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.booking__confirm-actions:empty {
    display: none;
}

/* --- Krok 2: zgody (Regulamin, wykonanie usługi przed upływem 14 dni) --- */
.booking__consents {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.booking__checkbox-label a {
    color: var(--booking-text-strong);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.booking__legal {
    margin: 0;
    color: var(--booking-text);
    font-size: 12px;
    line-height: 1.5;
}

.booking__legal a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Cennik wizyt — shortcode [ls_cennik] (strona „Cennik", szablon dokumentu motywu) --- */
.ls-cennik {
    overflow-x: auto;
}

.ls-cennik__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 24px;
    color: var(--ls-text-muted, #666666);
}

.ls-cennik__table th {
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(145, 180, 212, 0.6);
    color: var(--ls-text-heading, #051929);
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    text-align: left;
}

.ls-cennik__table td {
    padding: 14px 0;
    border-bottom: 1px solid rgba(145, 180, 212, 0.35);
    vertical-align: top;
}

.ls-cennik__table th + th,
.ls-cennik__table td + td {
    padding-left: 24px;
}

.ls-cennik__name {
    display: block;
    color: var(--ls-text-heading, #051929);
}

.ls-cennik__meta {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    line-height: 21px;
}

.ls-cennik__table .ls-cennik__price {
    text-align: right;
    white-space: nowrap;
}

.ls-cennik__table td.ls-cennik__price {
    color: var(--ls-text-heading, #051929);
    font-weight: 500;
}
