/**
 * Guest Grow Booking Form — Barra de Pesquisa (widget Elementor)
 * Estilos scoped por `.ggbf-sb`. Todo o design é controlável via custom
 * properties `--ggbf-sb-*` (mapeadas pelos controlos de Style do Elementor) e,
 * por defeito, herda o tom primário do plugin (`--ggbf-primary-*`).
 *
 * Estados de layout (geridos pelo controlador JS via ResizeObserver):
 *   .ggbf-sb--ready    -> JS inicializado
 *   .ggbf-sb--compact  -> largura insuficiente => modo mobile (pill + bottom-sheet)
 */

.ggbf-sb {
    /* ---- Tokens (defaults luxo; override via Elementor) ---- */
    --ggbf-sb-accent: hsl(var(--ggbf-primary-h, 210) calc(var(--ggbf-primary-s, 90%)) calc(var(--ggbf-primary-l, 45%)));
    --ggbf-sb-accent-soft: hsl(var(--ggbf-primary-h, 210) calc(var(--ggbf-primary-s, 90%)) 96%);

    --ggbf-sb-bg: rgba(255, 255, 255, 0.92);
    --ggbf-sb-blur: 14px;
    --ggbf-sb-radius: 18px;
    --ggbf-sb-border: 1px solid rgba(17, 24, 39, 0.06);
    --ggbf-sb-shadow: 0 18px 50px -18px rgba(17, 24, 39, 0.35), 0 2px 6px rgba(17, 24, 39, 0.06);
    --ggbf-sb-padding: 8px;
    --ggbf-sb-gap: 4px;
    --ggbf-sb-min-height: 68px;

    --ggbf-sb-divider-color: rgba(17, 24, 39, 0.10);

    --ggbf-sb-label-color: #6b7280;
    --ggbf-sb-value-color: #111827;
    --ggbf-sb-placeholder-color: #9ca3af;
    --ggbf-sb-icon-color: var(--ggbf-sb-accent);
    --ggbf-sb-field-radius: 12px;
    --ggbf-sb-field-hover-bg: rgba(17, 24, 39, 0.04);
    --ggbf-sb-field-active-bg: var(--ggbf-sb-accent-soft);

    --ggbf-sb-label-size: 11px;
    --ggbf-sb-label-weight: 700;
    --ggbf-sb-value-size: 15px;
    --ggbf-sb-value-weight: 600;

    --ggbf-sb-btn-bg: #111827;
    --ggbf-sb-btn-bg-hover: #000000;
    --ggbf-sb-btn-color: #ffffff;
    --ggbf-sb-btn-radius: 12px;
    --ggbf-sb-btn-size: 15px;
    --ggbf-sb-btn-weight: 700;
    --ggbf-sb-btn-padding: 0 26px;

    --ggbf-sb-pop-bg: #ffffff;
    --ggbf-sb-pop-radius: 16px;
    --ggbf-sb-pop-shadow: 0 24px 60px -16px rgba(17, 24, 39, 0.40);
    --ggbf-sb-pop-color: #111827;
    --ggbf-sb-pop-width: 320px;

    --ggbf-sb-focus-ring: 0 0 0 3px color-mix(in srgb, var(--ggbf-sb-accent) 35%, transparent);

    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    color: var(--ggbf-sb-value-color);
    -webkit-font-smoothing: antialiased;
}

.ggbf-sb *,
.ggbf-sb *::before,
.ggbf-sb *::after { box-sizing: border-box; }

/* Reset robusto: impedir que o tema/Elementor injete estilos nos controlos da
   barra (hover de botões, cor herdada, sombras, sublinhados, etc.). Os estados
   visuais são todos definidos explicitamente mais abaixo. */
.ggbf-sb button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    background-image: none;
    text-transform: none;
    text-decoration: none;
    text-shadow: none;
    letter-spacing: normal;
    box-shadow: none;
    outline: none;
    min-width: 0;
    line-height: normal;
}
.ggbf-sb button:focus { outline: none; }
.ggbf-sb a,
.ggbf-sb a:hover,
.ggbf-sb a:focus { color: inherit; text-decoration: none; box-shadow: none; }

