/*
 * REZERWACJA OD KALENDARZA (inc/sc-rezerwacja-kalendarz.php, 9.218) — okno usługi kreatora w trybie „kalendarz + osoby obok”.
 * Klasa .sc-rk na #beauty-service-modal (sc-rezerwacja-kalendarz.js), #staff-choose przeniesione do #beauty-calendar-hours
 * między kalendarz a godziny. Kolory wyłącznie z tokenów instancji (--sc-*); warstwy salonów nadpisują jak resztę kreatora.
 */

#beauty-service-modal.sc-rk #beauty-calendar-hours {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
    grid-template-areas: "kal osoby" "godz godz";
    column-gap: 24px;
    row-gap: 24px;
    align-items: start;
}

#beauty-service-modal.sc-rk #beauty-calendar {
    grid-area: kal;
    width: auto;
}

#beauty-service-modal.sc-rk #staff-choose {
    grid-area: osoby;
    min-width: 0;
    padding-bottom: 0;
}

#beauty-service-modal.sc-rk #beauty-available-hours {
    grid-area: godz;
    width: auto;
    padding-left: 0;
    padding-top: 24px;
    border-top: 1px solid var(--sc-other-border-color);
}

/* Usługa telefoniczna / wydarzenie: bez kalendarza — osoby (komunikat telefonu) na całą szerokość. */
#beauty-service-modal.sc-rk.sc-rk-bez-kalendarza #beauty-calendar-hours {
    display: block;
}

#beauty-service-modal.sc-rk #beauty-staff-list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    max-height: 440px;
    overflow-y: auto;
}

#beauty-service-modal.sc-rk .beauty-staff-tile {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas: "foto imie cena" "foto stan cena";
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    padding: 10px 12px;
    text-align: left;
}

#beauty-service-modal.sc-rk .beauty-staff-tile .staff-photo {
    grid-area: foto;
    width: 40px;
    height: 40px;
    object-fit: cover;
}

#beauty-service-modal.sc-rk .beauty-staff-tile strong {
    grid-area: imie;
    padding: 0;
    font-weight: 500;
    line-height: 1.25;
}

#beauty-service-modal.sc-rk .beauty-staff-tile span {
    grid-area: cena;
    width: auto;
    padding: 0;
    border: 0;
    white-space: nowrap;
}

#beauty-service-modal.sc-rk .beauty-staff-tile .sc-rk-stan {
    grid-area: stan;
    font-size: 12px;
    line-height: 1.3;
    opacity: 0.75;
}

#beauty-service-modal.sc-rk .beauty-staff-tile .sc-rk-stan:empty {
    display: none;
}

#beauty-service-modal.sc-rk .beauty-staff-tile.sc-rk-nie-pracuje:not(.active) {
    opacity: 0.55;
}

#beauty-service-modal.sc-rk .beauty-staff-tile.sc-rk-dowolna strong {
    font-weight: 600;
}

#beauty-service-modal.sc-rk .sc-rk-info {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.8;
}

#beauty-service-modal.sc-rk .sc-rk-info[hidden] {
    display: none;
}

@media (max-width: 767px) {
    #beauty-service-modal.sc-rk #beauty-calendar-hours {
        display: flex;
        flex-direction: column;
        align-items: stretch; /* „start” z siatki komputera zwęża bloki do treści, a pasek osób rozpycha okno */
        gap: 20px;
    }

    #beauty-service-modal.sc-rk #beauty-calendar {
        padding-right: 0;
        border-right: 0;
    }

    #beauty-service-modal.sc-rk #beauty-available-hours {
        padding-top: 0;
        border-top: 0;
    }

    /* Telefon: osoby jako przewijany pasek pod kalendarzem. */
    #beauty-service-modal.sc-rk #beauty-staff-list {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 6px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    #beauty-service-modal.sc-rk .beauty-staff-tile {
        grid-template-columns: 32px minmax(0, 1fr);
        grid-template-areas: "foto imie" "foto cena" "foto stan";
        width: 172px;
        scroll-snap-align: start;
    }

    #beauty-service-modal.sc-rk .beauty-staff-tile .staff-photo {
        width: 32px !important;
        height: 32px !important;
    }

    #beauty-service-modal.sc-rk .beauty-staff-tile span {
        margin-left: 0;
        font-size: 13px;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    #beauty-service-modal.sc-rk #beauty-staff-list {
        scroll-behavior: auto;
    }
}
