/* BuchungsKalender Frontend Styles */
.bk-wrap {
    max-width: 1100px;
    margin: 1.5rem auto;
    font-family: inherit;
}

.bk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: center;
    margin: 0 0 1rem;
    font-size: .95rem;
}

.bk-legend .lg {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.bk-legend i {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: .2rem;
    border: 1px solid rgba(0,0,0,.18);
    overflow: hidden;
}

.bk-legend .lg-arrival i,
.bk-legend .lg-departure i,
.bk-legend .lg-arrival-departure i {
    background: #fff;
    position: relative;
}

.bk-legend .lg-arrival i::before,
.bk-legend .lg-departure i::before,
.bk-legend .lg-arrival-departure i::before,
.bk-legend .lg-arrival-departure i::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #d97171;
}

/* Anreise: rote Hälfte von rechts oben nach links unten */
.bk-legend .lg-arrival i::before {
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* Abreise: rote Hälfte von links unten nach rechts oben */
.bk-legend .lg-departure i::before {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.bk-legend .lg-arrival-departure i::before {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.bk-legend .lg-arrival-departure i::after {
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.bk-legend .lg-available i { background: #dff3df; }
.bk-legend .lg-booked i { background: #f5c6c6; }

.bk-apartments {
    display: grid;
    gap: 2rem;
}

.bk-apartment-section {
    margin-bottom: 2rem;
}

.bk-apartment-title {
    margin: 0 0 .75rem;
    font-size: 1.35rem;
}

.bk-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: .75rem 0 1rem;
}

.bk-nav a {
    text-decoration: none;
}

.bk-multi {
    display: grid;
    gap: 1rem;
}

.bk-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bk-month {
    border: 1px solid rgba(0,0,0,.16);
    border-radius: .35rem;
    overflow: hidden;
    background: #fff;
}

.bk-month-header {
    padding: .65rem .75rem;
    font-weight: 700;
    text-align: center;
    background: rgba(0,0,0,.055);
}

.bk-grid,
.bk-weekdays,
.bk-weeks,
.bk-week {
    width: 100%;
}

.bk-weekdays,
.bk-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.bk-cell {
    min-height: 2.4rem;
    border-right: 1px solid rgba(0,0,0,.08);
    border-bottom: 1px solid rgba(0,0,0,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.bk-cell:nth-child(7n) {
    border-right: 0;
}

.bk-cell.head {
    min-height: 2rem;
    font-size: .8rem;
    font-weight: 700;
    background: rgba(0,0,0,.035);
}

.bk-cell.empty {
    background: rgba(0,0,0,.025);
}

.bk-cell.day.available {
    background: #dff3df;
}

.bk-cell.day.booked {
    background: #f5c6c6;
}

.bk-cell.day.arrival,
.bk-cell.day.departure,
.bk-cell.day.arrival-departure {
    background: #fff;
}

.bk-cell.day.arrival::before,
.bk-cell.day.departure::before,
.bk-cell.day.arrival-departure::before,
.bk-cell.day.arrival-departure::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #d97171;
    z-index: 0;
}

/* Anreise: rote Hälfte von rechts oben nach links unten */
.bk-cell.day.arrival::before {
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* Abreise: rote Hälfte von links unten nach rechts oben */
.bk-cell.day.departure::before {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* An-/Abreise am selben Tag */
.bk-cell.day.arrival-departure::before {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.bk-cell.day.arrival-departure::after {
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.bk-cell.day.past {
    filter: grayscale(55%);
    opacity: .78;
}

.bk-cell.day.past .num {
    color: rgba(0,0,0,.85);
}

.bk-cell .num {
    position: relative;
    z-index: 1;
}

.bk-cell.today .num {
    outline: 2px solid currentColor;
    border-radius: 999px;
    padding: .1rem .38rem;
}

@media (max-width: 900px) {
    .bk-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .bk-cols-3 {
        grid-template-columns: 1fr;
    }

    .bk-cell {
        min-height: 2rem;
        font-size: .9rem;
    }

    .bk-nav {
        flex-direction: column;
    }
}