/* ============================================================= *
 *  BARRA (desktop)                                               *
 * ============================================================= */

.ggbf-sb__bar {
    display: flex;
    align-items: stretch;
    gap: var(--ggbf-sb-gap);
    width: 100%;
    min-height: var(--ggbf-sb-min-height);
    padding: var(--ggbf-sb-padding);
    background: var(--ggbf-sb-bg);
    border: var(--ggbf-sb-border);
    border-radius: var(--ggbf-sb-radius);
    box-shadow: var(--ggbf-sb-shadow);
    -webkit-backdrop-filter: blur(var(--ggbf-sb-blur));
    backdrop-filter: blur(var(--ggbf-sb-blur));
}

/* Segmento: wrapper relativo do campo + popover (irmão do botão) */
.ggbf-sb__seg {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
}

/* Campo / segmento clicável */
.ggbf-sb__field {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: transparent;
    border: 0;
    border-radius: var(--ggbf-sb-field-radius);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: background-color .18s ease, box-shadow .18s ease;
}

.ggbf-sb__field:hover { background: var(--ggbf-sb-field-hover-bg); }
.ggbf-sb__field.is-open { background: var(--ggbf-sb-field-active-bg); }

.ggbf-sb__field:focus-visible,
.ggbf-sb__submit:focus-visible,
.ggbf-sb__stepper-btn:focus-visible,
.ggbf-sb__sheet-close:focus-visible {
    outline: none;
    box-shadow: var(--ggbf-sb-focus-ring);
}

.ggbf-sb__field-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--ggbf-sb-icon-color);
    display: inline-flex;
}
.ggbf-sb__field-icon svg { width: 100%; height: 100%; display: block; }

.ggbf-sb__field-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ggbf-sb__label {
    font-size: var(--ggbf-sb-label-size);
    font-weight: var(--ggbf-sb-label-weight);
    line-height: 1.1;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ggbf-sb-label-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ggbf-sb__value {
    font-size: var(--ggbf-sb-value-size);
    font-weight: var(--ggbf-sb-value-weight);
    line-height: 1.25;
    color: var(--ggbf-sb-value-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ggbf-sb__value.is-placeholder { color: var(--ggbf-sb-placeholder-color); font-weight: 500; }

/* Divisor entre campos */
.ggbf-sb__divider {
    flex: 0 0 auto;
    align-self: center;
    width: 1px;
    height: 34px;
    background: var(--ggbf-sb-divider-color);
}
.ggbf-sb--compact .ggbf-sb__divider { display: none; }

/* Botão primário */
.ggbf-sb__submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: calc(var(--ggbf-sb-min-height) - (var(--ggbf-sb-padding) * 2));
    padding: var(--ggbf-sb-btn-padding);
    border: 0;
    border-radius: var(--ggbf-sb-btn-radius);
    background: var(--ggbf-sb-btn-bg);
    color: var(--ggbf-sb-btn-color);
    font-size: var(--ggbf-sb-btn-size);
    font-weight: var(--ggbf-sb-btn-weight);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .18s ease, transform .06s ease, opacity .18s ease;
}
.ggbf-sb__submit:hover { background: var(--ggbf-sb-btn-bg-hover); }
.ggbf-sb__submit:active { transform: translateY(1px); }
.ggbf-sb__submit[disabled] { opacity: .55; cursor: not-allowed; }
.ggbf-sb__submit-icon { width: 18px; height: 18px; display: inline-flex; }
.ggbf-sb__submit-icon svg { width: 100%; height: 100%; }

/* Alinhamentos (controlo de conteúdo do Elementor). Só têm efeito visível
   quando existe uma largura máxima definida na barra. Atuam por margens
   automáticas para NÃO transformar a raiz num flex container (a raiz contém
   barra + pill + sheet + avisos). */
.ggbf-sb--align-center .ggbf-sb__bar,
.ggbf-sb--align-center .ggbf-sb__pill { margin-inline: auto; }
.ggbf-sb--align-right .ggbf-sb__bar,
.ggbf-sb--align-right .ggbf-sb__pill { margin-inline-start: auto; }

/* ============================================================= *
 *  POPOVERS (desktop) — Pessoas / Unidade                       *
 * ============================================================= */

.ggbf-sb__pop {
    position: absolute;
    z-index: 100050;
    top: calc(100% + 10px);
    left: 0;
    width: var(--ggbf-sb-pop-width);
    max-width: calc(100vw - 24px);
    background: var(--ggbf-sb-pop-bg);
    color: var(--ggbf-sb-pop-color);
    border-radius: var(--ggbf-sb-pop-radius);
    box-shadow: var(--ggbf-sb-pop-shadow);
    overflow: hidden; /* recorta o calendário aos cantos arredondados do popover */
    padding: 10px;
    opacity: 0;
    transform: translateY(-6px) scale(.985);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}
.ggbf-sb__pop.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.ggbf-sb__pop--right { left: auto; right: 0; }

/* Linha de stepper (Adultos/Crianças/Bebés) */
.ggbf-sb__stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 8px;
}
.ggbf-sb__stepper + .ggbf-sb__stepper { border-top: 1px solid rgba(17, 24, 39, 0.07); }
.ggbf-sb__stepper-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ggbf-sb__stepper-title { font-size: 15px; font-weight: 600; color: var(--ggbf-sb-pop-color); }
.ggbf-sb__stepper-hint { font-size: 12px; color: var(--ggbf-sb-label-color); }
.ggbf-sb__stepper-control { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }

.ggbf-sb__stepper-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--ggbf-sb-accent) 45%, #d1d5db);
    background: #fff;
    color: var(--ggbf-sb-accent);
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, opacity .15s ease;
}
.ggbf-sb__stepper-btn:hover:not([disabled]) { background: var(--ggbf-sb-accent-soft); }
.ggbf-sb__stepper-btn[disabled] { opacity: .4; cursor: not-allowed; }
.ggbf-sb__stepper-count { min-width: 24px; text-align: center; font-size: 16px; font-weight: 700; }

