/* Modulo di ricerca (barra di prenotazione), menu delle filiali e calendario — usato in home, catalogo e scheda auto */

.booking-bar { position: relative; display: grid; gap: 0; background: var(--white); border-radius: var(--r-xl); padding: 8px; box-shadow: var(--shadow-lg); color: var(--ink); border: 1px solid rgba(255, 255, 255, .6); }
.bb-fields { display: grid; gap: 0; }
.bb-field { position: relative; display: grid; align-items: center; min-width: 0; } /* senza raggio: i filetti di separazione restano dritti (l'evidenziazione è sul .bb-control) */
.bb-field + .bb-field { border-top: 1px solid var(--line-2); }
.bb-label { display: block; font: 650 .6875rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.bb-control { position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 18px; border-radius: 22px; cursor: pointer; transition: background-color .2s; }
.bb-control > .i { width: 22px; height: 22px; color: var(--green-600); }
.bb-control .bb-body { flex: 1; min-width: 0; display: block; }
@media (hover: hover) { .bb-control:hover { background: var(--paper); } }
.bb-field:focus-within > .bb-control, .bb-field.is-open > .bb-control { background: var(--green-50); box-shadow: inset 0 0 0 2px var(--green-700); }
.bb-input { width: 100%; min-height: 28px; padding: 0; border: 0; background: transparent; font: 600 1.0625rem/1.25 var(--font-body); color: var(--ink); text-overflow: ellipsis; }
.bb-input::placeholder { color: #66756d; font-weight: 500; }
.bb-input:focus { outline: none; }
.bb-date { display: block; padding: 0; border: 0; background: transparent; text-align: left; font: 600 1.0625rem/1.25 var(--font-body); color: var(--ink); width: 100%; }
.bb-date.is-empty { color: #66756d; font-weight: 500; }
.bb-date:focus-visible { outline: none; }
.bb-time { position: relative; flex: none; }
.bb-time select { appearance: none; -webkit-appearance: none; border: 0; background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6c64' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; border-radius: 12px; min-height: 44px; padding: 0 28px 0 12px; font: 650 1rem/1 var(--font-body); color: var(--ink); cursor: pointer; }
.bb-time select:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; }
.bb-time select:disabled { opacity: .5; }
.bb-submit-wrap { padding: 8px 4px 4px; }
.bb-submit { width: 100%; min-height: 60px; font-size: 1.0625rem; }
.bb-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; padding: 10px 14px 6px; font-size: .9rem; color: var(--ink-2); }
.bb-opts .check { font-size: .9rem; align-items: center; min-height: 40px; }
.bb-opts .check input { width: 22px; height: 22px; border-radius: 7px; }
.bb-age { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.bb-age select { appearance: none; -webkit-appearance: none; border: 1.5px solid var(--line); border-radius: 10px; min-height: 36px; padding: 0 28px 0 10px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6c64' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; font: 600 .9rem/1 var(--font-body); }
.bb-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--green-700); font-weight: 600; background: none; border: 0; padding: 0; }
.bb-promo { display: none; width: 100%; }
.bb-promo.is-open { display: block; padding: 4px 0 8px; }
.bb-promo input { width: 100%; max-width: 280px; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0 14px; font-size: 1rem; text-transform: uppercase; }
.bb-error { display: none; margin: 4px 8px 8px; padding: 10px 14px; border-radius: 12px; background: var(--danger-bg); color: #8e271e; font-size: .9rem; font-weight: 550; }
.bb-error.is-on { display: block; }

@media (min-width: 700px) {
  .bb-fields { grid-template-columns: 1fr 1fr; }
  .bb-field + .bb-field { border-top: 0; }
  .bb-pickup, .bb-dropoff { grid-column: 1 / -1; }
  .bb-fields > .bb-field:nth-child(n+2) { border-top: 1px solid var(--line-2); }
  .bb-from { border-right: 1px solid var(--line-2); }
}
@media (min-width: 1080px) {
  .booking-bar { grid-template-columns: 1fr auto; align-items: stretch; padding: 8px 8px 8px 8px; border-radius: 999px; }
  .bb-fields { grid-template-columns: 1.25fr 1.1fr 1.1fr; align-items: stretch; }
  .booking-bar.has-dropoff .bb-fields { grid-template-columns: 1.1fr 1.1fr 1fr 1fr; }
  .bb-pickup, .bb-dropoff { grid-column: auto; }
  .bb-field, .bb-fields > .bb-field:nth-child(n+2) { border: 0; border-radius: 999px; }
  .bb-field + .bb-field::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--line); transition: opacity .2s; }
  .bb-field:focus-within::before, .bb-field.is-open::before, .bb-field:focus-within + .bb-field::before, .bb-field.is-open + .bb-field::before { opacity: 0; }
  .bb-from { border-right: 0; }
  .bb-control { border-radius: 999px; padding-inline: 22px; height: 100%; }
  .bb-submit-wrap { padding: 0; display: grid; align-items: center; }
  .bb-submit { width: auto; min-height: 64px; padding: 0 34px; border-radius: 999px; }
  .bb-opts { grid-column: 1 / -1; padding: 4px 20px 2px; }
  .bb-link { margin-left: auto; }
}
.booking-bar.is-compact { box-shadow: var(--shadow-md); border-color: var(--line-2); }

/* menu a tendina delle filiali */
.bb-list { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(100%, 460px); max-height: min(60svh, 420px); overflow: auto; overscroll-behavior: contain; padding: 8px; background: var(--white); border-radius: 22px; border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
@media (min-width: 1080px) { .bb-list { width: 440px; } .bb-dropoff .bb-list { left: auto; right: 0; } }
.bb-group { padding: 10px 12px 4px; font: 650 .6875rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bb-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer; min-height: 56px; }
.bb-opt .i { color: var(--green-600); width: 22px; height: 22px; }
.bb-opt .bb-opt__text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.bb-opt strong { font-weight: 600; font-size: .98rem; }
.bb-opt small { color: var(--muted); font-size: .8125rem; }
.bb-opt .code { font: 650 .75rem/1 var(--font-body); padding: 5px 8px; border-radius: 8px; background: var(--paper-2); color: var(--ink-2); letter-spacing: .04em; }
.bb-opt[aria-selected='true'], .bb-opt:hover { background: var(--green-50); }
.bb-opt.is-near .i { color: var(--green-950); }
.bb-empty { padding: 16px; color: var(--muted); font-size: .94rem; }

/* calendario con intervallo */
.cal-pop { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 10px); }
.cal { background: var(--white); border: 1px solid var(--line-2); border-radius: 26px; box-shadow: var(--shadow-lg); padding: 18px 16px 16px; color: var(--ink); max-width: 760px; margin-inline: auto; }
@media (min-width: 1080px) { .cal-pop { left: 50%; right: auto; width: 760px; transform: translateX(-50%); } }
.cal__months { display: grid; gap: 22px; position: relative; }
@media (min-width: 640px) { .cal__months { grid-template-columns: 1fr 1fr; gap: 28px; } }
.cal__month-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 6px; }
.cal__title { flex: 1; text-align: center; font: 650 1.0625rem/1 var(--font-display); text-transform: capitalize; letter-spacing: -.01em; }
.cal__nav { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--white); }
.cal__nav[disabled] { opacity: .3; pointer-events: none; }
.cal__nav.is-hidden { visibility: hidden; }
@media (hover: hover) { .cal__nav:hover { background: var(--green-50); border-color: var(--green-700); } }
.cal__wd, .cal__days { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__wd span { text-align: center; padding: 6px 0; font: 600 .75rem/1 var(--font-body); color: var(--muted); text-transform: uppercase; }
.cal__day { position: relative; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; font: 550 .95rem/1 var(--font-body); color: var(--ink); border-radius: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.cal__day span { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; transition: background-color .15s, color .15s; }
@media (hover: hover) { .cal__day:not(.is-disabled):not(.is-start):not(.is-end):hover span { background: var(--green-100); } }
.cal__day.is-today span { box-shadow: inset 0 0 0 1.5px var(--green-600); }
.cal__day.is-disabled { color: #b7bdb8; cursor: not-allowed; text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .15); }
.cal__day.is-range { background: var(--green-50); }
.cal__day.is-start, .cal__day.is-end { background: transparent; }
.cal__day.is-start span, .cal__day.is-end span { background: var(--green-900); color: #fff; box-shadow: none; }
.cal__day.is-start:not(.is-end)::before, .cal__day.is-end:not(.is-start)::before { content: ''; position: absolute; top: 0; bottom: 0; width: 50%; background: var(--green-50); }
.cal__day.is-start:not(.is-end)::before { right: 0; } .cal__day.is-end:not(.is-start)::before { left: 0; }
.cal__day.is-start.is-end::before, .cal__day.is-hover-end:not(.is-start)::before { display: none; }
.cal__day.is-hover-range { background: var(--green-50); }
.cal__day:focus-visible { outline: none; } .cal__day:focus-visible span { outline: 3px solid var(--green-600); outline-offset: 1px; }
.cal__day.is-empty { pointer-events: none; }
.cal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.cal__sum { font-weight: 600; font-size: .94rem; color: var(--ink-2); }
.cal__sum b { color: var(--ink); }
.cal__sum .muted { color: var(--muted); font-weight: 500; }
.cal__foot .btn { min-height: 46px; }
