/* Tema compartilhado de todas as telas. A cor do estabelecimento vem de --bm-primary. */
:root {
  --bm-primary: #0d6efd;
  --bm-success: #198754;
  --bm-danger: #dc3545;
  --bm-surface: #fff;
  --bm-background: #f5f5f7;
  --bm-border: #e5e5ea;
  --bm-muted: #6e6e73;
  --bm-text: #1d1d1f;
  --bm-shadow: 0 8px 32px rgba(0, 0, 0, .045);
  --bm-radius: 24px;
  --bm-bottom-clearance: 0px;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bm-background);
  color: var(--bm-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button, a, input, select { touch-action: manipulation; }
[hidden], [data-pwa-install][hidden] { display: none !important; }
body > main, body > .container { flex: 1 0 auto; }
.container.py-5 {
  width: 100%;
  max-width: 620px;
  padding: 32px 20px !important;
}
h1 { margin-bottom: 8px; font-size: clamp(26px, 5vw, 32px); font-weight: 700; letter-spacing: -.8px; }
h2, h4, h5 { font-weight: 600; letter-spacing: -.4px; line-height: 1.3; }
h5 { font-size: 21px; }
.text-muted, .selecionados { color: var(--bm-muted) !important; }
.selecionados { margin: 0 auto 24px; font-size: 14px; overflow-wrap: anywhere; }
.topo { position: absolute; inset: 0 0 auto; height: 112px; background: var(--bm-primary); pointer-events: none; }
#logo {
  position: relative;
  display: block;
  width: 88px;
  height: 88px;
  margin: auto;
  object-fit: cover;
  border: 4px solid #fff;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}
.step-indicator { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 20px; }
.step-indicator a { display: grid; min-width: 36px; min-height: 44px; place-items: center; text-decoration: none; }
.step { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #e8e8ed; color: #626267; font-size: 12px; font-weight: 600; }
.step.active { background: var(--bm-primary); color: #fff; }
.card-calendar, .card-lista, .card-horarios, .card-dados, .sucesso-box, .location-card, #webpush-permission-card {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, .045);
  border-radius: var(--bm-radius);
  background: var(--bm-surface);
  color: var(--bm-text);
  box-shadow: var(--bm-shadow);
}
.card-calendar, .location-card, #webpush-permission-card { max-width: 440px; }
.card-dados { text-align: left; }
.card, .list-group-item { border: 1px solid var(--bm-border); border-radius: 16px !important; background: var(--bm-surface); box-shadow: var(--bm-shadow); }
.list-group-item { padding: 20px; }
.card-title { font-size: 14px; color: var(--bm-muted); }
.booking-intro { color: var(--bm-muted); font-size: 15px; margin: 0 0 28px; }
.booking-title { margin: 0 0 6px; font-size: 21px; font-weight: 700; letter-spacing: -.5px; text-align: left; }
.booking-hint { margin: 0 0 22px; font-size: 13px; color: var(--bm-muted); text-align: left; }

/* Campos e ações */
.form-control, .form-select, .inputsInfor, .novaData {
  min-height: 50px;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid #dcdce2;
  border-radius: 14px;
  background-color: #fafafa;
  color: var(--bm-text);
  font-size: 16px;
}
.form-control:focus, .form-select:focus, .inputsInfor:focus, .novaData:focus { border-color: var(--bm-primary); background-color: #fff; color: var(--bm-text); box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
.form-label { font-size: 14px; font-weight: 500; color: #424247; }
.form-check-input { flex-shrink: 0; width: 20px; height: 20px; margin: 0 12px 0 0; accent-color: var(--bm-primary); }
.form-check-input:checked { background-color: var(--bm-primary); border-color: var(--bm-primary); }
.btn, .botao { min-height: 48px; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; }
.btn-primary, .btn-outline-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--bm-primary);
  --bs-btn-border-color: var(--bm-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--bm-primary);
  --bs-btn-hover-border-color: var(--bm-primary);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--bm-primary);
  --bs-btn-active-border-color: var(--bm-primary);
}
.btn-outline-primary { --bs-btn-color: var(--bm-primary); --bs-btn-bg: transparent; }
.btn:disabled, .btn.disabled { background: #e8e8ed; border-color: #e8e8ed; color: #737378; opacity: 1; }
.btn-secondary, .btn-light { background: #f0f0f3; border-color: #e5e5ea; color: #424247; }
.btn-secondary:hover, .btn-light:hover { background: #e5e5ea; border-color: #dcdce2; color: #1d1d1f; }
.btn-success { background: var(--bm-success); border-color: var(--bm-success); }
.btn-danger { background: var(--bm-danger); border-color: var(--bm-danger); }
#advanceButton { width: 100%; min-height: 54px; border: 0; font-size: 16px; }
button, .btn, .botao, .agenda-actions a, .prof-card, .servico-card { transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .prof-card:focus-visible { outline: 3px solid #1d1d1f; outline-offset: 4px; }
button:enabled:active, .agenda-actions a:active { transform: scale(.98); }
.bm-loading, .bm-empty, .bm-error { width: 100%; padding: 20px; border: 1px dashed var(--bm-border); border-radius: 16px; background: #f5f5f7; color: var(--bm-muted); text-align: center; }
.bm-error { color: #b42318; background: #fff5f5; border-color: #f3cccc; }
.initially-hidden { display: none; }
.helper-note, .professional-status { color: var(--bm-muted); font-size: 12px; }
.professional-status { margin-top: 5px; }
.status-unavailable { color: var(--bm-danger); }
.status-available { color: var(--bm-success); }
.centered-input { text-align: center; }

/* Seleção de datas */
.date-suggestions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.date-option { min-width: 0; min-height: 94px; padding: 12px 2px; border: 1px solid var(--bm-border); border-radius: 16px; background: #fafafa; color: var(--bm-text); line-height: 1.1; cursor: pointer; }
.date-option-week, .date-option-month { display: block; font-size: 11px; font-weight: 500; }
.date-option-day { display: block; margin: 7px 0; font-size: 25px; font-weight: 600; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.date-option.is-selected { background: var(--bm-primary); border-color: var(--bm-primary); color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .10); }
.date-option:disabled, .date-option.is-unavailable { background: #f5f5f7; border-color: transparent; color: #737378; opacity: 1; box-shadow: none; cursor: not-allowed; }
.booking-date-field { position: relative; margin-bottom: 18px; }
.calendar-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 12px; border: 1px solid #dcdce2; border-radius: 14px; background: #f5f5f7; color: var(--bm-text); font-size: 14px; font-weight: 600; cursor: pointer; }
.calendar-button svg { width: 22px; height: 22px; flex-shrink: 0; stroke-width: 1.7; }
/* O toque chega ao input nativo, inclusive no Safari do iPhone. */
.booking-home #bookingDate {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: .001;
  cursor: pointer;
}
.booking-home #bookingDate:not(.is-visible)::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.booking-home #bookingDate.is-visible {
  position: static;
  width: 100%;
  height: auto;
  min-height: 52px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #dcdce2;
  opacity: 1;
  cursor: auto;
}
.booking-date-field:focus-within .calendar-button {
  outline: 3px solid var(--bm-text);
  outline-offset: 4px;
}
.booking-date-field:hover .calendar-button { background: #ededf0; }

.selected-date { margin: 0 0 18px; padding: 12px; border-radius: 12px; background: #f5f5f7; font-size: 13px; font-weight: 500; }
.date-unavailable-message { display: none; margin: -8px 0 14px; color: var(--bm-danger); font-size: 12px; }
.date-unavailable-message.is-visible { display: block; }

/* Profissionais, serviços e horários */
.prof-card, .servico-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--bm-border); border-radius: 16px; background: #fafafa; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.prof-card > div > div, .servico-card > div, .servico-card > div > div { min-width: 0; }
.prof-card-disabled, .prof-card.prof-card-disabled:hover { background: #f5f5f7; border-color: var(--bm-border); opacity: .65; cursor: not-allowed; }
.prof-img { width: 72px; height: 72px; flex-shrink: 0; object-fit: cover; border-radius: 20px; }
.service-image { width: 60px; height: 60px; flex-shrink: 0; object-fit: cover; border-radius: 14px; }
.servico-card.promocao-ativa { border-color: #b7dec7; background: #f6fbf8; }
.servico-card:has(input:checked) { border-color: var(--bm-primary); box-shadow: inset 0 0 0 1px var(--bm-primary); }
.servico-card:focus-within { outline: 2px solid var(--bm-primary); outline-offset: 3px; }
.badge-promocao { display: inline-block; margin-left: 6px; padding: 3px 8px; border-radius: 8px; background: var(--bm-success); color: #fff; font-size: 11px; font-weight: 600; vertical-align: middle; }
.preco-original { color: var(--bm-muted); text-decoration: line-through; }
.preco-promocional { color: var(--bm-success); font-weight: 700; }
.servicos-filtros { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 18px; text-align: left; }
.page-services { --bm-bottom-clearance: calc(90px + env(safe-area-inset-bottom)); }
/* Mantém os últimos serviços acima do botão fixo Avançar. */
.page-services > .container.py-5 {
  padding-bottom: calc(32px + var(--bm-bottom-clearance)) !important;
}
.page-services #btn-avancar {
  min-height: 54px;
  border: 3px solid #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
}

.btn-flutuante { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 40px), 500px); z-index: 1030; display: none; box-shadow: 0 6px 24px rgba(0, 0, 0, .16); }
button.btn-flutuante:enabled:active { transform: translateX(-50%) scale(.98); }
body.has-agenda-app-cta .btn-flutuante { bottom: calc(72px + env(safe-area-inset-bottom)); }
#horarios-container { width: 100%; min-width: 0; margin: auto; padding: 12px 0 20px; }
.horario-btn { min-width: 74px; margin: 4px; padding: 10px 12px; }
#horarios-container input:checked + .horario-btn { background: var(--bm-primary); border-color: var(--bm-primary); color: #fff; }
#horarios-container input:focus-visible + .horario-btn { outline: 3px solid var(--bm-text); outline-offset: 3px; }
.inputsInfor { display: block; width: 100%; margin: 10px auto; }
#btnAgendar { width: 100%; margin-top: 14px; }
.novaData { display: block; width: 100%; margin: 12px auto; text-align: center; }
#form-horarios { min-height: 0; }
#sem-horarios .form-label { font-size: 18px; }
.servicos-atuais { max-width: 560px; margin: 0 auto 18px; padding-inline: 0 !important; text-align: left; }
.servicos-atuais-cabecalho { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.servicos-total { padding: 6px 10px; border-radius: 12px; background: #f0f0f3; color: #424247; font-size: 13px; font-weight: 700; white-space: nowrap; }
.servico-atual { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin-top: 8px; background: #f5f5f7; border: 1px solid var(--bm-border); border-radius: 14px; }
.servico-atual > div { min-width: 0; overflow-wrap: anywhere; }
.servico-atual small { color: var(--bm-muted); }
.upsell-faixa { margin: 0 0 18px; padding: 14px; background: #f5f5f7; border: 1px solid var(--bm-border); border-radius: 16px; text-align: left; }
.upsell-faixa h6 { margin-bottom: 3px; }
.upsell-faixa > small { display: block; margin-bottom: 12px; color: var(--bm-muted); }
.upsell-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.upsell-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 9px; align-items: center; text-align: left; padding: 10px; border: 1px solid var(--bm-border); border-radius: 14px; background: #fff; color: var(--bm-text); cursor: pointer; overflow: hidden; }
.upsell-card[aria-disabled="true"] { opacity: .65; pointer-events: none; }
.upsell-card img, .upsell-foto-vazia { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.upsell-foto-vazia { display: flex; align-items: center; justify-content: center; background: #f5f5f7; color: var(--bm-muted); font-size: 10px; text-align: center; }
.upsell-info { min-width: 0; overflow: hidden; font-size: 13px; line-height: 1.3; }
.upsell-info strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.upsell-info small { display: block; margin-top: 4px; color: var(--bm-muted); font-size: 11px; }
.upsell-cta { grid-column: 1 / -1; display: block; padding: 8px; border-radius: 10px; background: #f0f0f3; color: #424247; font-size: 12px; font-weight: 600; text-align: center; }
#upsell-feedback { min-height: 20px; }

/* Ações secundárias, localização e instalação */
.agenda-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 440px; margin: 18px auto 0; }
.meusAgendamentos, .home-screen-button { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 56px; padding: 11px 8px; border: 1px solid var(--bm-border); border-radius: 16px; background: #fff; color: #424247; font-size: 13px; font-weight: 500; line-height: 1.4; text-decoration: none; }
.meusAgendamentos svg, .home-screen-button svg { width: 19px; height: 19px; flex-shrink: 0; stroke-width: 1.7; }
.home-screen-button { grid-column: 1 / -1; width: 100%; min-height: 44px; margin: 0; border-color: transparent; background: transparent; color: #626267; }
.location-card { margin-top: 24px; padding: 20px; text-align: left; }
.location-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.location-card-header svg { width: 22px; flex: 0 0 22px; color: var(--bm-primary); }
.location-card h2 { margin: 0 0 3px; font-size: 16px; font-weight: 700; }
.location-card address { margin: 0; color: var(--bm-muted); font-size: 13px; font-style: normal; line-height: 1.6; overflow-wrap: anywhere; }
.location-map { display: block; width: 100%; height: 220px; border: 0; border-radius: 16px; }
.location-link { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 10px; color: #424247; font-size: 13px; font-weight: 600; text-align: center; text-decoration: none; }
.instagram { display: flex; justify-content: center; margin-top: 24px; }
.instagram-media { width: 100%; max-width: 440px; border: 0; border-radius: 24px; box-shadow: var(--bm-shadow); }
.instagram-media iframe, .instagram-media img { width: 100%; border-radius: 24px; }
body.has-agenda-app-cta { --bm-bottom-clearance: calc(56px + env(safe-area-inset-bottom)); }
body.page-services.has-agenda-app-cta { --bm-bottom-clearance: calc(146px + env(safe-area-inset-bottom)); }
.agenda-app-cta { position: fixed; inset: auto 0 0; z-index: 1040; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border: 0; background: var(--bm-primary); color: #fff; text-align: center; text-decoration: none; }
.agenda-app-cta:hover, .agenda-app-cta:focus { color: #fff; }
.agenda-app-cta br { display: none; }
.agenda-app-cta__brand { font-size: 12px; font-weight: 700; white-space: nowrap; }
.agenda-app-cta__message { font-size: 13px; font-weight: 500; }

/* Modais e rodapé */
.modal-content { border: 1px solid var(--bm-border); border-radius: 24px; background: #fff; color: var(--bm-text); box-shadow: 0 16px 60px rgba(0, 0, 0, .15); overflow: hidden; }
.modal-header, .modal-body, .modal-footer { padding: 20px; }
.modal-header, .modal-footer { border-color: var(--bm-border); }
.modal-header { text-align: left; }
.modal-footer { gap: 8px; }
.modal-title { font-size: 20px; }
.modal-note { background: #f5f5f7; }
#alertaBloqueio .modal-dialog { margin-top: 15vh; }
#alertaBloqueio .modal-header { background: #fff5db; color: #68501c; }
/* A reserva das ações fixas fica dentro do rodapé, sem faixa vazia abaixo dele. */
body > footer { position: relative; flex-shrink: 0; margin-top: auto; padding: 24px 20px calc(24px + var(--bm-bottom-clearance)); background: var(--bm-primary); color: #fff; font-size: 12px; text-align: center; }
footer a { display: inline-flex; align-items: center; justify-content: center; }
#logoRodape { width: 180px; max-width: 80vw; height: auto; }

/* Confirmação, independente de Bootstrap */
.page-confirmation main { width: 100%; max-width: 480px; margin: auto; padding: 40px 20px calc(24px + env(safe-area-inset-bottom)); text-align: left; }
.page-confirmation header { text-align: center; margin-bottom: 24px; }
.page-confirmation p { line-height: 1.5; margin: 0; }
.page-confirmation .marca { color: var(--bm-muted); font-size: 14px; overflow-wrap: anywhere; }
.sucesso { display: grid; place-items: center; width: 64px; height: 64px; margin: 22px auto 16px; border-radius: 50%; background: #d9efe2; color: #167346; }
.page-confirmation .descricao { margin-top: 12px; color: var(--bm-muted); }
.resumo { padding: 24px; border: 1px solid var(--bm-border); border-radius: 24px; background: #fff; box-shadow: var(--bm-shadow); }
.data-hora { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--bm-border); }
.page-confirmation .rotulo, .page-confirmation dt { display: block; color: var(--bm-muted); font-size: 13px; margin-bottom: 5px; }
.data-hora strong { font-size: 20px; }
.page-confirmation dl { margin: 18px 0 0; }
.page-confirmation dd { margin: 0 0 16px; line-height: 1.4; overflow-wrap: anywhere; }
.page-confirmation dd:last-child { margin-bottom: 0; }
.sinal { margin-top: 16px; padding: 16px; background: #fff5db; border: 1px solid #eed697; border-radius: 16px; color: #68501c; overflow-wrap: anywhere; }
.sinal p { margin-top: 6px; font-size: 14px; }
.page-confirmation .redirecionamento { margin: 24px 0 14px; text-align: center; color: var(--bm-muted); font-size: 14px; }
.contador { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; color: #167346; background: #d9efe2; font-variant-numeric: tabular-nums; }
.botao { display: flex; justify-content: center; align-items: center; min-height: 52px; background: #167346; color: #fff; text-align: center; text-decoration: none; }
.botao:hover { background: #105b36; color: #fff; }
.botao.secundario { margin-top: 10px; background: #e8e8ed; color: #424247; }
.page-confirmation footer { margin-top: 28px; color: var(--bm-muted); font-size: 12px; text-align: center; }

@media (hover: hover) {
  .date-option:not(:disabled):not(.is-selected):hover, .calendar-button:hover, .agenda-actions a:hover, .home-screen-button:hover, .prof-card:not(.prof-card-disabled):hover, .servico-card:hover { background: #ededf0; }
  .btn-primary:enabled:hover, .upsell-card:hover { box-shadow: 0 5px 16px rgba(0, 0, 0, .12); }
}
@media (min-width: 576px) { .servicos-filtros { grid-template-columns: minmax(0, 1fr) 190px; } }
@media (max-width: 575px) {
  .upsell-grid { display: flex; gap: 8px; overflow-x: auto; padding: 1px 1px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .upsell-card { flex: 0 0 170px; scroll-snap-align: start; }
  .agenda-app-cta { flex-wrap: wrap; gap: 2px 8px; }
  .modal-footer .btn { flex: 1 1 auto; }
}
@media (max-width: 374px) {
  .container.py-5 { padding-inline: 12px !important; }
  .card-calendar, .card-lista, .card-horarios, .card-dados { padding: 18px; }
  .date-suggestions { gap: 5px; }
  .date-option { border-radius: 12px; }
  .prof-img { width: 56px; height: 56px; border-radius: 16px; }
  .service-image { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  button:enabled:active, .agenda-actions a:active { transform: none; }
  button.btn-flutuante:enabled:active { transform: translateX(-50%); }
}

/* Estados iniciais controlados pelos scripts existentes via style.display. */
#form-profissional #btn-avancar, #upsell-faixa, #sem-horarios, #wl_feedback { display: none; }
.page-booking input[type="date"], .page-booking-legacy input[type="date"], .page-appointments input[name="contato"] { text-align: center; }
.page-appointments h1 { margin-bottom: 24px; }
.page-appointments .list-group-item .text-start { overflow-wrap: anywhere; }