/* Lista de unidades */
.ggbf-sb__units { max-height: 320px; overflow-y: auto; padding: 4px; }
.ggbf-sb__unit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    background: transparent;
    border-radius: var(--ggbf-sb-field-radius);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--ggbf-sb-pop-color);
}
.ggbf-sb__unit:hover { background: var(--ggbf-sb-field-hover-bg); }
.ggbf-sb__unit.is-selected { background: var(--ggbf-sb-accent-soft); }
.ggbf-sb__unit-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ggbf-sb__unit-cap { font-size: 12px; color: var(--ggbf-sb-label-color); flex: 0 0 auto; }
.ggbf-sb__unit-check { width: 18px; height: 18px; color: var(--ggbf-sb-accent); opacity: 0; flex: 0 0 auto; }
.ggbf-sb__unit.is-selected .ggbf-sb__unit-check { opacity: 1; }

/* Datepicker host dentro do popover (reaproveita .ggbf-datepicker-* do plugin) */
.ggbf-sb__pop--dates { width: auto; padding: 0; }
.ggbf-sb__dp { min-width: 300px; }

/* Mostrar só o calendário (o display interno do datepicker é redundante com os
   segmentos Check-in/Check-out da barra). O calendário fica sempre visível
   dentro do popover; a visibilidade é gerida pelo próprio popover. */
.ggbf-sb__pop--dates .ggbf-datepicker-input-wrapper { display: none !important; }
.ggbf-sb__pop--dates .ggbf-datepicker-container { display: block; }
.ggbf-sb__pop--dates .ggbf-datepicker-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    border: none;
    box-shadow: none;
    max-height: none;
    transition: none;
    border-radius: var(--ggbf-sb-pop-radius);
    z-index: auto;
}
/* No bottom-sheet, o CTA é o do rodapé da folha. */
.ggbf-sb__sheet .ggbf-sb__pop--dates .ggbf-datepicker-footer { display: none; }

