/* Scope all changes to calendars opted in by this add-on. */
.tpk-colour-calendar td.tpk-good a,
.wc-bookings-date-picker .tpk-colour-calendar td.tpk-good[title] > a,
#wc-bookings-booking-form .wc-bookings-date-picker .tpk-colour-calendar td.tpk-good a {
    background: var(--tpk-green, #15803d) !important;
    color: var(--tpk-green-text, #fff) !important;
}
.tpk-colour-calendar td.tpk-limited a,
.wc-bookings-date-picker .tpk-colour-calendar td.tpk-limited[title] > a,
#wc-bookings-booking-form .wc-bookings-date-picker .tpk-colour-calendar td.tpk-limited a {
    background: var(--tpk-amber, #fbbf24) !important;
    color: var(--tpk-amber-text, #111) !important;
}
/* Bookings returns early for certain sold-out dates, before its JS filter runs. */
.tpk-colour-calendar td.fully_booked:not(.not_bookable_by_rules):not(.not_bookable) {
    opacity: 1 !important;
}
.tpk-colour-calendar td.fully_booked:not(.not_bookable_by_rules):not(.not_bookable) a,
.tpk-colour-calendar td.fully_booked:not(.not_bookable_by_rules):not(.not_bookable) span {
    background: var(--tpk-red, #b91c1c) !important;
    color: var(--tpk-red-text, #fff) !important;
    opacity: 1 !important;
    cursor: not-allowed;
}
.tpk-colour-calendar td.tpk-good a:hover,
.tpk-colour-calendar td.tpk-limited a:hover { filter: brightness(.9); }
.tpk-colour-calendar td a.ui-state-active {
    outline: 3px solid #111 !important;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 4px white !important;
}
.tpk-colour-calendar td a:focus-visible { outline: 3px solid #111; outline-offset: -3px; }
.tpk-colour-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 16px; font-size: 13px; line-height: 1.5; color: inherit; }
.tpk-colour-key > span { display: inline-flex; align-items: center; gap: 6px; }
.tpk-colour-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); }
.tpk-key-good { background: var(--tpk-green, #15803d); }
.tpk-key-limited { background: var(--tpk-amber, #fbbf24); }
.tpk-key-sold { background: var(--tpk-red, #b91c1c); }

/* Missing counts must not inherit Bookings' green bookable-date colour. */
.tpk-colour-calendar td.tpk-unknown a,
.wc-bookings-date-picker .tpk-colour-calendar td.tpk-unknown[title] > a,
#wc-bookings-booking-form .wc-bookings-date-picker .tpk-colour-calendar td.tpk-unknown a {
    background: #e5e7eb !important;
    color: #1f2937 !important;
}

@media (max-width: 600px) {
    .tpk-colour-calendar, .tpk-colour-calendar .ui-datepicker { max-width: 100% !important; width: 100% !important; box-sizing: border-box; }
    .tpk-colour-calendar table { width: 100% !important; table-layout: fixed; }
    .tpk-colour-calendar td > a, .tpk-colour-calendar td > span { box-sizing: border-box; padding: 12px 2px; text-align: center; }
    .tpk-colour-key { gap: 8px 12px; }
}
