/*
 * Availability page (website#158): filters, villa cards, calendars and live prices.
 *
 * Each day state has its own look that doesn't rely on colour (WCAG 1.4.1):
 *   arrive  bold number on a light tint (a button)
 *   free    dotted underline
 *   booked  struck through, muted
 *   past    plain grey (also used past the booking window)
 * Text colours are at least 4.5:1 on their background.
 */

.lr-avail {
    --lr-avail-ink: #2f4b54;
    --lr-avail-muted: #6b6b6b;
    --lr-avail-line: #3c5f6a;
    --lr-avail-tint: #e3eff0;
    --lr-avail-tint-hover: #cfe3e5;
    --lr-avail-border: #d9d9d9;
    --lr-avail-focus: #2f4b54;
    --lr-avail-accent: #ff9900;
    --lr-avail-today: #fcb900;
}

/* Anything the scripts hide stays hidden, whatever display a rule below gives it
   (cards are display: grid, which would otherwise override the hidden attribute) */
.lr-avail [hidden],
.lr-avail-dialog [hidden] {
    display: none !important;
}

/* ------------------------------------------------------------------
 * Filters: a search region above the list; on phones the script moves
 * the form into a full-screen dialog
 * ------------------------------------------------------------------ */

/* Without JavaScript the filters can't work: don't show them */
.lr-avail:not(.lr-avail-has-filters) .lr-avail-panel {
    display: none;
}

.lr-avail-panel {
    margin: 0 0 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--lr-avail-border);
    background: #f7f9f9;
}

.lr-avail-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 1rem;
}

.lr-avail-filters-title {
    font-size: 1.1rem;
    margin: 0;
}

.lr-avail-filters-title:focus {
    outline: none;
}

.lr-avail-panel-close {
    display: none;
}

.lr-avail-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem 1.25rem;
    /* every label has room for a hint line, so fields line up from the top; a note under
       a field (Children) then doesn't push it up */
    align-items: start;
}

/* Pool sits level with the other fields' boxes (below a label's height) */
.lr-avail-field-check {
    padding-top: calc(3.4em + 0.3rem);
}

/* Clear filters beside the heading; on phones it's in the panel footer instead */
.lr-avail-panel-head {
    gap: 1rem;
}

.lr-avail-dialog .lr-avail-clear-head {
    display: none;
}

.lr-avail-dialog .lr-avail-field-check {
    padding-top: 0;
}

.lr-avail-field label {
    display: block;
    font-weight: 600;
    margin: 0 0 0.3rem;
}

.lr-avail-hint {
    display: block;
    font-weight: 400;
    font-size: 0.85rem;
    text-transform: none;
    color: var(--lr-avail-muted);
}

/* Direct children only: the date pickers' own month list sits inside the field too */
.lr-avail-field input.lr-avail-date,
.lr-avail-field > select {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    background-color: #fff;
}

.lr-avail-field-check label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    margin: 0;
    cursor: pointer;
}

.lr-avail-field-check input {
    width: 1.4rem;
    height: 1.4rem;
    margin: 0;
}

.lr-avail-clear,
.lr-avail-clear-none,
.lr-avail-relax-button,
.lr-avail-retry,
.lr-avail-cal-toggle {
    background: #fff;
    border: 1px solid var(--lr-avail-line);
    color: var(--lr-avail-ink);
    padding: 0.5rem 1rem;
    min-height: 44px;
    cursor: pointer;
}

.lr-avail-date-note:empty {
    display: none;
}

.lr-avail-date-note {
    margin: 0.75rem 0 0;
}

/* "Show X villas" only matters on phones, where changes wait for it */
.lr-avail .lr-avail-panel-foot {
    display: none;
}

.lr-avail-dialog .lr-avail-clear-foot {
    display: inline-block;
}

.lr-avail-filter-open {
    background: #fff;
    border: 2px solid var(--lr-avail-line);
    color: var(--lr-avail-ink);
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    min-height: 44px;
    cursor: pointer;
}

/* Focus: a dark ring with a gap, visible on the tinted days too */
.lr-avail button:focus-visible,
.lr-avail a:focus-visible,
.lr-avail input:focus-visible,
.lr-avail select:focus-visible,
.lr-avail-dialog button:focus-visible,
.lr-avail-dialog input:focus-visible,
.lr-avail-dialog select:focus-visible,
.lr-avail-count:focus-visible {
    outline: 3px solid var(--lr-avail-focus);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------
 * Count and key: one bar above the list
 * ------------------------------------------------------------------ */

.lr-avail-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    padding: 0.9rem 0 0.5rem;
    border-top: 1px solid var(--lr-avail-border);
}

