/* Página pública (/{slug}) e "minha reserva" (/reserva). Estende base.css.
   A cor do negócio chega por applyBrand(): --brand, --brand-ink (texto sobre a marca) e --brand-soft. */

.pub-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  --brand-deep: color-mix(in srgb, var(--brand) 62%, #14211d);
  --brand-line: color-mix(in srgb, var(--brand) 55%, var(--c-border));
  /* borda das peças pintadas com a marca: marca clara (ex.: branco) não some no fundo branco */
  --brand-edge: color-mix(in srgb, var(--brand) 72%, #14211d);
}
/* o 1º outline é para navegador sem color-mix (ele ignora o 2º); sem isso o box-shadow: none sumia com o foco */
.pub-body :focus-visible { outline: 3px solid var(--c-text); outline: 3px solid color-mix(in srgb, var(--brand) 55%, #14211d); outline-offset: 2px; box-shadow: none; }
.pub-body .btn-brand { border-color: var(--brand-edge); }
/* links de texto (botões e chips têm cor própria) */
.pub-body :where(a:not(.btn, .chip)) { color: var(--c-text); }
.pub-body :where(a:not(.btn, .chip)):hover { color: var(--brand-deep); }
.pub-body .btn-block { white-space: normal; text-align: center; line-height: 1.25; }
.pub-body .btn .spinner { width: 18px; height: 18px; border-width: 2px; }
/* base.css troca o raio no foco; aqui cada peça mantém o seu */
.pub-body .btn:focus-visible, .pub-body .chip:focus-visible { border-radius: var(--radius-pill); }
.pub-body .sp-nav:focus-visible, .pub-body .back-btn:focus-visible { border-radius: 50%; }
.pub-body .input:focus-visible, .pub-body .textarea:focus-visible { border-radius: var(--radius-sm); }
.pub-body .link-btn:focus-visible { border-radius: 8px; }

/* ------------------------------------------------------------ faixa de demonstração */
.demo-bar {
  position: relative; z-index: 2;
  padding: 6px 16px; text-align: center;
  font-size: 0.8rem; line-height: 1.4;
  background: #14211d; color: #fff;
}
.demo-bar strong { font-weight: 700; letter-spacing: 0.02em; }

/* ------------------------------------------------------------ capa e cabeçalho do negócio */
.pub-cover {
  flex: none;
  height: 150px;
  background-color: var(--brand);
  background-image:
    radial-gradient(110% 150% at 0% 0%, rgb(255 255 255 / 20%), transparent 55%),
    radial-gradient(80% 120% at 100% 100%, rgb(0 0 0 / 16%), transparent 60%);
}
.pub-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: -104px auto 0;
  padding: 0 16px 8px;
  flex: 1;
}

.biz-card {
  position: relative;
  margin-top: 48px;
  padding: 58px 20px 22px;
  text-align: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.biz-avatar {
  position: absolute; top: -46px; left: 50%;
  transform: translateX(-50%);
  width: 92px; height: 92px;
  display: grid; place-items: center;
  overflow: hidden;
  border: 4px solid var(--c-surface);
  border-radius: 26px;
  background: var(--brand);
  color: var(--brand-ink);
  font: 800 2rem/1 var(--font-head);
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
}
.biz-avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.biz-name {
  margin: 0 0 6px;
  font-family: var(--font-head); font-weight: 800;
  font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.biz-desc {
  max-width: 44ch; margin: 0 auto 14px;
  color: var(--c-muted); font-size: 0.95rem;
  white-space: pre-line; overflow-wrap: anywhere;
}
.biz-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.biz-desc + .biz-meta { margin-top: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; min-height: 36px; padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--c-surface-2);
  font-size: 0.875rem; font-weight: 500; line-height: 1.3;
  text-align: left; text-decoration: none;
}
.pub-body .chip { color: var(--c-text); }
.pub-body .chip:hover { background: #e2eae6; color: var(--c-text); }
.chip svg { flex: none; }
.chip span { overflow-wrap: anywhere; }
.pub-body .chip-wa { background: #e6f6ed; color: #136a37; }
.pub-body .chip-wa:hover { background: #d3efdf; color: #136a37; }

.biz-card.is-compact { padding: 46px 16px 16px; }
.biz-card.is-compact .biz-avatar { top: -36px; width: 72px; height: 72px; border-radius: 20px; font-size: 1.55rem; }
.biz-card.is-compact .biz-name { font-size: 1.2rem; }
.biz-card.is-compact .biz-meta { margin-top: 10px; }

/* ------------------------------------------------------------ cartão do agendamento */
.book-card {
  margin-top: 16px;
  padding: 20px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 12px;
}

/* indicador de progresso */
.stepper { display: flex; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.stepper li { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--c-muted); }
.stepper .bar { height: 4px; border-radius: 4px; background: var(--c-border); transition: background-color .25s; }
.stepper li.is-done .bar, .stepper li[aria-current="step"] .bar { background: var(--brand); }
.stepper li[aria-current="step"] { color: var(--c-text); }
.stepper .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.step-title { margin: 0; font-size: 1.25rem; font-weight: 700; }
.step-title:focus, .done-title:focus, .confirm-title:focus { outline: none; box-shadow: none; }
.step-sub { margin: 4px 0 16px; color: var(--c-muted); font-size: 0.925rem; }
.step-head + .picked, .step-head + .summary { margin-top: 14px; }
.step-alert:not(:empty) { margin: 14px 0; }

.back-btn {
  flex: none; width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--c-border); border-radius: 50%;
  background: var(--c-surface); color: var(--c-text);
  cursor: pointer;
}
.back-btn:hover { border-color: var(--c-muted); }

.link-btn {
  flex: none; padding: 6px 8px;
  border: 0; border-radius: 8px; background: none;
  font: 600 0.875rem/1.2 var(--font-body); color: var(--c-text);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--brand-deep); }

.alert-icon { display: flex; gap: 10px; align-items: flex-start; }
.alert-icon svg { flex: none; margin-top: 2px; }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px 0 0; padding: 12px 14px;
  border-radius: 12px; background: var(--c-surface-2);
  font-size: 0.9rem; line-height: 1.45;
}
.note svg { flex: none; margin-top: 1px; color: var(--c-muted); }

/* ------------------------------------------------------------ passo 1: serviços */
.service-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.service-card {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--c-border); border-radius: 16px;
  background: var(--c-surface); color: var(--c-text);
  font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.service-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.service-card:active { transform: translateY(1px); }
.service-card:focus-visible { border-radius: 16px; }
.svc-body { flex: 1; min-width: 0; }
.svc-name { display: block; font: 700 1.02rem/1.3 var(--font-head); overflow-wrap: anywhere; }
.svc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 0.875rem; color: var(--c-muted); }
.svc-dur { display: inline-flex; align-items: center; gap: 5px; }
.svc-price { color: var(--c-text); font-weight: 600; }
.svc-desc { display: block; margin-top: 6px; font-size: 0.875rem; color: var(--c-muted); line-height: 1.45; overflow-wrap: anywhere; }
.svc-go {
  flex: none; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep);
  transition: background-color .15s, color .15s;
}
.service-card:hover .svc-go { background: var(--brand); color: var(--brand-ink); }

/* serviço escolhido (passo 2) */
.picked {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 18px; padding: 10px 12px;
  border-radius: 14px; background: var(--brand-soft);
}
.picked-icon {
  flex: none; width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px; background: var(--c-surface); color: var(--brand-deep);
}
.picked .p-body { flex: 1; min-width: 0; line-height: 1.35; }
.picked strong { display: block; font-size: 0.95rem; overflow-wrap: anywhere; }
.picked .p-meta { display: block; font-size: 0.85rem; color: var(--c-muted); }

/* ------------------------------------------------------------ escolha de dia + horário */
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sp-range { margin: 0; font-weight: 600; font-size: 0.95rem; text-align: center; }
.sp-nav {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--c-border); border-radius: 50%;
  background: var(--c-surface); color: var(--c-text);
  cursor: pointer;
}
.sp-nav:hover:not(:disabled) { border-color: var(--c-muted); }
.sp-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.sp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sp-day {
  min-width: 0; min-height: 66px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 6px 0;
  border: 1px solid var(--c-border); border-radius: 12px;
  background: var(--c-surface); color: var(--c-text);
  font: inherit; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.sp-day:hover:not(:disabled) { border-color: var(--brand-line); }
.sp-day .wd { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-muted); }
.sp-day .dn { font: 700 1.15rem/1.15 var(--font-head); }
.sp-day .mo { font-size: 0.68rem; color: var(--c-muted); }
.sp-day[aria-pressed="true"] { background: var(--brand); border-color: var(--brand-edge); color: var(--brand-ink); }
.sp-day[aria-pressed="true"] .wd, .sp-day[aria-pressed="true"] .mo { color: inherit; opacity: 0.85; }
.sp-day:disabled { cursor: not-allowed; background: transparent; border-style: dashed; }
.sp-day:disabled .dn { color: #9aa8a2; font-weight: 600; }
.sp-day:disabled .wd, .sp-day:disabled .mo { color: #a7b3ae; }
.sp-day.is-loading { border-style: solid; border-color: var(--c-border); background: var(--c-surface-2); }
.sp-day.is-loading > * { opacity: 0.55; }
.sp-day:focus-visible { border-radius: 12px; }

.sp-body { min-height: 150px; }
.sp-date-title { margin: 20px 0 12px; font: 700 1rem/1.3 var(--font-head); }
.sp-group + .sp-group { margin-top: 16px; }
.sp-group-title { margin: 0 0 8px; font: 600 0.75rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-muted); }
.sp-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.sp-slot {
  position: relative; min-height: 46px;
  border: 1px solid var(--c-border); border-radius: 12px;
  background: var(--c-surface); color: var(--c-text);
  font: 600 0.975rem/1 var(--font-body); font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.sp-slot:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.sp-slot[aria-pressed="true"],
.sp-slot[aria-pressed="true"]:hover { background: var(--brand); border-color: var(--brand-edge); color: var(--brand-ink); }
.sp-slot:focus-visible { border-radius: 12px; }
.sp-slot.is-current { cursor: default; border-style: dashed; color: var(--c-muted); background: var(--c-surface-2); }
.sp-cur { display: block; margin-top: 3px; font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.sp-skeleton .sk-date { width: 55%; height: 20px; margin: 22px 0 14px; }
.sp-skeleton .sk-slot { height: 46px; border-radius: 12px; }

.sp-empty { padding: 28px 8px 8px; text-align: center; }
.sp-empty-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 18px; background: var(--brand-soft); color: var(--brand-deep);
}
.sp-empty-title { margin: 0 0 4px; font: 700 1.05rem/1.3 var(--font-head); }
.sp-empty .btn { margin-top: 8px; }
.sp-error { padding-top: 18px; display: grid; gap: 12px; justify-items: start; }
.sp-tz { display: flex; gap: 6px; align-items: center; margin: 16px 0 0; font-size: 0.8rem; color: var(--c-muted); }
.sp-tz svg { flex: none; }

/* barra fixa com o horário escolhido */
.sticky-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  margin: 20px -16px -20px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgb(255 255 255 / 95%);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-top: 1px solid var(--c-border);
  border-radius: 0 0 22px 22px;
  animation: bar-in .2s ease-out;
}
@keyframes bar-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sticky-bar .sel { flex: 1; min-width: 0; line-height: 1.3; }
.sel-label { display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-muted); }
.sel-value { display: block; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-bar .btn { flex: none; }

/* ------------------------------------------------------------ passo 3: seus dados */
.summary {
  position: relative;
  display: grid; gap: 8px;
  margin: 0 0 20px; padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}
.summary-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; line-height: 1.4; }
.summary-row svg { flex: none; margin-top: 1px; color: var(--brand-deep); }
.summary-row span { min-width: 0; overflow-wrap: anywhere; }
.summary-edit { justify-self: start; margin: 2px 0 0 20px; }