/* Rodapé de popover (aplicar/limpar em mobile) */
.ggbf-sb__pop-footer {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 8px 6px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    margin-top: 6px;
}

/* ============================================================= *
 *  MOBILE — pill + bottom-sheet                                  *
 * ============================================================= */

.ggbf-sb__pill {
    display: none;
    width: 100%;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 10px 10px 18px;
    background: var(--ggbf-sb-bg);
    border: var(--ggbf-sb-border);
    border-radius: var(--ggbf-sb-radius);
    box-shadow: var(--ggbf-sb-shadow);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    -webkit-backdrop-filter: blur(var(--ggbf-sb-blur));
    backdrop-filter: blur(var(--ggbf-sb-blur));
}
.ggbf-sb__pill-icon { width: 22px; height: 22px; color: var(--ggbf-sb-icon-color); flex: 0 0 auto; }
.ggbf-sb__pill-icon svg { width: 100%; height: 100%; }
.ggbf-sb__pill-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ggbf-sb__pill-title { font-size: 15px; font-weight: 700; color: var(--ggbf-sb-value-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ggbf-sb__pill-sub { font-size: 12.5px; color: var(--ggbf-sb-label-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ggbf-sb__pill-cta {
    flex: 0 0 auto;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--ggbf-sb-btn-bg);
    color: var(--ggbf-sb-btn-color);
    display: inline-flex; align-items: center; justify-content: center;
}
.ggbf-sb__pill-cta svg { width: 18px; height: 18px; }

/* Estado compacto: esconder a barra, mostrar a pill */
.ggbf-sb--compact .ggbf-sb__bar { display: none; }
.ggbf-sb--compact .ggbf-sb__pill { display: flex; }

/* Sheet (overlay) — usado no mobile para todos os passos */
.ggbf-sb__sheet-root { position: fixed; inset: 0; z-index: 100000; display: none; }
.ggbf-sb__sheet-root.is-open { display: block; }
.ggbf-sb__scrim {
    position: absolute; inset: 0;
    background: rgba(17, 24, 39, 0.5);
    opacity: 0;
    transition: opacity .25s ease;
}
.ggbf-sb__sheet-root.is-open .ggbf-sb__scrim { opacity: 1; }

.ggbf-sb__sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    background: var(--ggbf-sb-pop-bg);
    color: var(--ggbf-sb-pop-color);
    border-radius: var(--ggbf-sb-pop-radius) var(--ggbf-sb-pop-radius) 0 0;
    box-shadow: 0 -16px 50px rgba(0, 0, 0, .35);
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.ggbf-sb__sheet-root.is-open .ggbf-sb__sheet { transform: translateY(0); }

.ggbf-sb__sheet-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 18px 8px;
    flex: 0 0 auto;
}
.ggbf-sb__sheet-grabber {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 42px; height: 5px; border-radius: 999px; background: rgba(17, 24, 39, 0.18);
}
.ggbf-sb__sheet-title { font-size: 18px; font-weight: 800; }
.ggbf-sb__sheet-close {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
    border: 0; background: var(--ggbf-sb-field-hover-bg); color: var(--ggbf-sb-value-color);
    font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.ggbf-sb__sheet-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 14px; }

/* Passos dentro do sheet */
.ggbf-sb__step { display: none; }
.ggbf-sb__step.is-active { display: block; }
.ggbf-sb__step-head { display: flex; align-items: center; gap: 10px; padding: 6px 6px 10px; }
.ggbf-sb__step-num {
    width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
    background: var(--ggbf-sb-accent-soft); color: var(--ggbf-sb-accent);
    font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.ggbf-sb__step-title { font-size: 15px; font-weight: 700; }

.ggbf-sb__sheet-footer {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
}
.ggbf-sb__sheet-footer .ggbf-sb__submit { flex: 1 1 auto; width: 100%; }
.ggbf-sb__ghost-btn {
    flex: 0 0 auto;
    border: 0; background: transparent; color: var(--ggbf-sb-label-color);
    font: inherit; font-weight: 700; cursor: pointer; padding: 12px 14px; border-radius: 10px;
}
.ggbf-sb__ghost-btn:hover { background: var(--ggbf-sb-field-hover-bg); }

/* No sheet, os popovers de pessoas/unidade são renderizados inline */
.ggbf-sb__sheet .ggbf-sb__pop {
    position: static; width: 100%; max-width: none;
    opacity: 1; transform: none; pointer-events: auto; box-shadow: none; padding: 0;
    overflow: visible;
}
.ggbf-sb__sheet .ggbf-sb__dp { min-width: 0; width: 100%; }
.ggbf-sb__sheet .ggbf-sb__units { max-height: none; }

/* Alvos de toque mais confortáveis dentro da folha/drawer (mobile) */
.ggbf-sb__sheet .ggbf-sb__stepper { padding: 16px 6px; }
.ggbf-sb__sheet .ggbf-sb__stepper-btn { width: 44px; height: 44px; font-size: 22px; }
.ggbf-sb__sheet .ggbf-sb__stepper-count { min-width: 30px; font-size: 18px; }
.ggbf-sb__sheet .ggbf-sb__unit { padding: 14px; width: 100%; }

/* ---- Layout full-width consistente dentro do drawer (todas as fases) ---- */
/* Cada fase ocupa a largura total do corpo da folha, com respiração uniforme. */
.ggbf-sb__sheet .ggbf-sb__stepper { width: 100%; }
.ggbf-sb__sheet .ggbf-sb__units { width: 100%; padding: 4px 0; }

/* Datepicker reaproveitado no drawer: remover o cabeçalho cinzento e deixar
   o calendário a toda a largura da folha. */
.ggbf-sb__sheet .ggbf-calendar-header {
    background: transparent !important;
    border-bottom: 0 !important;
    padding: 2px 0 8px;
}
.ggbf-sb__sheet .ggbf-sb__pop--dates,
.ggbf-sb__sheet .ggbf-datepicker-container,
.ggbf-sb__sheet .ggbf-datepicker-dropdown { width: 100%; }
.ggbf-sb__sheet .ggbf-datepicker-dropdown { padding: 0 2px; }
/* A grelha de dias já é 7 colunas (1fr) — garantir que estica à largura total. */
.ggbf-sb__sheet .ggbf-calendar-grid,
.ggbf-sb__sheet .ggbf-calendar-days,
.ggbf-sb__sheet .ggbf-calendar-weekdays { width: 100%; }

/* Forçar TODOS os botões do drawer (Continuar/Seguinte/Concluído/Reservar)
   para as cores do Elementor — vence o bloco de blindagem acima. */
.ggbf-sb__sheet .ggbf-sb__submit {
    background: var(--ggbf-sb-btn-bg) !important;
    color: var(--ggbf-sb-btn-color) !important;
}
.ggbf-sb__sheet .ggbf-sb__submit:hover:not([disabled]),
.ggbf-sb__sheet .ggbf-sb__submit:focus:not([disabled]) {
    background: var(--ggbf-sb-btn-bg-hover) !important;
    color: var(--ggbf-sb-btn-color) !important;
}
/* "Voltar" (ghost) mantém a cor de label e não deve ser sobreposto pelo tema. */
.ggbf-sb__sheet .ggbf-sb__ghost-btn {
    background: transparent !important;
    color: var(--ggbf-sb-label-color) !important;
}
.ggbf-sb__sheet .ggbf-sb__ghost-btn:hover,
.ggbf-sb__sheet .ggbf-sb__ghost-btn:focus {
    background: var(--ggbf-sb-field-hover-bg) !important;
    color: var(--ggbf-sb-value-color) !important;
}

/* Drawer de campo único (modo "nunca colapsar"): CTA primário em destaque */
.ggbf-sb__sheet-root--single .ggbf-sb__sheet-footer .ggbf-sb__submit { width: 100%; }

/* ============================================================= *
 *  Aviso / mensagens                                            *
 * ============================================================= */
.ggbf-sb__notice {
    margin-top: 8px;
    font-size: 13px;
    color: #b91c1c;
    padding: 0 6px;
}
.ggbf-sb__sheet-note {
    flex: 0 0 auto;
    font-size: 13px;
    color: #b91c1c;
    padding: 8px 16px 0;
}
.ggbf-sb__sr {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Skeleton enquanto inicializa */
.ggbf-sb:not(.ggbf-sb--ready) .ggbf-sb__value { color: var(--ggbf-sb-placeholder-color); }

/* ============================================================= *
 *  Acessibilidade / motion                                      *
 * ============================================================= */
@media (prefers-reduced-motion: reduce) {
    .ggbf-sb__pop,
    .ggbf-sb__sheet,
    .ggbf-sb__scrim,
    .ggbf-sb__submit { transition: none !important; }
}

/* Fallback responsivo por viewport (caso o JS ainda não tenha medido) */
@media (max-width: 720px) {
    .ggbf-sb--auto .ggbf-sb__bar { display: none; }
    .ggbf-sb--auto .ggbf-sb__pill { display: flex; }
}

/* ============================================================= *
 *  Empilhamento vertical (modo "Nunca colapsar")                 *
 *  Em ecrãs estreitos, a barra horizontal passa a coluna —       *
 *  responsiva na vertical, sem cair para pill + folha.           *
 * ============================================================= */
.ggbf-sb--stacked .ggbf-sb__bar {
    flex-direction: column;
    align-items: stretch;
    /* gap herda var(--ggbf-sb-gap) — ajustável por dispositivo no Elementor */
}
.ggbf-sb--stacked .ggbf-sb__seg { width: 100%; }
.ggbf-sb--stacked .ggbf-sb__field {
    width: 100%;
    min-height: 52px; /* alvo de toque confortável */
    border-radius: var(--ggbf-sb-field-radius);
}
/* separadores verticais -> linhas horizontais entre campos */
.ggbf-sb--stacked .ggbf-sb__divider {
    width: auto;
    height: 1px;
    align-self: stretch;
    margin: 2px 10px;
}
.ggbf-sb--stacked .ggbf-sb__submit {
    width: 100%;
    margin-top: 4px;
    min-height: 52px;
}
/* o popover ocupa a largura do campo empilhado e não transborda */
.ggbf-sb--stacked .ggbf-sb__pop,
.ggbf-sb--stacked .ggbf-sb__pop--right { left: 0; right: auto; width: 100%; }
.ggbf-sb--stacked .ggbf-sb__dp { min-width: 0; width: 100%; }

/* Fallback pré-JS / por viewport: só empilha a barra que NÃO colapsa
   (no modo "auto" a barra está display:none; no "always" mostra a pill). */
@media (max-width: 720px) {
    .ggbf-sb:not(.ggbf-sb--auto):not(.ggbf-sb--compact) .ggbf-sb__bar {
        flex-direction: column;
        align-items: stretch;
    }
    .ggbf-sb:not(.ggbf-sb--auto):not(.ggbf-sb--compact) .ggbf-sb__field { width: 100%; min-height: 52px; }
    .ggbf-sb:not(.ggbf-sb--auto):not(.ggbf-sb--compact) .ggbf-sb__divider { width: auto; height: 1px; align-self: stretch; margin: 2px 10px; }
    .ggbf-sb:not(.ggbf-sb--auto):not(.ggbf-sb--compact) .ggbf-sb__submit { width: 100%; margin-top: 4px; }
    .ggbf-sb:not(.ggbf-sb--auto):not(.ggbf-sb--compact) .ggbf-sb__pop,
    .ggbf-sb:not(.ggbf-sb--auto):not(.ggbf-sb--compact) .ggbf-sb__pop--right { left: 0; right: auto; width: 100%; }
    .ggbf-sb:not(.ggbf-sb--auto):not(.ggbf-sb--compact) .ggbf-sb__dp { min-width: 0; width: 100%; }
}

/* ============================================================= *
 *  Blindagem de estados (à prova de tema)                        *
 *  Define explicitamente TODOS os estados visuais com prioridade *
 *  para que regras como `button:hover{color:#fff}` não vazem.    *
 * ============================================================= */

/* Quando um popover está aberto, eleva toda a barra acima de secções/headers
   vizinhos (resolve popovers a aparecer por baixo de outros elementos). */
.ggbf-sb--pop-open { position: relative; z-index: 100050; }

/* Cor de texto sempre explícita (nunca herdar de um :hover do tema) */
.ggbf-sb__unit-name { color: var(--ggbf-sb-pop-color); }
.ggbf-sb__stepper-count { color: var(--ggbf-sb-pop-color); }

/* Campo (segmento clicável). É um <button>, por isso o fundo de botão global
   do tema/Elementor tenta pintá-lo — forçar fundo transparente no estado base.
   (0,1,0)+!important vence qualquer regra global sem !important; o hover (0,1,1)
   e o .is-open (0,2,0) continuam a sobrepor-se a esta base.) */
.ggbf-sb__field { background-color: transparent !important; background-image: none !important; }
.ggbf-sb__field:hover,
.ggbf-sb__field:focus { background-color: var(--ggbf-sb-field-hover-bg) !important; color: inherit !important; }
.ggbf-sb__field.is-open { background-color: var(--ggbf-sb-field-active-bg) !important; }

/* Stepper +/- (Adultos/Crianças/Bebés) — todos os estados */
.ggbf-sb__stepper-btn {
    background-color: #fff !important;
    color: var(--ggbf-sb-accent) !important;
    border-color: color-mix(in srgb, var(--ggbf-sb-accent) 45%, #d1d5db) !important;
    text-decoration: none !important;
}
.ggbf-sb__stepper-btn:hover:not([disabled]),
.ggbf-sb__stepper-btn:focus:not([disabled]) {
    background-color: var(--ggbf-sb-accent-soft) !important;
    color: var(--ggbf-sb-accent) !important;
    border-color: var(--ggbf-sb-accent) !important;
}
.ggbf-sb__stepper-btn:active:not([disabled]) { transform: scale(.94); }
.ggbf-sb__stepper-btn[disabled] { opacity: .4 !important; background-color: #fff !important; color: var(--ggbf-sb-accent) !important; }

/* Lista de unidades — hover/focus/seleção (corrige texto a ficar branco) */
.ggbf-sb__unit { background-color: transparent !important; color: var(--ggbf-sb-pop-color) !important; border-radius: var(--ggbf-sb-field-radius) !important; }
.ggbf-sb__unit:hover,
.ggbf-sb__unit:focus { background-color: var(--ggbf-sb-field-hover-bg) !important; color: var(--ggbf-sb-pop-color) !important; }
.ggbf-sb__unit:hover .ggbf-sb__unit-name,
.ggbf-sb__unit:focus .ggbf-sb__unit-name { color: var(--ggbf-sb-pop-color) !important; }
.ggbf-sb__unit.is-selected { background-color: var(--ggbf-sb-accent-soft) !important; }
.ggbf-sb__unit.is-selected .ggbf-sb__unit-name { color: var(--ggbf-sb-accent) !important; }
.ggbf-sb__unit-cap { color: var(--ggbf-sb-label-color) !important; }

/* Botão primário / pill — manter cor do texto e fundo */
.ggbf-sb__submit { background-color: var(--ggbf-sb-btn-bg) !important; color: var(--ggbf-sb-btn-color) !important; }
.ggbf-sb__submit:hover:not([disabled]),
.ggbf-sb__submit:focus:not([disabled]) { background-color: var(--ggbf-sb-btn-bg-hover) !important; color: var(--ggbf-sb-btn-color) !important; }
.ggbf-sb__submit-text, .ggbf-sb__submit-icon { color: inherit !important; }
/* CTA circular do modo compacto (pill): mesma blindagem do botão primário,
   para o tema não sobrepor a cor definida no Elementor. */
.ggbf-sb__pill-cta { background-color: var(--ggbf-sb-btn-bg) !important; color: var(--ggbf-sb-btn-color) !important; }
.ggbf-sb__pill-cta svg { color: inherit !important; }
/* Pill compacta — também é um <button>, por isso o fundo de botão global do
   tema/Elementor tenta pintá-la (só acontece no modo compacto; a barra desktop
   é um <div>). Forçar o fundo da BARRA (branco por defeito, sobreposto pelo
   controlo "Barra → Fundo" do Elementor via --ggbf-sb-bg) em TODOS os estados,
   incluindo o de repouso — (0,1,0)+!important vence a regra global do botão. */
.ggbf-sb__pill,
.ggbf-sb__pill:hover,
.ggbf-sb__pill:focus { background-color: var(--ggbf-sb-bg) !important; color: inherit !important; }
.ggbf-sb__pill-title { color: var(--ggbf-sb-value-color) !important; }
.ggbf-sb__pill-sub { color: var(--ggbf-sb-label-color) !important; }

/* Cabeçalho/ações do sheet */
.ggbf-sb__sheet-close { background-color: var(--ggbf-sb-field-hover-bg) !important; color: var(--ggbf-sb-value-color) !important; }
.ggbf-sb__sheet-close:hover { background-color: var(--ggbf-sb-field-active-bg) !important; color: var(--ggbf-sb-value-color) !important; }
.ggbf-sb__ghost-btn { color: var(--ggbf-sb-label-color) !important; background-color: transparent !important; }
.ggbf-sb__ghost-btn:hover { color: var(--ggbf-sb-value-color) !important; background-color: var(--ggbf-sb-field-hover-bg) !important; }

/* ============================================================= *
 *  Ajustes finos (ronda): unidade, calendário, header do drawer  *
 * ============================================================= */

/* (#3) Unidade: nome + capacidade numa coluna alinhada à ESQUERDA;
   o "check" de seleção fica à direita. */
.ggbf-sb__unit { align-items: center; }
.ggbf-sb__unit-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}
.ggbf-sb__unit-name { width: 100%; }
.ggbf-sb__unit-cap--warn { color: #b91c1c !important; }

/* (#4 + #5) Picker de datas na barra — layout limpo, desktop + mobile.
   Cabeçalho compacto sem fundo cinzento; mês SEMPRE visível (corrige o mês
   branco herdado do @media do formulário no mobile). */
.ggbf-sb .ggbf-calendar-header {
    background: transparent !important;
    border-bottom: 0 !important;
    padding: 2px 2px 8px !important;
}
.ggbf-sb .ggbf-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ggbf-sb .ggbf-calendar-month-year {
    color: var(--ggbf-sb-pop-color) !important;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    flex: 1 1 auto;
    min-width: 0;
}
.ggbf-sb .ggbf-calendar-nav-btn { color: var(--ggbf-sb-pop-color) !important; }
.ggbf-sb .ggbf-calendar-grid { padding: 0 2px; }
.ggbf-sb .ggbf-calendar-weekdays,
.ggbf-sb .ggbf-calendar-days { width: 100%; }

/* (#4) Rodapé do calendário no desktop: apenas "Limpar" (sem botão cancelar). */
.ggbf-sb__pop--dates .ggbf-datepicker-apply-close { display: none !important; }
.ggbf-sb__pop--dates .ggbf-datepicker-footer {
    padding: 8px 6px 4px;
    border-top: 1px solid var(--ggbf-sb-divider-color);
    background: transparent;
}
.ggbf-sb__pop--dates .ggbf-datepicker-footer-actions { width: 100%; justify-content: flex-start; }
.ggbf-sb__pop--dates .ggbf-datepicker-clear {
    color: var(--ggbf-sb-accent) !important;
    background: transparent !important;
    border: 0 !important;
    padding: 6px 8px !important;
    font-weight: 600;
}

/* (#6) Drawer: header minimal, compacto e sempre presente. */
.ggbf-sb__sheet-grabber { top: 6px; }
.ggbf-sb__sheet-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--ggbf-sb-divider-color);
}
.ggbf-sb__sheet-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