.lr-avail-count {
    margin: 0;
    font-weight: 600;
}

.lr-avail-count:focus {
    outline: none;
}

.lr-avail-key ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.lr-avail-key li[hidden] {
    display: none;
}

.lr-avail-key li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.lr-avail-key .lr-avail-day {
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    flex: none;
}

.lr-avail-key .lr-avail-day > span {
    font-size: 0.8rem;
}

.lr-avail-help {
    font-size: 0.9rem;
    color: var(--lr-avail-muted);
    margin: 0 0 0.5rem;
}

.lr-avail-help p {
    margin: 0;
}

/* No results: hide the key, offer to drop a filter */
.lr-avail-is-empty .lr-avail-key,
.lr-avail-is-empty .lr-avail-help {
    display: none;
}

.lr-avail-none {
    padding: 1.5rem 0;
}

.lr-avail-none-title {
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.lr-avail .lr-avail-relax {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.lr-avail-relax li {
    margin: 0;
}

/* The page heading (scripts/content/availability-heading.php, #201): a section-sized
   title above the filters, so the results start near the top of the screen. The section
   block centres its headings in a narrower column (.cb-section-block ... > h1); this one
   lines up with the filters, hence the longer selector. */
.cb-section-block .acf-innerblocks-container > h1.wp-block-heading.lr-avail-title {
    max-width: none;
    margin: 0 0 1rem;
    font-size: 1.75rem;
    line-height: 1.25;
    text-align: left;
}

@media (max-width: 767px) {
    .cb-section-block .acf-innerblocks-container > h1.wp-block-heading.lr-avail-title {
        font-size: 1.25rem;
    }
}

/* ------------------------------------------------------------------
 * Villa cards: photo | name, facts, price, button | one month of calendar
 * ------------------------------------------------------------------ */

.lr-avail ul.lr-avail-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lr-avail-villa {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--lr-avail-border);
}

@media (min-width: 768px) {
    .lr-avail-villa {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 1.5rem;
    }

    .lr-avail-cal-wrap {
        grid-column: 1 / -1;
    }
}

/* Card photos (#201): a strip of the property page's leading photos that snaps one
   photo at a time (availability-gallery.js adds all but the first when needed) */
.lr-avail-gallery {
    position: relative;
    align-self: start;
}

.lr-avail-photo {
    display: block;
    border-radius: 4px;
    overflow: hidden;
}

.lr-avail-track {
    display: flex;
    aspect-ratio: 3 / 2;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* a swipe past the last photo doesn't pull the page or go back a page */
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.lr-avail-track::-webkit-scrollbar {
    display: none;
}

.lr-avail-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* A photo's place in the strip until it loads (availability-gallery.js) */
.lr-avail-slide-slot {
    display: block;
    background: var(--lr-avail-tint);
}

/* Phones: a little shorter than desktop, so the list doesn't get much longer */
@media (max-width: 767px) {
    .lr-avail-track {
        aspect-ratio: 16 / 10;
    }
}

.lr-avail-gallery-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--lr-avail-ink);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: opacity 0.15s;
}

.lr-avail-gallery-button[hidden] {
    display: none;
}

.lr-avail-gallery-prev {
    left: 8px;
}

.lr-avail-gallery-prev svg {
    transform: scaleX(-1);
}

.lr-avail-gallery-next {
    right: 8px;
}

.lr-avail-gallery-button:disabled {
    opacity: 0;
    pointer-events: none;
}

/* A mouse: arrows show on hover. Touch screens swipe, so there they're invisible and
   let taps through to the photo, but still show when reached by keyboard */
@media (hover: hover) and (pointer: fine) {
    .lr-avail-gallery-button:not(:disabled) {
        opacity: 0;
    }

    .lr-avail-gallery:hover .lr-avail-gallery-button:not(:disabled),
    .lr-avail-gallery-button:focus-visible:not(:disabled) {
        opacity: 1;
    }
}

@media (hover: none), (pointer: coarse) {
    .lr-avail-gallery-button:not(:focus-visible) {
        opacity: 0;
        pointer-events: none;
    }
}

.lr-avail-gallery-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.8125rem;
    line-height: 1.5;
    pointer-events: none;
}

.lr-avail-gallery-count[hidden] {
    display: none;
}

.lr-avail-villa-title {
    font-size: 1.5rem;
    margin: 0 0 0.25rem;
}

.lr-avail .lr-avail-villa-title a {
    /* the theme underlines heading links with !important */
    text-decoration: none !important;
}

