/* ============================================================
   Booking — Interface pública de agendamento
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────────── */
.booking-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────── */
.booking-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.biz-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.biz-logo {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}

.biz-name { font-weight: 700; font-size: 1rem; }
.biz-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ── Conteúdo principal ─────────────────────────────────────── */
.booking-main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
}

/* ── Steps indicator ────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition);
}

.step.active .step-circle  { background: var(--green); border-color: var(--green); color: #fff; }
.step.done .step-circle    { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }

.step-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.step.active .step-label { color: var(--green); font-weight: 600; }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-bottom: 1.2rem;
  min-width: 24px;
  max-width: 60px;
  transition: background var(--transition);
}

.step-line.done { background: var(--green-dark); }

/* ── Calendário público ─────────────────────────────────────── */
.pub-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.pub-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.pub-cal-day-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.35rem 0;
}

.pub-cal-day {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  position: relative;
  gap: 0.15rem;
}

.pub-cal-day.available { background: var(--bg-card); border-color: var(--border); }
.pub-cal-day.available:hover { border-color: var(--green); background: rgba(34,197,94,0.08); }
.pub-cal-day.selected  { background: var(--green); color: #fff; border-color: var(--green); }
.pub-cal-day.closed    { opacity: 0.35; cursor: not-allowed; }
.pub-cal-day.past      { opacity: 0.25; cursor: not-allowed; }
.pub-cal-day.today     { outline: 2px solid var(--green); outline-offset: 2px; }
.pub-cal-day.empty     { cursor: default; }

.occ-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.occ-low    { background: var(--green); }
.occ-mid    { background: var(--yellow); }
.occ-high   { background: var(--red); }
.occ-full   { background: var(--text-dim); }

/* ── Slots ──────────────────────────────────────────────────── */
.slots-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}

.slot-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.5rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
}

.slot-btn:hover   { border-color: var(--green); background: rgba(34,197,94,0.08); }
.slot-btn.selected { background: var(--green); color: #fff; border-color: var(--green); }
.slot-btn.reserved { background: var(--bg); color: var(--text-dim); cursor: not-allowed; text-decoration: line-through; }

/* ── Preço dinâmico ─────────────────────────────────────────── */
.price-badge {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.price-value { font-size: 1.5rem; font-weight: 800; color: var(--green); }
.price-occ   { font-size: 0.75rem; color: var(--text-muted); }

/* ── Pix ────────────────────────────────────────────────────── */
.pix-container {
  text-align: center;
}

.pix-qr {
  width: 200px; height: 200px;
  margin: 0 auto 1rem;
  background: #fff;
  border-radius: var(--radius);
  padding: 0.5rem;
  display: flex; align-items: center; justify-content: center;
}

.pix-qr img { width: 100%; height: 100%; object-fit: contain; }
.pix-qr-placeholder { font-size: 3rem; }

.pix-copy {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
  text-align: left;
  font-family: monospace;
  margin-bottom: 0.75rem;
  max-height: 80px;
  overflow-y: auto;
}

.pix-timer {
  font-size: 0.875rem;
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.pix-timer.expired { color: var(--red); }

/* ── Confirmação ────────────────────────────────────────────── */
.success-container {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounceIn 0.5s cubic-bezier(0.23,1,0.32,1);
}

.success-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: left;
  margin: 1.5rem 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { font-weight: 600; }

/* ── Footer ─────────────────────────────────────────────────── */
.booking-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Animações ──────────────────────────────────────────────── */
@keyframes bounceIn {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .booking-main { padding: 1rem 0.75rem; }
  .steps { gap: 0; }
  .step-label { display: none; }
  .step-line { min-width: 16px; }
  .slots-list { grid-template-columns: repeat(3, 1fr); }
}
.service-public-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 18px);
  background: var(--card);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1rem;
}

.service-public-card:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.service-public-image {
  width: 100%;
  aspect-ratio: 16 / 8;
  background: var(--bg);
  overflow: hidden;
}

.service-public-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.service-public-placeholder {
  width: 100%;
  height: 100%;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(148,163,184,0.12), rgba(15,23,42,0.2));
}

