/* ============================================================
   cbooking engine — design system  (verde salvia / sabbia)
   ============================================================ */
:root {
    --sand: #faf8f4;
    --card: #fffdf9;
    --ink: #2b2b28;
    --muted: #82806f;
    --accent: #2f6f5e;
    --accent-dk: #245546;
    --accent-sf: #e7efe9;
    --gold: #b9975b;
    --line: #e8e2d6;
    --danger: #b4453c;
    --ok: #2f7d54;
    --shadow: 0 8px 30px rgba(43, 43, 40, 0.08);
    --shadow-sm: 0 2px 10px rgba(43, 43, 40, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    padding: 0;
}
body.cbk {
    background: var(--sand);
    color: var(--ink);
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    /* layout sticky-footer: la section si estende fino al footer */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.cbk h1,
.cbk h2,
.cbk h3,
.cbk h4 {
    font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.2px;
    margin: 0 0 0.4em;
}
.cbk h1 {
    font-size: 2.6rem;
    line-height: 1.1;
}
.cbk h2 {
    font-size: 2rem;
}
.cbk h3 {
    font-size: 1.55rem;
}
.cbk h4 {
    font-size: 1.25rem;
}
/* mobile: testi un po' piu' piccoli (scala la base rem + tarati i titoli serif) */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
    body.cbk {
        font-size: 14px;
    }
    .cbk h1 {
        font-size: 1.9rem;
    }
    .cbk h2 {
        font-size: 1.5rem;
    }
    .cbk h3 {
        font-size: 1.25rem;
    }
    .cbk h4 {
        font-size: 1.1rem;
    }
}
.cbk a {
    color: var(--accent);
    text-decoration: none;
}
.cbk a:hover {
    color: var(--accent-dk);
}
.cbk .wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}
.cbk .muted {
    color: var(--muted);
}
.cbk .center {
    text-align: center;
}
.cbk .mt0 {
    margin-top: 0;
}
.cbk .mb0 {
    margin-bottom: 0;
}

/* ---------- header / branding ---------- */
.cbk-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.cbk-header .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    /* solo verticale: NON toccare left/right, altrimenti azzera il padding orizzontale di .wrap */
    padding-top: 16px;
    padding-bottom: 16px;
}
.cbk-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0; /* permette al nome di restringersi/andare a capo invece di sforare */
    flex: 1 1 auto;
}
.cbk-brand img {
    max-height: 52px;
    max-width: 180px; /* un logo largo si adatta senza deformarsi ne' sforare */
    width: auto;
    height: auto;
}
.cbk-brand .name {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
}
.cbk-brand .site {
    font-size: 0.78rem;
    color: var(--muted);
}
.cbk-lang {
    flex: 0 0 auto;
}
.cbk-lang a {
    display: inline-block;
    margin-left: 6px;
    opacity: 0.55;
    transition: opacity 0.15s;
}
.cbk-lang a.active,
.cbk-lang a:hover {
    opacity: 1;
}
.cbk-lang img {
    width: 26px;
    height: auto;
    border-radius: 3px;
    vertical-align: middle;
}
.cbk-lang a {
    line-height: 0;
}
.cbk-lang svg {
    height: 18px;
    width: auto;
    display: block;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
/* mobile: testata piu' compatta (il margine ai lati arriva gia' da .wrap, ora corretto sopra) */
@media (max-width: 640px) {
    .cbk-header .bar {
        gap: 10px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .cbk-brand {
        gap: 8px;
    }
    .cbk-brand img {
        max-height: 36px;
        max-width: 90px;
    }
    .cbk-brand .name {
        font-size: 1.05rem;
    }
    .cbk-brand .site {
        font-size: 0.68rem;
    }
    /* centra nome/sito SOLO se c'e' un logo (altrimenti resta allineato a sinistra) */
    .cbk-brand img + div {
        flex: 1 1 auto; /* riempie lo spazio disponibile, altrimenti text-align:center non ha effetto */
        min-width: 0;
        text-align: center;
    }
    .cbk-lang a {
        margin-left: 3px;
    }
    .cbk-lang svg {
        height: 14px;
    }
}

/* ---------- stepper ---------- */
.cbk-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 26px 0 6px;
    flex-wrap: wrap;
}
.cbk-step {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    margin-right: 20px;
}
.cbk-step .dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--line);
    background: var(--card);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--muted);
    transition: all 0.2s;
    flex: none;
}
.cbk-step .lbl {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}
.cbk-step .bridge {
    width: 46px;
    height: 2px;
    background: var(--line);
    margin: 0 12px;
}
.cbk-step.done .dot {
    background: var(--accent-sf);
    border-color: var(--accent);
    color: var(--accent);
}
.cbk-step.active .dot {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 5px var(--accent-sf);
}
.cbk-step.active .lbl {
    color: var(--accent);
    font-weight: 600;
}
@media (max-width: 640px) {
    .cbk-step .lbl {
        display: none;
    }
    .cbk-step .bridge {
        width: 22px;
        margin: 0 6px;
    }
}