.lr-avail .lr-avail-villa-title a:hover {
    text-decoration: underline;
}

.lr-avail-facts {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
}

/* Taglines vary a lot in length: two lines at most */
.lr-avail-tagline {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lr-avail-next {
    margin: 0 0 0.75rem;
}

.lr-avail-linkbutton {
    background: none;
    border: 0;
    padding: 0;
    color: var(--lr-avail-ink);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* The chosen stay and its price */
.lr-avail-quote:empty {
    display: none;
}

.lr-avail-quote {
    margin: 0 0 0.9rem;
}

.lr-avail-quote p {
    margin: 0;
}

.lr-avail-quote-main.is-unavailable {
    font-weight: 600;
}

.lr-avail-quote .lr-avail-change {
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

.lr-avail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
}

/* Laptops and wider (#201): the photo, whole at 3:2, on the left; on the right the name
   and details, the price or next free arrival with its button beside it, then the
   calendar at the size it was designed for */
@media (min-width: 992px) {
    .lr-avail-villa {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        column-gap: 2rem;
        row-gap: 1rem;
    }

    .lr-avail-gallery {
        grid-row: 1 / span 2;
    }

    .lr-avail-cal-wrap {
        grid-column: 2;
        max-width: 600px;
    }

    /* The line and its buttons share a row, and wrap rather than squeeze */
    .lr-avail-buy {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem 1.25rem;
    }

    .lr-avail-buy .lr-avail-next,
    .lr-avail-buy .lr-avail-quote {
        margin-bottom: 0;
    }

    /* A "why not" note goes under the price and its button, not between them */
    .lr-avail-why {
        flex-basis: 100%;
        order: 1;
    }
}

/* Grid view, laptops and wider (#201): photo on top; two to a row, three from
   1200 px. "Show calendar" opens a one-month calendar inside the card
   (availability-overview.js monthCount). */
@media (min-width: 992px) {
    .lr-avail.lr-avail-grid ul.lr-avail-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2.5rem 1.5rem;
        padding-top: 1.5rem;
    }

    .lr-avail.lr-avail-grid .lr-avail-villa {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        row-gap: 0.75rem;
        padding: 0;
        border-top: 0;
    }

    .lr-avail.lr-avail-grid .lr-avail-gallery {
        grid-row: auto;
    }

    .lr-avail.lr-avail-grid .lr-avail-cal-wrap {
        grid-column: 1;
        max-width: none;
    }

    .lr-avail.lr-avail-grid .lr-avail-villa-title {
        font-size: 1.25rem;
    }

    /* The cards along a row share their photo and text heights (subgrid), so the
       buttons line up at the foot of the text. An opened calendar sits in the row's
       third track: its neighbours' text and buttons stay where they are. Without
       subgrid, cards keep their own height. */
    .lr-avail.lr-avail-grid ul.lr-avail-list {
        align-items: start;
    }

    @supports (grid-template-rows: subgrid) {
        .lr-avail.lr-avail-grid ul.lr-avail-list {
            row-gap: 0;
        }

        .lr-avail.lr-avail-grid .lr-avail-villa {
            grid-row: span 3;
            grid-template-rows: subgrid;
            row-gap: 0.75rem;
            align-self: stretch;
            padding-bottom: 2.5rem;
        }

        /* Each part in its own track, so a card without photos stays in line */
        .lr-avail.lr-avail-grid .lr-avail-gallery {
            grid-row: 1;
        }

        .lr-avail.lr-avail-grid .lr-avail-villa-text {
            grid-row: 2;
            display: flex;
            flex-direction: column;
        }

        .lr-avail.lr-avail-grid .lr-avail-cal-wrap {
            grid-row: 3;
        }

        .lr-avail.lr-avail-grid .lr-avail-buy {
            margin-top: auto;
        }
    }
}

@media (min-width: 1200px) {
    .lr-avail.lr-avail-grid ul.lr-avail-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.lr-avail-skip {
    position: absolute;
    left: -9999px;
}

.lr-avail-skip:focus {
    position: static;
    display: inline-block;
    margin: 0 0 0.5rem;
}

/* Space for the calendar before it loads, so the page doesn't jump much */
.lr-avail-cal:empty {
    min-height: 300px;
}

.lr-avail-cal.is-failed {
    min-height: 0;
}

/* ------------------------------------------------------------------
 * Calendar: one month, arrows beside the month name
 * ------------------------------------------------------------------ */

.lr-avail-cal {
    position: relative;
}

.lr-avail-months {
    display: grid;
    grid-template-columns: repeat(var(--months, 1), minmax(0, 1fr));
    gap: 1.5rem;
    /* a shorter month (past weeks left out) keeps normal row heights */
    align-items: start;
}

.lr-avail-nav {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 0.25rem;
}

.lr-avail-nav button {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid var(--lr-avail-border);
    color: var(--lr-avail-ink);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.lr-avail-nav button:hover:not(:disabled) {
    background: var(--lr-avail-tint);
}

.lr-avail-nav button:disabled {
    color: #b0b0b0;
    cursor: default;
}

table.lr-avail-month {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 2px;
    border: 0;
    margin: 0;
}

.lr-avail-month caption {
    font-weight: 600;
    text-align: left;
    line-height: 40px;
    padding: 0 0 0.25rem 2px;
}

.lr-avail-month th,
.lr-avail-month td {
    border: 0;
    padding: 0;
    text-align: center;
}

.lr-avail-month th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lr-avail-ink);
    padding-bottom: 0.25rem;
}

.lr-avail-month td {
    height: 42px;
}

/* Days (also the key swatches) */
.lr-avail-day {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 42px;
    box-sizing: border-box;
    border-radius: 4px;
}

.lr-avail-day > button,
.lr-avail-day > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1;
}

