/* Accommodation Booking — frontend styles.
 * Loaded automatically when the block is present (block.json "style").
 *
 * State handling:
 *   - .is-loading on .accommodation-booking-card → show __loading, hide __body
 *   - .resource_book.is-idle (no datepicker date chosen) → show idle text, hide
 *     the active CTA span; vice versa once datepickers report a valid range.
 */

.accommodation-booking-card {
    background: var(--surface, #fff);
    border: 1px solid var(--line, #e4ded2);
    border-radius: var(--radius, 14px);
    margin: 24px 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.accommodation-booking-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line, #e4ded2);
    background: var(--surface2, #f5f1ea);
}

.accommodation-booking-card__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: var(--accent, #9c3a52);
    color: var(--on-accent, #fff);
    border-radius: 8px;
    flex: 0 0 auto;
}

.accommodation-booking-card__title {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    color: var(--ink, #2c2820);
}

.accommodation-booking-card__loading {
    padding: 24px 18px;
    text-align: center;
    color: var(--ink-soft, #564e42);
    font-size: 0.95rem;
    display: none;
}

.accommodation-booking-card.is-loading .accommodation-booking-card__loading {
    display: block;
}

.accommodation-booking-card.is-loading .accommodation-booking-card__body {
    display: none;
}

.accommodation-booking-card__body {
    padding: 18px;
}

.accommodation-booking-card__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 520px) {
    .accommodation-booking-card__fields {
        grid-template-columns: 1fr;
    }
}

.accommodation-booking-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--ink-soft, #564e42);
}

.accommodation-booking-field__label {
    font-weight: 600;
    color: var(--ink, #2c2820);
}

.accommodation-booking-field__label i {
    margin-right: 4px;
    color: var(--accent, #9c3a52);
}

.accommodation-booking-card__body input[type="text"] {
    padding: 10px 12px;
    border: 1px solid var(--line, #d6d2c8);
    border-radius: 6px;
    background: var(--surface, #fff);
    font-size: 0.95rem;
    color: var(--ink, #2c2820);
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.accommodation-booking-card__body input[type="text"]:focus {
    outline: none;
    border-color: var(--accent, #9c3a52);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #9c3a52) 12%, transparent);
}

.accommodation-booking-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    background: var(--accent, #9c3a52);
    color: var(--on-accent, #fff);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 180px;
    text-align: center;
}

.accommodation-booking-card__cta:hover {
    background: var(--accent-hover, #7d2e42);
    color: var(--on-accent, #fff);
}

.accommodation-booking-card__cta .price {
    margin-right: 8px;
    font-weight: 700;
}

.accommodation-booking-card__cta .price:empty {
    display: none;
}

/* Two-state CTA: __cta vs __idle.
 * boende2.js toggles .is-idle when no date range is selected. Only one span
 * is visible at a time. */
.accommodation-booking-card__cta .resource_book__cta,
.accommodation-booking-card__cta .resource_book__idle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.accommodation-booking-card__cta.is-idle .resource_book__cta {
    display: none;
}

.accommodation-booking-card__cta:not(.is-idle) .resource_book__idle {
    display: none;
}

.resource_book__idle {
    flex-direction: column;
    align-items: center;
    gap: 2px !important;
    line-height: 1.2;
}

.resource_book__idle-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.resource_book__idle-sub {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.9;
}

.accommodation-booking-card__warning {
    margin-top: 12px;
    color: var(--no, #b9333e);
    font-size: 0.9rem;
}

.accommodation-booking-card__warning:empty {
    display: none;
}

.accommodation-booking-card__teasers {
    margin-top: 16px;
}

/* "Vill du förlänga din vistelse?" upsell teasers — were unstyled (label/price
 * ran together). Give the title room and turn each option into a real button. */
.booking-teasers__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted, #6b7280);
    margin-bottom: 10px;
}
.booking-teasers__title i {
    color: var(--accent, #9c3a52);
}
.booking-teasers__options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.booking-teaser {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--surface, #fff);
    border: 1px solid var(--line, #e4ded2);
    border-radius: var(--radius-sm, 10px);
    cursor: pointer;
    text-align: left;
    transition: border-color .15s ease, background .15s ease;
}
.booking-teaser:hover {
    border-color: color-mix(in srgb, var(--accent, #9c3a52) 45%, var(--line, #e4ded2));
    background: color-mix(in srgb, var(--accent, #9c3a52) 6%, var(--surface, #fff));
}
.booking-teaser > i {
    color: var(--accent, #9c3a52);
    flex-shrink: 0;
}
.booking-teaser__label {
    flex: 1;
    font-size: 14px;
    color: var(--ink, #1f2328);
}
.booking-teaser__price {
    font-weight: 700;
    color: var(--accent, #9c3a52);
    white-space: nowrap;
}

/* The combined date field + dropdown calendar (window.KabRangeCalendar.dropdown,
 * prefix kabcal) is fully styled by the shared range-calendar.css. It replaces
 * the two original fields (now hidden), so it owns the gap before the Boka
 * button that the old .accommodation-booking-card__fields margin used to give. */
.accommodation-booking-card .kabcal-field {
    margin-bottom: 16px;
    max-width: 420px;   /* a date range needs ~one line — don't stretch the card */
}
/* Extra breathing room above the CTA, and below it before the teasers. */
.accommodation-booking-card__cta {
    margin-top: 4px;
}

/* ── Hero booking ───────────────────────────────────────────────────────────
   view.js lifts the booking card into the theme's full-photo hero glass card
   (.hero__card), so dates + price + Boka sit over the photo beside the
   accommodation name + the scroll-down chevron. */
.kab-hero-booking .hero {
    min-height: 90svh;   /* not quite full — the next section peeks (extra scroll cue) */
}
.kab-hero-booking .hero .accommodation-booking-card {
    margin: 20px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;       /* don't clip the teasers / portalled calendar */
}
/* Badge chips (beds / slopes / restaurant) the cron emits as a wp:group.b-chips.
   Define the row layout HERE (not only in the hero) so the chips form one tidy,
   equal-height, left-aligned row whether or not view.js lifts them into the hero
   card — the page's own .b-chips/.b-chip rules vary by context and were leaving
   them staggered with uneven heights. !important beats the wp:group inline
   style + the theme's centred .b-chips. */
.accommodation-hero-chips {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;                   /* level chips, never staggered */
    justify-content: flex-start !important; /* left-aligned, beats theme's centred .b-chips */
    gap: 8px;
    /* !important: the cron emits the group with an inline style="margin:0", which
       a plain class rule can't beat — without this the chips crowd the title. */
    margin-top: 14px !important;
    margin-bottom: 0;
}
.accommodation-hero-chips .b-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0;                    /* kill any block/inline margin that staggers them */
    box-sizing: border-box;
    line-height: 1.2;
}
/* The accommodation name is the hero title — drop the card's own "Se
   tillgänglighet & boka" header so it isn't a duplicate. */
.kab-hero-booking .hero .accommodation-booking-card__header {
    display: none;
}
.kab-hero-booking .hero .accommodation-booking-card__body {
    padding: 0;
}
.kab-hero-booking .hero .accommodation-booking-card .kabcal-field {
    max-width: none;   /* the hero card is already a sensible width */
}