/* ---------- cards ---------- */
.cbk-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}
.cbk-section {
    padding: 26px 0 60px;
    position: relative;
    flex: 1 0 auto; /* riempie fino al footer */
}
/* sfondo foto struttura (solo dentro la section) con overlay chiaro */
.cbk-section.has-bg {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
.cbk-section.has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(250, 248, 244, 0.82);
    z-index: 0;
    pointer-events: none;
}
.cbk-section > .wrap {
    position: relative;
    z-index: 1;
}

/* ---------- buttons ---------- */
.cbk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 26px;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.15s,
        transform 0.05s;
    font-family: inherit;
    text-decoration: none;
}
.cbk-btn:hover {
    background: var(--accent-dk);
    color: #fff;
}
.cbk-btn:active {
    transform: translateY(1px);
}
.cbk-btn.block {
    width: 100%;
}
.cbk-btn.lg {
    padding: 16px 30px;
    font-size: 1.05rem;
}
.cbk-btn.ghost {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.cbk-btn.ghost:hover {
    background: var(--accent-sf);
    color: var(--accent-dk);
}
.cbk-btn.gold {
    background: var(--gold);
}
.cbk-btn.gold:hover {
    background: #a2814a;
}
.cbk-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}
/* i bottoni-link <a> devono vincere su .cbk a{color:accent} */
.cbk a.cbk-btn {
    color: #fff;
}
.cbk a.cbk-btn:hover {
    color: #fff;
}
.cbk a.cbk-btn.ghost {
    color: var(--accent);
}
.cbk a.cbk-btn.ghost:hover {
    color: var(--accent-dk);
}

/* ---------- form controls ---------- */
.cbk-field {
    margin-bottom: 16px;
}
.cbk-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.cbk-input,
.cbk-select,
.cbk textarea {
    width: 100%;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 1rem;
    color: var(--ink);
    font-family: inherit;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.cbk-input:focus,
.cbk-select:focus,
.cbk textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-sf);
}
.cbk-input.error,
.error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(180, 69, 60, 0.12) !important;
}
.cbk-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.cbk-row > * {
    flex: 1;
    min-width: 180px;
}

/* ---------- searchbar ---------- */
.cbk-search {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}
.cbk-search .fld {
    flex: 1;
    min-width: 190px;
}
.cbk-search .go {
    flex: 0 0 auto;
}
.cbk-daterange {
    cursor: pointer;
}
.cbk-daterange .val {
    font-size: 1.05rem;
    font-weight: 600;
}
.cbk-daterange .sub {
    font-size: 0.78rem;
    color: var(--muted);
}
/* mobile: il bottone Cerca/Aggiorna va a capo a tutta larghezza */
@media (max-width: 640px) {
    .cbk-search .go {
        flex: 1 0 100%;
    }
    .cbk-search .go label {
        display: none;
    }
    .cbk-search .go .cbk-btn {
        width: 100%;
    }
}

/* ---------- notes / alerts ---------- */
.cbk-alert {
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin: 16px 0;
}
.cbk-alert.warn {
    background: #fdf6e9;
    border: 1px solid #efd9a6;
    color: #7a5b1e;
}
.cbk-alert.info {
    background: var(--accent-sf);
    border: 1px solid #cfe0d4;
    color: var(--accent-dk);
}
.cbk-note {
    background: #fbf9f3;
    border-left: 3px solid var(--gold);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
}