.lr-avail-day > button {
    cursor: pointer;
}

.lr-avail-day.is-arrive {
    background: var(--lr-avail-tint);
}

.lr-avail-day.is-arrive > button,
.lr-avail-day.is-arrive > span {
    color: var(--lr-avail-ink);
    font-weight: 700;
}

.lr-avail-day.is-arrive > button:hover,
.lr-avail-day.is-depart > button:hover {
    background: var(--lr-avail-tint-hover);
    text-decoration: underline;
}

/* Free days that can't start a stay look like the others (tapping one explains why) */
.lr-avail-day.is-free {
    background: var(--lr-avail-tint);
}

.lr-avail-day.is-free > span,
.lr-avail-day.is-free > button {
    color: var(--lr-avail-ink);
    font-weight: 700;
}

.lr-avail-day.is-booked > span,
.lr-avail-day.is-booked > button {
    color: #666;
    text-decoration: line-through;
}

.lr-avail-day.is-past > span {
    color: #757575;
}

/* (#207) Check-out only: the first night of another booking, which a stay can still
   end on. Split corner to corner: the top-left half available (the morning), the
   bottom-right half white (booked from the afternoon), with a hairline round it so
   the white half shows. Not colour alone: its own shape, the key, and the day's
   label for screen readers (WCAG 1.4.1). */
.lr-avail-day.is-out {
    /* The diagonal drawn as a dark line, at least 3:1 against both halves, so the
       split shows for low-vision guests too (WCAG 1.4.11) */
    background: linear-gradient(135deg,
        var(--lr-avail-tint) calc(50% - 1px),
        var(--lr-avail-line) calc(50% - 1px) calc(50% + 0.5px),
        #fff calc(50% + 0.5px));
    box-shadow: inset 0 0 0 1px var(--lr-avail-border);
}

.lr-avail-day.is-out > span,
.lr-avail-day.is-out > button {
    color: var(--lr-avail-ink);
    font-weight: 700;
}

/* The number on a small white patch, so the line runs behind it rather than through
   it (a line through the number would read as crossed out, i.e. booked). Calendar
   days hold the number in a span[aria-hidden]; the key's sample holds it directly. */
.lr-avail-day.is-out > span > span[aria-hidden="true"],
.lr-avail-day.is-out > button > span[aria-hidden="true"],
.lr-avail-key .lr-avail-day.is-out > span {
    padding: 0 0.2em;
    border-radius: 3px;
    background: #fff;
    line-height: 1.25;
}

/* The key's sample holds the number directly in a full-size span: shrink it to the
   number, centred, so the split shows round it as on the calendar */
.lr-avail-key .lr-avail-day.is-out > span {
    width: auto;
    margin: auto;
}

@media (forced-colors: active) {
    .lr-avail-day.is-out {
        outline: 1px dashed CanvasText;
        outline-offset: -3px;
    }
}

/* Picking a departure: the days that can end the stay */
.lr-avail-day.is-depart {
    background: #fff;
    box-shadow: inset 0 0 0 2px var(--lr-avail-line);
}

.lr-avail-day.is-depart > button {
    font-weight: 700;
    color: var(--lr-avail-ink);
    text-decoration: none;
}

/* The chosen nights */
.lr-avail-day.is-chosen {
    background: var(--lr-avail-accent);
}

.lr-avail-day.is-chosen > button,
.lr-avail-day.is-chosen > span {
    color: #121212;
    font-weight: 700;
    text-decoration: none;
}

.lr-avail-day.is-today > button,
.lr-avail-day.is-today > span {
    box-shadow: inset 0 -4px 0 var(--lr-avail-today);
}

@media (forced-colors: active) {
    .lr-avail-day.is-chosen,
    .lr-avail-day.is-depart {
        outline: 2px solid CanvasText;
    }
}

/* ------------------------------------------------------------------
 * Phones
 * ------------------------------------------------------------------ */

@media (max-width: 767px) {
    .lr-avail-phone .lr-avail-panel {
        display: none;
    }

    /* Filters button and summary; fixed below the header once scrolled past (script) */
    .lr-avail-phonebar {
        z-index: 20;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin: 0 -16px 1rem;
        padding: 0.5rem 16px;
        background: #fff;
        border-bottom: 1px solid var(--lr-avail-border);
    }

    .lr-avail-phonebar[hidden] {
        display: none;
    }

    .lr-avail-phonebar.is-stuck {
        position: fixed;
        top: var(--lr-avail-header, 0px);
        left: 0;
        right: 0;
        margin: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    .lr-avail-summary {
        font-size: 0.9rem;
        color: var(--lr-avail-muted);
    }

    .lr-avail-key ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .lr-avail-villa-title {
        font-size: 1.3rem;
    }
}

/* The phone dialog */
.lr-avail-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
}

.lr-avail-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.lr-avail-dialog .lr-avail-filters {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1rem 16px 0;
    box-sizing: border-box;
}

.lr-avail-dialog .lr-avail-panel-close {
    display: block;
    background: transparent;
    border: 0;
    font-size: 2rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    cursor: pointer;
    color: var(--lr-avail-ink);
}

.lr-avail-dialog .lr-avail-fields {
    grid-template-columns: 1fr 1fr;
}

/* Buttons pinned to the bottom of the panel */
.lr-avail-dialog .lr-avail-panel-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: auto;
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--lr-avail-border);
}

