/* Catalogo [hasset_book_alloggi] e scheda [hasset_book_alloggio]: stesso aspetto della barra e delle
   card del widget di prenotazione (widget/widget.js di HAsset-Book, classi .hassetbk-*). Font e colori
   da hasset-book.css (:root, Manrope). Caricato solo sulle pagine Alloggi e scheda. */

.hba {
    font-family: var(--hb-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--hb-text);
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}
.hba *, .hba *::before, .hba *::after { box-sizing: border-box; }
.hba a { text-decoration: none; }
.hba [hidden] { display: none !important; }

/* Focus: i temi a blocchi di WordPress mettono un riquadro di 2px del colore del testo su ogni
   elemento cliccato (:focus). Col mouse niente riquadro; con la tastiera il bordino blu. */
.hba :focus:not(:focus-visible),
.hba-lb :focus:not(:focus-visible) { outline: none; }
.hba :focus-visible,
.hba-lb :focus-visible { outline: 2px solid var(--hb-acc); outline-offset: 2px; }

/* ── Pulsanti ── */
.hba-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font: inherit;
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, transform .08s;
}
.hba-btn-primary { background: var(--hb-acc); color: #fff; }
.hba-btn-primary:hover, .hba-btn-primary:focus { background: var(--hb-acc-d); color: #fff; }
.hba-btn-primary:active { transform: scale(.98); }
.hba-btn-outline { background: transparent; color: var(--hb-acc); border-color: var(--hb-acc); font-size: .88rem; font-weight: 600; padding: .6rem .9rem; }
.hba-btn-outline:hover, .hba-btn-outline:focus { background: var(--hb-acc-l); color: var(--hb-acc); }

/* ── Barra date/persone (come .hassetbk-cerca-box) ── */
.hba-cerca {
    container-type: inline-size;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 1.25rem;
    padding: 1rem .9rem .85rem;
    background: #fff;
    border: 1px solid var(--hb-bdr);
    border-radius: var(--hb-radius);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.hba-cerca-riga { display: flex; flex-direction: column; gap: .7rem; }
.hba-date-col { min-width: 0; }
.hba-date-row { display: flex; gap: 1rem; cursor: pointer; }
.hba-date-row:focus-visible { outline: 2px solid var(--hb-acc); outline-offset: 4px; border-radius: 6px; }
.hba-date-blk { position: relative; flex: 1; min-width: 0; }
.hba-date-k { display: block; font-size: .8rem; font-weight: 500; color: #676b71; margin-bottom: .2rem; }
.hba-date-main { display: flex; align-items: center; gap: .45rem; white-space: nowrap; min-height: 2.15rem; }
.hba-date-n { font-size: 2.35rem; font-weight: 700; line-height: .9; color: #1a1d21; }
.hba-date-s { font-size: .72rem; line-height: 1.25; font-weight: 500; color: #1a1d21; }
.hba-date-notti { text-align: right; font-size: .78rem; font-weight: 500; color: #9aa1ab; margin: .15rem 0 0; min-height: 1.2em; cursor: pointer; }
.hba-date-semplici { display: none; gap: 1rem; }
.hba-date-semplici label { flex: 1; min-width: 0; }
.hba-date-semplici input { width: 100%; padding: .55rem .6rem; border: 1px solid var(--hb-bdr-strong); border-radius: 8px; font: inherit; font-size: .9rem; color: var(--hb-text); background: #fff; }
.hba-cerca--semplice .hba-date-row,
.hba-cerca--semplice .hba-date-notti { display: none; }
.hba-cerca--semplice .hba-date-semplici { display: flex; }

.hba-ospiti-col { min-width: 0; }
.hba-ospiti-box { display: flex; flex-direction: row; border: 1px solid var(--hb-bdr); border-radius: 10px; overflow: hidden; background: #fff; }
.hba-box-solo { display: inline-flex; width: auto; }
.hba-ospiti { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: .55rem .65rem; flex: 1; min-width: 0; }
.hba-box-solo .hba-ospiti { flex-direction: row; align-items: center; gap: .75rem; padding: .55rem .75rem; flex: 0 0 auto; }
.hba-ospiti-sep { border-left: 1px solid #eef0f3; }
.hba-ospiti-k { font-size: .92rem; font-weight: 600; color: #1a1d21; white-space: nowrap; }
.hba-ospiti-sub { display: block; font-size: .72rem; font-weight: 500; color: #676b71; line-height: 1.2; }
.hba-step { display: inline-flex; align-items: center; border: 1px solid #e6e8ee; border-radius: 999px; padding: 2px; background: #fff; }
.hba-step-btn { width: 22px; height: 22px; flex: 0 0 22px; border: 0; border-radius: 50%; background: #f2f3f5; color: #1a1d21; font-size: .95rem; line-height: 1; padding: 0; cursor: pointer; }
.hba-step-btn:hover { background: #e6e8ee; }
.hba-step-n { min-width: 1.05rem; padding: 0 .15rem; text-align: center; font-weight: 600; font-size: .9rem; line-height: 1; color: #1a1d21; }
.hba-cerca-go { width: 100%; height: 48px; border-radius: 10px; font-size: .95rem; }
.hba-cerca-err { color: #991b1b; font-size: .85rem; }
.hba-cerca-err:empty { display: none; }

/* Barra fissa="si" attaccata in alto (come .hassetbk-cerca-box in position:fixed): posizione e
   larghezza le mette lo script; chiusa mostra solo le date; scorrendo in giù sparisce. */
.hba-cerca.is-attaccata {
    position: fixed;
    z-index: 1000;
    margin: 0;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .08);
}
.hba-cerca.is-chiusa .hba-ospiti-col,
.hba-cerca.is-chiusa .hba-cerca-go,
.hba-cerca.is-chiusa .hba-cerca-err { display: none; }
.hba-cerca.is-via { visibility: hidden; pointer-events: none; }

@container (min-width: 28rem) {
    .hba-ospiti { flex-direction: row; align-items: center; justify-content: space-between; gap: .5rem; }
}
@container (min-width: 46rem) {
    .hba-cerca-riga {
        display: grid;
        grid-template-columns: auto auto max-content;
        justify-content: center;
        align-items: start;
        column-gap: 1.25rem;
        width: max-content;
        max-width: 100%;
        margin: 0 auto;
    }
    .hba-date-blk { flex: 0 0 auto; min-width: 7.5rem; }
    .hba-date-notti { white-space: nowrap; }
    .hba-cerca-go { width: 11.5rem; padding: 0 1.4rem; }
}

/* ── Griglia e card (come .hassetbk-rooms-grid / .hassetbk-room-card) ── */
.hba-catalogo-link { margin: -.5rem 0 1rem; font-size: .88rem; }
.hba-catalogo-link a { color: var(--hb-acc); font-weight: 600; }
.hba-catalogo-link a:hover { text-decoration: underline; }
.hba-vuoto { margin: 0 0 1rem; color: var(--hb-muted); }

.hba-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--hba-col, 16rem)), 1fr));
    gap: 1rem;
    min-width: 0;
}
.hba-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--hb-bdr);
    border-radius: var(--hb-radius);
    transition: border-color .15s, box-shadow .15s;
}
.hba-card:not(.is-off):hover { border-color: var(--hb-bdr-strong); box-shadow: 0 6px 18px rgba(16, 24, 40, .08); }
.hba-card.is-off .hba-foto, .hba-card.is-off .hba-img-ph { opacity: .45; }
.hba-foto { position: relative; }
.hba-img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; background: var(--hb-bg); }
.hba-img-ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--hb-bg); color: #cbd5e1; font-size: 2.5rem; }
.hba-foto-n { position: absolute; right: .55rem; bottom: .55rem; padding: .2rem .55rem; border-radius: 99px; background: rgba(17, 24, 39, .7); color: #fff; font-size: .72rem; font-weight: 600; }
.hba-card-body { flex: 1; display: flex; flex-direction: column; gap: .55rem; padding: 1rem 1.1rem; }
.hba-card-title { margin: 0; font-size: 1.02rem; font-weight: 700; letter-spacing: .01em; line-height: 1.3; color: #1d2327; }
.hba-card-desc { margin: 0; font-size: .82rem; color: #383b3f; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hba-card-periodo { margin: 0; font-size: .82rem; font-weight: 600; color: #166534; }
.hba-tag-off { align-self: flex-start; padding: .15rem .5rem; border-radius: 8px; background: #f1f2f4; color: #50575e; font-size: .72rem; font-weight: 600; }
.hba-card-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
    margin: auto -1.1rem -1rem;
    padding: .9rem 1.1rem;
    border-top: 1px solid #eef0f3;
}
.hba-azioni { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.hba-card .hba-azioni .hba-btn { flex: 1 1 auto; }
.hba-price { display: block; font-size: 1.15rem; font-weight: 700; color: #1d2327; line-height: 1.2; }
.hba-price-sub { display: block; font-size: .75rem; color: var(--hb-muted); }

/* Riga caratteristiche (come .hassetbk-scheda) */
.hba-riga { display: flex; flex-wrap: wrap; align-items: center; column-gap: 1rem; row-gap: .35rem; font-size: .78rem; color: #334155; }
.hba-riga-gruppo { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; }
.hba-riga-voce { display: inline-flex; align-items: center; gap: .28rem; }
.hba-riga-voce .bi { font-size: .72rem; line-height: 1; }

.hba-posizione { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; font-size: .8rem; color: #383b3f; }
.hba-posizione-testo { display: inline-flex; align-items: center; gap: .3rem; }
.hba-posizione-mappa { color: var(--hb-acc); font-weight: 600; }

.hba-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem; margin: 1.25rem 0 0; }
.hba-pager-stato { font-size: .85rem; color: var(--hb-muted); }

.hba-altri { margin: 1.5rem 0 0; }
.hba-altri-titolo { cursor: pointer; font-weight: 700; color: var(--hb-text); }
.hba-altri-nota { margin: .5rem 0 1rem; font-size: .85rem; color: var(--hb-muted); }

/* ── Scheda ── */
.hba-scheda-foto { margin: 0 0 1.25rem; }
.hba-zoom { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; line-height: 0; cursor: zoom-in; }
.hba-zoom picture { display: block; }
.hba-zoom:focus-visible { outline: 2px solid var(--hb-acc); outline-offset: 2px; border-radius: var(--hb-radius); }
.hba-scheda-cover { aspect-ratio: 16 / 9; border-radius: var(--hb-radius); }
.hba-zoom > .hba-img-ph, .hba-scheda-foto > .hba-img-ph { aspect-ratio: 16 / 9; border-radius: var(--hb-radius); line-height: 1; }
.hba-zoom .hba-foto-n { line-height: 1.2; }
.hba-scheda-galleria { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .5rem; margin-top: .5rem; }
.hba-scheda-thumb { border-radius: 10px; }

/* Galleria a tutto schermo (come #hassetbk-lb-overlay del widget) */
html.hba-lb-aperta, html.hba-lb-aperta body { overflow: hidden; }
.hba-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    background: rgba(29, 35, 39, .92);
    font-family: var(--hb-font);
    overscroll-behavior: none;
    animation: hba-lb-in .15s ease;
}
@keyframes hba-lb-in { from { opacity: 0; } to { opacity: 1; } }
.hba-lb-foto { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; cursor: zoom-out; touch-action: none; }
.hba-lb-foto img { position: absolute; inset: 0; margin: auto; max-width: 95%; max-height: 95%; width: auto; height: auto; object-fit: contain; cursor: grab; user-select: none; -webkit-user-drag: none; }
.hba-lb-nav { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.hba-lb-nav:hover { background: rgba(0, 0, 0, .7); }
.hba-lb-prec { left: 1rem; }
.hba-lb-succ { right: 1rem; }
.hba-lb-chiudi { position: absolute; top: 1rem; right: 1.25rem; z-index: 4; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 2.2rem; line-height: 1; opacity: .85; cursor: pointer; }
.hba-lb-chiudi:hover { opacity: 1; }
.hba-lb-miniature { flex: 0 0 auto; display: flex; gap: .4rem; overflow-x: auto; padding: .55rem .75rem; background: #fff; }
.hba-lb-mini { flex: 0 0 auto; padding: 0; border: 1.5px solid transparent; border-radius: 6px; overflow: hidden; background: none; line-height: 0; cursor: pointer; }
.hba-lb-mini img { display: block; width: auto; height: 64px; object-fit: cover; pointer-events: none; }
.hba-lb-mini.is-on { border-color: #6d6f73; }
.hba-scheda-corpo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.hba-scheda-testo { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.hba-scheda-titolo { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.25; color: #1d2327; }
.hba-scheda .hba-riga { font-size: .85rem; }
.hba-scheda-lead { margin: 0; font-size: 1rem; font-weight: 500; color: #383b3f; }
.hba-scheda-descrizione { font-size: .92rem; color: #383b3f; }

.hba-prenota {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1.1rem;
    background: #fff;
    border: 1px solid var(--hb-bdr);
    border-radius: var(--hb-radius);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.hba-prenota-titolo { margin: 0; font-size: 1.02rem; font-weight: 700; color: #1d2327; }
.hba-prenota .hba-ospiti-box { align-self: stretch; }
.hba-prenota .hba-box-solo { align-self: flex-start; }
.hba-prenota-azioni { justify-content: stretch; }
.hba-prenota-azioni .hba-btn { flex: 1; }

@media (min-width: 900px) {
    .hba-scheda-corpo { grid-template-columns: minmax(0, 1fr) 21rem; }
    .hba-prenota { position: sticky; top: 1rem; }
    .admin-bar .hba-prenota { top: calc(32px + 1rem); }
}

/* Calendario della scheda */
.hba-cal-testa { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.hba-cal-titolo { flex: 1; text-align: center; font-size: .95rem; font-weight: 600; color: #1d2327; }
.hba-cal-nav { width: 32px; height: 32px; padding: 0; border: 1px solid var(--hb-bdr); border-radius: 8px; background: #fff; color: #1d2327; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.hba-cal-nav:hover:not(:disabled) { background: var(--hb-bg); }
.hba-cal-nav:disabled { opacity: .35; cursor: default; }
.hba-cal-griglia { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.hba-cal-sett { padding: 4px 0; text-align: center; font-size: .65rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--hb-muted); }
.hba-day {
    aspect-ratio: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #1d2327;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}
.hba-day:hover:not(:disabled) { background: var(--hb-acc-l); color: var(--hb-acc-d); }
.hba-day:disabled { cursor: default; color: #a7aaad; font-weight: 500; }
.hba-day.is-load { color: #cbd5e1; }
.hba-day.is-occ { background: #f6f7f9; color: #a7aaad; text-decoration: line-through; }
.hba-day.is-occ.is-out { color: #1d2327; text-decoration: none; }
.hba-day.is-in { background: var(--hb-acc-l); color: var(--hb-acc-d); border-radius: 0; }
.hba-day.is-start, .hba-day.is-end { background: var(--hb-acc); color: #fff; text-decoration: none; }
.hba-day.is-start:hover, .hba-day.is-end:hover { background: var(--hb-acc-d); color: #fff; }
.hba-cal-legenda { display: flex; gap: 1rem; font-size: .75rem; color: var(--hb-muted); }
.hba-leg { display: inline-flex; align-items: center; gap: .35rem; }
.hba-leg-box { width: .85rem; height: .85rem; border-radius: 3px; border: 1px solid var(--hb-bdr); background: #fff; }
.hba-leg-box.is-occ { background: #f6f7f9; }
.hba-cal-nota { margin: 0; min-height: 1.3em; font-size: .85rem; font-weight: 500; color: #383b3f; }

.hba-prezzo { display: flex; flex-direction: column; gap: .1rem; padding: .75rem .85rem; border-radius: 10px; background: var(--hb-bg); }
.hba-prezzo-k { font-size: .75rem; font-weight: 600; color: var(--hb-muted); }
.hba-prezzo.is-load { color: var(--hb-muted); font-size: .88rem; }
.hba-prezzo.is-off { background: #fef2f2; color: #991b1b; font-size: .88rem; font-weight: 500; }

.hba-scheda-cerca { margin: 2rem 0 0; }
.hba-scheda-cerca-titolo { margin: 0 0 .25rem; font-size: 1.1rem; font-weight: 700; color: #1d2327; }
.hba-scheda-cerca-nota { margin: 0 0 .75rem; font-size: .88rem; color: var(--hb-muted); }