/* ---------- room cards ---------- */
.cbk-slot-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 34px 0 14px;
    flex-direction: column;
}
.cbk-slot-title .n {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    background: var(--accent-sf);
    padding: 4px 10px;
    border-radius: 20px;
}
.cbk-room {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}
.cbk-room .gallery {
    position: relative;
    background: #eee;
    min-height: 210px;
}
.cbk-room .gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
}
.cbk-room .gallery .more {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}
.cbk-room .rbody {
    padding: 20px 22px;
}
.cbk-room .rbody h3 {
    margin-bottom: 6px;
}
.cbk-room .rdesc {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 14px;
}
.cbk-tag {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    margin-right: 6px;
}
.cbk-tag.last {
    background: #fdecea;
    color: var(--danger);
}
.cbk-tag.few {
    background: #fdf6e9;
    color: #7a5b1e;
}

/* pricelist rows */
.cbk-plist {
    border-top: 1px solid var(--line);
    margin-top: 6px;
}
.cbk-prow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.cbk-prow.on {
    background: var(--accent-sf);
}
.cbk-prow:last-child {
    border-bottom: none;
}
.cbk-prow .tinfo {
    flex: 1 1 auto; /* il nome trattamento occupa lo spazio: prezzi tutti allineati a destra */
    min-width: 0;
}
.cbk-prow .price {
    flex: 0 0 auto;
}
.cbk-prow .tinfo .tname {
    font-weight: 600;
}
.cbk-prow .tinfo .tsub {
    font-size: 0.78rem;
    color: var(--muted);
}
.cbk-prow .price {
    text-align: right;
    white-space: nowrap;
}
.cbk-prow .price .old {
    color: var(--danger);
    text-decoration: line-through;
    font-size: 0.85rem;
    display: block;
}
.cbk-prow .price .amt {
    font-size: 1.5rem;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
    color: var(--accent-dk);
}
.cbk-prow .price .per {
    font-size: 0.72rem;
    color: var(--muted);
}
@media (max-width: 720px) {
    .cbk-room {
        grid-template-columns: 1fr;
    }
    .cbk-room .gallery {
        min-height: 200px;
        position: relative;
    }
    .cbk-room .gallery img {
        position: relative;
    }
}

/* ---------- summary bar / recap ---------- */
.cbk-recap .line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
}
.cbk-recap .line .l .rm {
    font-weight: 600;
}
.cbk-recap .line .l .sm {
    font-size: 0.8rem;
    color: var(--muted);
}
.cbk-recap .total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 2px solid var(--accent-sf);
}
.cbk-recap .total .lbl {
    font-size: 1.05rem;
    font-weight: 600;
}
.cbk-recap .total .amt {
    font-family: "Cormorant Garamond", serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-dk);
}

/* ---------- supplements ---------- */
.cbk-sup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
}
.cbk-sup:hover {
    border-color: var(--accent);
}
.cbk-sup.on {
    border-color: var(--accent);
    background: var(--accent-sf);
}
.cbk-sup .s-name {
    font-weight: 600;
}
.cbk-sup .s-sub {
    font-size: 0.8rem;
    color: var(--muted);
}
.cbk-sup .s-price {
    font-weight: 700;
    color: var(--accent-dk);
    white-space: nowrap;
}
.cbk-sup input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
}

/* ---------- footer ---------- */
.cbk-footer {
    background: var(--card);
    border-top: 1px solid var(--line);
    flex-shrink: 0; /* resta sempre a fondo pagina, non si comprime */
}
.cbk-footer .in {
    padding: 34px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}
.cbk-footer img {
    height: 60px;
    margin-bottom: 10px;
}

.cbk-actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 26px;
    flex-wrap: wrap;
}