.details-form .optional { font-weight: 400; color: var(--c-muted); }
.details-form .input:focus, .details-form .textarea:focus {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
  outline: none;
}
.details-form .error-text { margin: 0; }
.details-form .hint { margin: 0; }
.honey { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-actions { margin-top: 20px; }
.fine { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: 0.825rem; color: var(--c-muted); line-height: 1.45; }
.fine svg { flex: none; margin-top: 2px; }
.fine a { color: var(--c-muted); font-weight: 600; }

/* ------------------------------------------------------------ passo 4: confirmado */
.done-hero { padding: 6px 0 18px; text-align: center; }
.done-hero p { margin: 0; }
.done-icon {
  width: 68px; height: 68px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 0 0 8px var(--brand-soft);
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
.done-title { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; }

.ticket { border: 1px solid var(--c-border); border-radius: 16px; background: var(--c-surface); }
.ticket-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; }
.ticket-row + .ticket-row { border-top: 1px dashed var(--c-border); }
.ticket-icon {
  flex: none; width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep);
}
.t-body { min-width: 0; line-height: 1.35; }
.t-label { display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-muted); }
.t-value { display: block; margin-top: 2px; font-weight: 600; overflow-wrap: anywhere; }
.t-sub { display: block; margin-top: 2px; font-size: 0.875rem; color: var(--c-muted); overflow-wrap: anywhere; }
.t-sub a { color: var(--c-muted); }
.ticket.is-cancelled .t-value { color: var(--c-muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ticket.is-cancelled .ticket-icon { background: var(--c-surface-2); color: var(--c-muted); }

.wa-sent {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px 0 0; padding: 12px 14px;
  border-radius: 12px; background: var(--c-success-50);
  color: var(--c-success); font-weight: 600; font-size: 0.925rem; text-align: center;
}
.wa-sent svg { flex: none; }
.wa-save { margin-top: 16px; }
.wa-save .hint { margin: 8px 0 0; font-size: 0.825rem; color: var(--c-muted); text-align: center; }

.actions { display: grid; gap: 10px; margin-top: 16px; }
.wa-ico { display: inline-flex; }
.btn-outline .wa-ico { color: #1fa855; }

/* ------------------------------------------------------------ minha reserva */
.res-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.res-head .step-title { font-size: 1.35rem; }
.res-head + .alert { margin-bottom: 16px; }
.res-msg { margin: 16px 0 0; }
.ticket + .alert { margin-top: 16px; }

.cancel-host:empty { display: none; }
.confirm-panel { padding: 16px; border: 1px solid #efc9c5; border-radius: 14px; background: var(--c-danger-50); }
.confirm-title { margin: 0 0 6px; font-size: 1.05rem; color: #8e2a24; }
.confirm-panel p { margin: 0 0 12px; font-size: 0.925rem; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.confirm-actions .btn { flex: 1 1 140px; }

/* ------------------------------------------------------------ vazio / não encontrado / erro */
.empty-state { padding: 36px 20px; text-align: center; }
.empty-state p { max-width: 40ch; margin-left: auto; margin-right: auto; }
.empty-state .btn { margin-top: 4px; }
.empty-icon {
  width: 72px; height: 72px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 22px; background: var(--brand-soft); color: var(--brand-deep);
}
.empty-icon.is-warning { background: var(--c-warning-50); color: #9a6212; }
.empty-title { font-size: 1.5rem; margin-bottom: 8px; }

/* esqueleto do carregamento inicial (está no HTML) */
.biz-card.is-skeleton .biz-avatar { border-color: var(--c-surface); }
.sk-line { height: 14px; width: 70%; margin: 10px auto 0; }
.sk-title { height: 24px; width: 55%; margin-top: 0; }
.sk-short { width: 40%; }
.sk-left { margin-left: 0; }
.sk-block { height: 64px; margin-top: 12px; border-radius: 14px; }
.sk-bar { height: 4px; margin-bottom: 20px; }

/* ------------------------------------------------------------ rodapé */
.pub-footer {
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center; font-size: 0.85rem; color: var(--c-muted);
}
.pub-footer a { color: inherit; font-weight: 600; }
.pub-footer .sep { margin: 0 6px; opacity: 0.6; }
.noscript { max-width: 560px; margin: 16px auto; padding: 16px; text-align: center; }

/* ------------------------------------------------------------ telas maiores */
@media (min-width: 480px) {
  .biz-card { padding-left: 28px; padding-right: 28px; }
  .book-card { padding: 24px; }
  .sticky-bar { margin: 24px -24px -24px; padding-left: 24px; padding-right: 24px; }
  .sp-days { gap: 8px; }
  .sp-day .wd, .sp-day .mo { font-size: 0.72rem; }
  .sp-day .dn { font-size: 1.25rem; }
}
@media (min-width: 720px) {
  .pub-cover { height: 180px; }
  .pub-wrap { margin-top: -120px; }
}