.service-public-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem;
}

.service-public-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.service-public-desc {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.service-public-duration {
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.service-public-arrow {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(34,197,94,0.12);
  color: var(--green);
}

.service-public-card:hover .service-public-arrow {
  background: var(--green);
  color: #fff;
}

@media (max-width: 600px) {
  .service-public-image {
    aspect-ratio: 16 / 9;
  }

  .service-public-content {
    padding: 0.9rem;
  }

  .service-public-title {
    font-size: 1rem;
  }
}
.pub-contact-line,
.pub-whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.pub-contact-line i {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pub-whatsapp-link {
  margin-top: 0.35rem;
  color: #22c55e;
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
}

.pub-whatsapp-link i {
  font-size: 1rem;
}

.pub-whatsapp-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

#pub-biz-address {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

@media (max-width: 700px) {
  #pub-biz-address {
    align-items: flex-start;
  }
}

/* ── Header público: endereço + WhatsApp ───────────────────────────── */

#pub-biz-address {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: 420px;
  text-align: right;
}

.pub-contact-line,
.pub-whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.pub-contact-line i {
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.pub-contact-line span {
  overflow-wrap: anywhere;
}

.pub-whatsapp-link {
  color: #22c55e;
  text-decoration: none;
  font-weight: 700;
  transition: opacity var(--transition), transform var(--transition);
}

.pub-whatsapp-link i {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.pub-whatsapp-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ── Melhor organização no mobile ─────────────────────────────────── */

@media (max-width: 700px) {
  .public-header,
  .booking-header,
  header {
    align-items: flex-start;
  }

  .public-header .container,
  .booking-header .container,
  header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  #pub-biz-address {
    width: 100%;
    max-width: none;
    align-items: flex-start;
    text-align: left;
    padding-left: 0;
    margin-top: 0.25rem;
  }

 /* ── Header público: contato do negócio ───────────────────────── */

#pub-biz-address {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: 420px;
  text-align: right;
}

.pub-contact-line,
.pub-whatsapp-link {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.pub-contact-line i,
.pub-whatsapp-link i {
  width: 20px;
  min-width: 20px;
  text-align: center;
  margin-top: 0.08rem;
  flex-shrink: 0;
}

.pub-contact-line span {
  overflow-wrap: anywhere;
}

.pub-whatsapp-link {
  color: #22c55e;
  text-decoration: none;
  font-weight: 700;
  transition: opacity var(--transition), transform var(--transition);
}

.pub-whatsapp-link span {
  white-space: nowrap;
}

.pub-whatsapp-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ── Header público mobile correto para o HTML atual ─────────── */

@media (max-width: 700px) {
  .booking-header {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      "logo info"
      "contact contact";
    column-gap: 0.85rem;
    row-gap: 0.85rem;
    align-items: center;
    padding: 1.25rem 1.25rem;
  }

  .biz-brand {
    display: contents;
  }

  #pub-biz-logo {
    grid-area: logo;
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border-radius: 14px;
  }

  .biz-brand > div:not(#pub-biz-logo) {
    grid-area: info;
    min-width: 0;
  }

  #pub-biz-name {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
    line-height: 1.12;
    font-weight: 800;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #pub-biz-desc {
    font-size: 0.95rem;
    line-height: 1.35;
    margin-top: 0.3rem;
  }

  #pub-biz-address {
    grid-area: contact;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.32);
    border: 1px solid var(--border);
    align-items: flex-start;
    text-align: left;
  }

  .pub-contact-line,
  .pub-whatsapp-link {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.95rem;
  }

  .pub-whatsapp-link {
    margin-top: 0.2rem;
    font-size: clamp(0.9rem, 4.2vw, 1rem);
  }
}