/* ---------- timeline disponibilita' (nessun risultato) ---------- */
.cbk-avail {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.cbk-avail table {
    border-collapse: collapse;
    font-size: 11px;
    white-space: nowrap;
    width: 100%;
}
.cbk-avail th,
.cbk-avail td {
    border: 1px solid var(--line);
    text-align: center;
}
.cbk-avail .rlabel {
    text-align: left;
    padding: 6px 12px;
    font-weight: 600;
    background: var(--card);
    position: sticky;
    left: 0;
    min-width: 130px;
    z-index: 1;
}
.cbk-avail thead th {
    padding: 4px 2px;
    width: 34px;
    background: #faf9f5;
    color: var(--muted);
    line-height: 1.1;
}
.cbk-avail thead th.we {
    background: #f3f1ea;
}
.cbk-avail thead th .dw {
    display: block;
    font-size: 9px;
}
.cbk-avail thead th .dn {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
}
.cbk-avail thead th .mo {
    display: block;
    font-size: 9px;
}
.cbk-avail td.cell {
    width: 34px;
    height: 34px;
    font-weight: 700;
}
.cbk-avail td.ok {
    background: #dbeee2;
    color: var(--accent-dk);
}
.cbk-avail td.no {
    background: #f7e0dd;
}
.cbk-avail .inperiod {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}
.cbk-avail-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--muted);
}
.cbk-avail-legend i {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 5px;
}
.cbk-avail-legend i.ok {
    background: #dbeee2;
}
.cbk-avail-legend i.no {
    background: #f7e0dd;
}
.cbk-avail-legend i.sr {
    background: #fff;
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

/* ============================================================
   Price calendar
   ============================================================ */
.cal-pop {
    position: absolute;
    z-index: 60;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-top: 8px;
    display: none;
}
.guest-pop {
    min-width: 320px;
}
.cal-pop.open {
    display: block;
}
.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.cal-nav {
    background: var(--accent-sf);
    border: none;
    color: var(--accent-dk);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.cal-nav:hover {
    background: var(--accent);
    color: #fff;
}
.cal-nav[disabled] {
    opacity: 0.3;
    cursor: default;
    background: var(--accent-sf);
    color: var(--accent-dk);
}
.cal-months {
    display: flex;
    gap: 26px;
}
.cal-month {
    width: 280px;
}
.cal-mtitle {
    text-align: center;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: capitalize;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.cal-dow {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    text-transform: uppercase;
    padding-bottom: 4px;
}
.cal-day {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    border: 1px solid transparent;
    transition:
        background 0.1s,
        border-color 0.1s;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.cal-day .d {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
}
.cal-day .p {
    font-size: 0.6rem;
    color: var(--ok);
    font-weight: 700;
    margin-top: 2px;
    line-height: 1;
}
.cal-day .ms {
    font-size: 0.5rem;
    color: var(--gold);
    font-weight: 600;
    line-height: 1;
}
.cal-day.range-start .ms,
.cal-day.range-end .ms {
    color: #f3e3c2;
}
.cal-day.empty {
    background: transparent;
    cursor: default;
}
.cal-day.off {
    color: #c8c4b8;
    cursor: not-allowed;
    background: #faf9f5;
}
.cal-day.off .p {
    display: none;
}
.cal-day.sel:hover {
    border-color: var(--accent);
}
.cal-day.in-range {
    background: var(--accent-sf);
}
.cal-day.range-start,
.cal-day.range-end {
    background: var(--accent);
    color: #fff;
}
.cal-day.range-start .p,
.cal-day.range-end .p {
    color: #dfeee4;
}
.cal-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    font-size: 0.72rem;
    color: var(--muted);
    flex-wrap: wrap;
}
.cal-legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 5px;
}
.cal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.cal-foot .info {
    font-size: 0.85rem;
    color: var(--muted);
}
.cal-foot .info b {
    color: var(--ink);
}
@media (max-width: 640px) {
    .cal-pop {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        left: 20px;
        right: 20px;
        width: auto;
        min-width: 0;
    }
    .cal-months {
        flex-direction: column;
        gap: 14px;
    }
    .cal-month {
        width: 100%;
    }
}

/* ============================================================
   Overlay di caricamento (cambio pagina dopo submit/click)
   ============================================================ */
.cbk-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(250, 248, 244, 0.88);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.cbk-loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}
.cbk-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid var(--accent-sf);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: cbk-spin 0.8s linear infinite;
}
@keyframes cbk-spin {
    to {
        transform: rotate(360deg);
    }
}
.cbk-loading-text {
    margin-top: 16px;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.95rem;
}