.lr-avail-dialog .lr-avail-apply[aria-disabled="true"] {
    opacity: 0.7;
}

/* The date pickers open inside their field's box (flatpickr "static"), so they work
   inside the phone dialog too */
.lr-avail-filters .flatpickr-wrapper {
    display: block;
}

.lr-avail-filters .flatpickr-calendar.static.open {
    z-index: 50;
}

/* ------------------------------------------------------------------
 * UI review fixes (#158)
 * ------------------------------------------------------------------ */

/* Main card button: solid dark teal; orange (with dark text, 4.5:1+) once it books */
.lr-avail .lr-avail-action {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    background: #3c5f6a;
    border: 2px solid #3c5f6a;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.lr-avail .lr-avail-action:hover {
    background: #2f4b54;
    border-color: #2f4b54;
    color: #fff;
}

.lr-avail .lr-avail-action.is-book {
    background: #ff9900;
    border-color: #ff9900;
    color: #121212;
}

.lr-avail .lr-avail-action.is-book:hover {
    background: #e68a00;
    border-color: #e68a00;
    color: #121212;
}

/* Phone panel buttons: Clear and a full-width dark teal "Show X places" */
.lr-avail-dialog .lr-avail-apply {
    flex: 1;
    min-height: 48px;
    background: #3c5f6a;
    border: 0;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.lr-avail-dialog .lr-avail-apply:hover,
.lr-avail-dialog .lr-avail-apply:focus {
    background: #2f4b54;
    color: #fff;
}

.lr-avail-panel .lr-avail-clear-foot {
    display: none;
}

/* The theme turns focused and hovered buttons near-black: keep our colours, show a ring */
.lr-avail button:hover,
.lr-avail button:focus,
.lr-avail-dialog button:hover,
.lr-avail-dialog button:focus {
    color: inherit;
}

.lr-avail .lr-avail-day > button:focus,
.lr-avail .lr-avail-day > button:hover {
    background: var(--lr-avail-tint-hover);
    color: var(--lr-avail-ink);
}

.lr-avail .lr-avail-day.is-chosen > button:focus,
.lr-avail .lr-avail-day.is-chosen > button:hover {
    background: #e68a00;
    color: #121212;
}

.lr-avail .lr-avail-nav button:focus,
.lr-avail .lr-avail-nav button:hover:not(:disabled) {
    background: var(--lr-avail-tint);
    color: var(--lr-avail-ink);
}

.lr-avail .lr-avail-clear:hover,
.lr-avail .lr-avail-clear:focus,
.lr-avail .lr-avail-clear-none:hover,
.lr-avail .lr-avail-relax-button:hover,
.lr-avail .lr-avail-cal-toggle:hover,
.lr-avail .lr-avail-cal-toggle:focus,
.lr-avail .lr-avail-retry:hover,
.lr-avail-filter-open:hover,
.lr-avail-filter-open:focus {
    background: var(--lr-avail-tint);
    color: var(--lr-avail-ink);
}

/* The departure day: an orange ring, so guests see when they leave */
.lr-avail-day.is-departure {
    box-shadow: inset 0 0 0 3px var(--lr-avail-accent);
}

.lr-avail-day.is-departure > span,
.lr-avail-day.is-departure > button {
    font-weight: 700;
    color: var(--lr-avail-ink);
    text-decoration: none;
}

/* Filter labels line up: every label keeps room for a hint line */
.lr-avail-field > label {
    /* tall enough for the two-line labels (label + hint) */
    min-height: 3.4em;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.lr-avail-field-check > label {
    min-height: 44px;
    flex-direction: row;
    justify-content: flex-start;
}

.lr-avail-field-check input {
    accent-color: #3c5f6a;
}

.lr-avail-field-note {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    color: var(--lr-avail-muted);
}

/* Phone: the check-out picker opens from the right edge of its field, so it stays on screen */
.lr-avail-dialog .lr-avail-field:nth-child(2) .flatpickr-calendar.static {
    left: auto;
    right: 0;
}

/* Skip links appear over the content instead of pushing it down */
.lr-avail-villa {
    position: relative;
}

.lr-avail-skip:focus {
    position: absolute;
    top: 0.25rem;
    left: 0;
    z-index: 5;
    padding: 0.4rem 0.8rem;
    background: #fff;
    border: 2px solid var(--lr-avail-line);
    margin: 0;
}

/* Sort */
.lr-avail-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.lr-avail-sort label {
    font-weight: 600;
}

.lr-avail-sort select {
    min-height: 40px;
}

/* (#201) list or grid, laptops and wider */
.lr-avail-view {
    display: none;
}

@media (min-width: 992px) {
    .lr-avail-view {
        display: inline-flex;
        border: 1px solid var(--lr-avail-line);
    }

    .lr-avail .lr-avail-view button {
        min-height: 40px;
        padding: 0.4rem 0.9rem;
        border: 0;
        background: #fff;
        color: var(--lr-avail-ink);
        cursor: pointer;
    }

    .lr-avail .lr-avail-view button + button {
        border-left: 1px solid var(--lr-avail-line);
    }

    .lr-avail .lr-avail-view button[aria-pressed="true"] {
        background: var(--lr-avail-ink);
        color: #fff;
    }
}

/* (#201) free stays to pick on each card, on a line of their own (the
   buttons follow underneath) */
.lr-avail-buy .lr-avail-next {
    flex-basis: 100%;
}

.lr-avail-next .lr-avail-chips-label {
    margin-right: 0.5rem;
}

.lr-avail-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    vertical-align: middle;
}

.lr-avail .lr-avail-chip {
    min-height: 36px;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--lr-avail-line);
    border-radius: 999px;
    background: #fff;
    color: var(--lr-avail-ink);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.lr-avail .lr-avail-chip:hover {
    background: var(--lr-avail-tint);
}

.lr-avail-chip-price {
    margin-left: 0.4rem;
    font-weight: 600;
}

/* Phones: a thumb-sized target, like the page's other buttons */
@media (max-width: 767px) {
    .lr-avail .lr-avail-chip {
        min-height: 44px;
    }
}

/* (#201) the calendars are folded, so their key goes with an opened calendar
   (availability-overview.js copies it there) instead of sitting above the list */
.lr-avail-bar .lr-avail-key {
    display: none;
}

.lr-avail-cal-key {
    margin-top: 0.75rem;
}

/* (#201) "Showing 18 – 25 Dec for all places." after a card's week is picked */
.lr-avail-picked-note {
    flex-basis: 100%;
    margin: 0;
    font-weight: 600;
}

/* Empty (no week picked): takes no room, but stays in the page as a live region */
.lr-avail-picked-note:empty {
    display: block;
    height: 0;
    overflow: hidden;
}

/* No results */
.lr-avail .lr-avail-relax,
.lr-avail .lr-avail-nearby {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.lr-avail-nearby li {
    margin: 0;
}

.lr-avail-nearby-title {
    font-weight: 600;
    margin: 0.5rem 0;
}

.lr-avail-none-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin: 0;
}

.lr-avail-enquire {
    font-weight: 600;
}

/* The theme underlines links in buttons and capitalises labels */
.lr-avail .lr-avail-action,
.lr-avail .lr-avail-action:hover {
    text-decoration: none !important;
}

.lr-avail-sort label {
    text-transform: none;
}

/* "From" price on each card */
.lr-avail-from {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.lr-avail-from strong {
    font-size: 1.15rem;
}

.lr-avail-from-note {
    font-size: 0.85rem;
    color: var(--lr-avail-muted);
}

/* Sort progress: a small spinner while prices or calendars load */
.lr-avail-sort-status {
    font-size: 0.9rem;
    color: var(--lr-avail-muted);
}

.lr-avail-sort-status.is-busy::before {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.4em;
    vertical-align: -0.1em;
    border: 2px solid var(--lr-avail-tint-hover);
    border-top-color: var(--lr-avail-line);
    border-radius: 50%;
    animation: lr-avail-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .lr-avail-sort-status.is-busy::before {
        animation: none;
    }
}

/* ------------------------------------------------------------------
 * Phone layout pass (#158): labels as written, a proper Filters button,
 * one dividing line, even spacing in the panel
 * ------------------------------------------------------------------ */

.lr-avail-field > label,
.lr-avail-field-check > label {
    text-transform: none;
}

@media (max-width: 767px) {
    /* One slim row (#201): the whole row is the button, what's searched for on the left
       and Filters on the right, in the page's outline style rather than a dark block */
    .lr-avail .lr-avail-filter-open {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        width: 100%;
        min-height: 44px;
        margin: 0;
        padding: 0.45rem 0.5rem 0.45rem 1rem;
        border: 1px solid var(--lr-avail-line);
        border-radius: 999px;
        background: #fff;
        color: var(--lr-avail-ink);
        font-size: 0.95rem;
        text-align: left;
        text-transform: none;
    }

    .lr-avail .lr-avail-filter-open:hover,
    .lr-avail .lr-avail-filter-open:focus {
        background: var(--lr-avail-tint);
        color: var(--lr-avail-ink);
    }

    .lr-avail-filter-open .lr-avail-summary {
        min-width: 0;
        overflow: hidden;
        font-size: inherit;
        font-weight: 600;
        color: inherit;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .lr-avail-filter-label {
        flex: none;
        padding: 0.3rem 0.75rem;
        border-radius: 999px;
        background: var(--lr-avail-ink);
        color: #fff;
        font-size: 0.85rem;
    }

    /* The phone bar already draws the line above the list */
    .lr-avail-phone .lr-avail-bar {
        border-top: 0;
        padding-top: 0;
    }

    .lr-avail-phone .lr-avail-sort {
        width: 100%;
    }

    .lr-avail-phone .lr-avail-sort select {
        flex: 1;
    }
}

/* Panel on phones: even rows */
.lr-avail-dialog .lr-avail-fields {
    gap: 1rem 0.9rem;
}

.lr-avail-dialog .lr-avail-field > label {
    min-height: 0;
}

.lr-avail-dialog .lr-avail-fields {
    align-items: end;
}

.lr-avail-dialog .lr-avail-field-check {
    grid-column: 1 / -1;
}

/* The theme indents lists */
.lr-avail .lr-avail-key ul {
    margin: 0;
    padding: 0;
}

/* "Why not" note after tapping a day that can't be used */
.lr-avail-why {
    margin: 0 0 0.9rem;
    padding: 0.6rem 0.9rem;
    border-left: 4px solid #b00020;
    background: #fdf3f4;
    font-weight: 600;
}

/* Pool: level with the bottom of the other boxes */
.lr-avail-fields > .lr-avail-field-check {
    padding-top: 0;
    align-self: end;
}

/* ------------------------------------------------------------------
 * Polish (#158): dropdown chevrons with room, clear month arrows
 * ------------------------------------------------------------------ */

/* Dropdowns: our own chevron, away from the edge, same in every browser */
.lr-avail-field > select,
.lr-avail-sort select {
    -webkit-appearance: none;
    appearance: none;
    padding: 0 2.6rem 0 0.9rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232f4b54' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 12px 8px;
    cursor: pointer;
}

.lr-avail-sort select {
    min-height: 44px;
    min-width: 15rem;
}

/* Month arrows: round-cornered buttons with a chevron icon */
.lr-avail-nav {
    gap: 0.4rem;
}

.lr-avail .lr-avail-nav button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #b9c7cb;
    border-radius: 4px;
    background: #fff;
}

.lr-avail-nav button::before {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--lr-avail-ink);
    border-bottom: 2px solid var(--lr-avail-ink);
}

.lr-avail-nav .lr-avail-prev::before {
    transform: translateX(2px) rotate(135deg);
}

.lr-avail-nav .lr-avail-later::before {
    transform: translateX(-2px) rotate(-45deg);
}

/* Disabled: still visible, clearly not available */
.lr-avail .lr-avail-nav button:disabled {
    background: #f4f6f6;
    border-color: #dde4e6;
}

.lr-avail-nav button:disabled::before {
    border-color: #a7b1b4;
}

/* ------------------------------------------------------------------
 * "Show the N places free on these dates": after dates are picked in a
 * card the list holds still; this floats at the bottom until tapped
 * ------------------------------------------------------------------ */

/* A card's price on one line (#201): the total, then what's in it in small type */
.lr-avail-quote-total {
    font-size: 1.25rem;
}

.lr-avail-quote-note {
    display: block;
    font-size: 0.85rem;
    color: var(--lr-avail-muted);
}

/* Room at the end of the list, so the floating button doesn't cover the last card */
@media (min-width: 768px) {
    .lr-avail ul.lr-avail-list {
        margin-bottom: 4rem;
    }
}

/* Back up to the filters (#201), tablets and wider */
/* Bottom right, level with the site's back-to-top button (46 px, 25 px from the right,
   75 px from the bottom) and just left of it, so it never covers a card's buttons */
.lr-avail-jump {
    position: fixed;
    right: 83px;
    bottom: 76px;
    z-index: 49;
}

.lr-avail .lr-avail-jump-button {
    padding: 0.65em 1.3em;
    border: 1px solid var(--lr-avail-line);
    border-radius: 999px;
    background: #fff;
    color: var(--lr-avail-ink);
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.lr-avail-refresh {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 50;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
}

.lr-avail-refresh-button {
    display: block;
    padding: 0.75em 1.4em;
    border: 0;
    border-radius: 999px;
    background: var(--lr-avail-line);
    color: #fff;
    font-size: 1rem;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.lr-avail-refresh-button:hover,
.lr-avail-refresh-button:focus-visible {
    filter: brightness(1.1);
}

.lr-avail-refresh-button:focus-visible {
    outline: 3px solid #121212;
    outline-offset: 2px;
}

/* Room under the last card so the button never covers its Book now */
body.lr-avail-has-refresh {
    padding-bottom: 80px;
}

/* (#207) Property page Availability tab: one card without a photo, the "From" price
   and available weeks above the calendar, which takes the tab's full width (two
   months where there's room, as on the availability page) */
.lr-avail--property .lr-avail-villa {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 0;
    border-top: 0;
}

/* The availability page puts the calendar in a card's second column, under the text */
.lr-avail--property .lr-avail-cal-wrap {
    grid-column: 1;
    max-width: none;
}

.lr-avail--property .lr-avail-from {
    margin: 0 0 0.75rem;
}

.lr-avail--property .lr-avail-help p {
    margin: 0;
    color: var(--lr-avail-muted);
    font-size: 0.9rem;
}

/* The chosen available week (property page: the weeks stay with a stay chosen),
   filled like the List/Grid switch's chosen button */
.lr-avail .lr-avail-chip[aria-pressed="true"] {
    background: var(--lr-avail-ink);
    border-color: var(--lr-avail-ink);
    color: #fff;
}

/* A stay picked in the tab's calendar: a short highlight on the booking box's price,
   where the dates went */
.lr-live-price.lr-avail-flash {
    animation: lr-avail-flash 1.4s ease-out;
}

@keyframes lr-avail-flash {
    0%, 30% {
        box-shadow: 0 0 0 3px #ff9900;
    }
    100% {
        box-shadow: 0 0 0 3px transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lr-live-price.lr-avail-flash {
        animation: none;
    }
}

/* (#207) "18 – 25 Dec added to the booking box…" with See price beside it */
.lr-avail--property .lr-avail-quote:not(:empty) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
}

.lr-avail--property .lr-avail-quote .lr-avail-quote-main {
    margin: 0;
}

.lr-avail--property .lr-avail-quote:focus {
    outline: none;
}

/* (#207) See price: a real button, a thumb-sized target (44px), like the site's
   other outlined buttons */
.lr-avail--property .lr-avail-quote .lr-avail-seeprice {
    min-height: 44px;
    padding: 0.4rem 1rem;
    border: 1px solid var(--lr-avail-line);
    background: #fff;
    color: var(--lr-avail-ink);
    text-decoration: none;
}

.lr-avail--property .lr-avail-quote .lr-avail-seeprice:hover,
.lr-avail--property .lr-avail-quote .lr-avail-seeprice:focus-visible {
    background: var(--lr-avail-tint);
}
