:root {
  --bg-dark: #121211;
  --bg-light: #1c1c1a;
  --bg-alt: #f6f1ea;
  --primary: #f0b562;
  --primary-dark: #cc9140;
  --text: #f8f8f6;
  --text-muted: #cfcfc7;
  --border: rgba(255, 255, 255, 0.1);
  --chip-selected-bg: #b08d55;
  /* Custom Bronze/Gold */
  --chip-selected-border: #8f703e;
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-dark);
  color: var(--text-muted);
  line-height: 1.6;
}

img {
  max-width: 100%;
}

.container {
  width: min(1100px, 90vw);
  margin: 0 auto;
}

.hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Default / Barber Theme */
body.theme-barbearia .hero,
.hero {
  background-image: linear-gradient(to bottom, rgba(18, 18, 17, 0.4), rgba(18, 18, 17, 0.9)),
    url('assets/img/barbearia_foto_grande.jpg');
}

/* Salon Theme */
body.theme-salao_beleza .hero {
  background-image: linear-gradient(to bottom, rgba(80, 50, 50, 0.3), rgba(28, 28, 26, 0.9)),
    url('assets/img/salao_de_beleza_foto_grande.jpg');
  color: var(--text);
  padding: 8rem 0 6rem;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -50px 50px -20px var(--bg-dark);
}

/* Estetica / Nail Designer Theme */
body.theme-estetica .hero {
  background-image: linear-gradient(to bottom, rgba(160, 110, 110, 0.4), rgba(40, 20, 20, 0.9)),
    url('assets/img/estetica_foto_grande.jpg');
  color: var(--text);
  padding: 8rem 0 6rem;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -50px 50px -20px var(--bg-dark);
}

/* Responsive Backgrounds */
@media (max-width: 768px) {

  body.theme-barbearia .hero,
  .hero {
    background-image: linear-gradient(to bottom, rgba(18, 18, 17, 0.4), rgba(18, 18, 17, 0.9)),
      url('assets/img/barbearia_foto_pequena.jpg');
  }

  body.theme-salao_beleza .hero {
    background-image: linear-gradient(to bottom, rgba(80, 50, 50, 0.3), rgba(28, 28, 26, 0.9)),
      url('assets/img/salao_de_beleza_foto_pequena.jpg');
  }

  body.theme-estetica .hero {
    background-image: linear-gradient(to bottom, rgba(160, 110, 110, 0.4), rgba(40, 20, 20, 0.9)),
      url('assets/img/estetica_foto_pequena.jpg');
  }
}

.hero::before {
  display: none;
  /* Remove old pattern overlay */
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero__logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  background: var(--bg-dark);
}

.hero__badge {
  display: inline-flex;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  background: rgba(240, 181, 98, 0.1);
  border: 1px solid rgba(240, 181, 98, 0.2);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.btn-voltar {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-voltar:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
}

h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  margin-bottom: 1.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  max-width: 600px;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--bg-alt);
  color: #2b2b28;
}

.section--alt h2,
.section--alt h3 {
  color: #1c1c1a;
}

.section--alt p {
  color: #4a4a48;
}

.section__header {
  margin-bottom: 3rem;
}

.pricing-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  color: var(--text);
  max-width: 520px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.pricing-card__price {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
}

.pricing-card__price span {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.pricing-card ul {
  list-style: none;
  margin-bottom: 2rem;
}

.pricing-card li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
}

.pricing-card li::before {
  content: "âœ”";
  position: absolute;
  left: 0;
  color: var(--primary);
}

.card {
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08);
}

.form {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr !important;
  /* Force single column */
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a4a48;
  gap: 0.5rem;
  letter-spacing: 0.3px;
}

input,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1rem 1.2rem;
  background: #f8f8f8;
  color: #1c1c1a;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.section--alt input,
.section--alt select {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(240, 181, 98, 0.15);
}

.chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 0.8rem;
  margin-top: 0.5rem;
  /* max-height removed to show all options */
  /* overflow-y removed */
  padding: 2px;
  /* Prevent shadow cutout */
}

.chips-scroll {
  display: flex;
  overflow-x: auto;
  gap: 0.8rem;
  padding: 0.5rem 2px;
  /* Top/bottom padding for shadow */
  margin-top: 0.5rem;
  /* Hide scrollbar for cleaner look but keep functionality */
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  /* Smooth scroll on iOS */
}

.chips-scroll .chip-btn {
  flex: 0 0 auto;
  /* Don't shrink */
  min-width: 120px;
  /* Ensure a decent width */
}

/* Nova classe para Grade de ServiÃ§os (Wrap) */
.services-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.services-grid .chip-btn {
  flex: 1 1 auto;
  /* Cresce para preencher espaÃ§o */
  min-width: 140px;
  /* Largura mÃ­nima confortÃ¡vel */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.chip-btn {
  background: #f8f8f8;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 0.8rem 0.5rem;
  font-size: 0.95rem;
  color: #1c1c1a;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-weight: 500;
}

.section--alt .chip-btn {
  background: #fff;
}

.chip-btn:hover {
  background: #eaeaea;
  border-color: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.chip-btn.selected {
  background: var(--chip-selected-bg);
  color: #ffffff;
  border-color: var(--chip-selected-border);
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.chip-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.form__inline {
  width: 100%;
}

.form__inline input {
  width: 100%;
}

.reservas {
  list-style: none;
  display: grid;
  gap: 1rem;
}

.reservas li {
  padding: 1.2rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease;
}

.reservas li:hover {
  transform: translateX(5px);
  border-color: var(--primary);
}

.reservas strong {
  color: #1c1c1a;
  font-weight: 700;
  font-size: 1.05rem;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.btn--primary {
  background: var(--primary);
  color: #121211;
  box-shadow: 0 4px 15px rgba(240, 181, 98, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 181, 98, 0.4);
  background: #ffc978;
}

.btn--outline {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(5px);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1c1c1a;
}

.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
}

.btn--small {
  padding: 0.4rem 1rem;
  border-radius: 12px;
}

.footer {
  text-align: center;
  padding: 2rem 0 3rem;
  color: var(--text-muted);
  background: #0e0e0d;
  font-size: 0.9rem;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer p {
  margin-bottom: 0.5rem;
}

.reserva-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reserva-acoes {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  color: #1c1c1a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--primary);
  color: var(--primary);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-agendada {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.status-confirmada {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.status-cancelada {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.status-concluida {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.text-muted {
  color: #6b7280;
  font-size: 0.85rem;
}

.form-group {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

textarea {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.section--alt textarea {
  background: #fdfdfd;
  border-color: rgba(0, 0, 0, 0.1);
  color: #1c1c1a;
}

.mensagem-flash {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  max-width: 400px;
}

.mensagem-flash.mostrar {
  opacity: 1;
  transform: translateX(0);
}

.mensagem-sucesso {
  background: #22c55e;
  color: white;
}

.mensagem-erro {
  background: #ef4444;
  color: white;
}

.mensagem-aviso {
  background: #f59e0b;
  color: white;
}

.mensagem-info {
  background: #3b82f6;
  color: white;
}

.filtros-relatorio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.relatorio-conteudo {
  display: grid;
  gap: 2rem;
}

.metrica-card {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.metrica-card h4 {
  color: #1c1c1a;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metrica-card .valor {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.tabela-relatorio {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.tabela-relatorio th,
.tabela-relatorio td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tabela-relatorio th {
  background: rgba(0, 0, 0, 0.02);
  font-weight: 600;
  color: #1c1c1a;
}

.tabela-relatorio td {
  color: #2b2b28;
}

@media (min-width: 1200px) {
  /* Form rules removed to force single column */

  .relatorio-conteudo {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .metricas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
}



.metricas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .hero {
    padding: 6rem 0 4rem;
    text-align: center;
  }

  .hero__actions {
    justify-content: center;
    flex-direction: column;
    padding: 0 1rem;
    gap: 0.8rem;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 400px;
    /* Prevent them from being too wide on tablets */
    margin: 0 auto;
    /* Center them if max-width kicks in */
    padding: 0.8rem;
    /* Consistent padding on mobile */
  }

  h1 {
    font-size: 2.5rem;
  }

  p {
    margin-left: auto;
    margin-right: auto;
  }
}

/* FORCE SINGLE COLUMN LAYOUT - FINAL OVERRIDE */
.form {
  display: grid;
  grid-template-columns: 100% !important;
  gap: 1.5rem;
}

.form-group {
  grid-column: 1 / -1 !important;
}


/* Responsive Stats */
@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
}

/* Responsive Search Form */
.search-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .search-form {
    flex-direction: column;
  }

  .search-form input,
  .search-form button {
    width: 100% !important;
  }
}

/* Responsive adjustments for pricing card */
@media (max-width: 480px) {
  .pricing-card {
    padding: 1.5rem;
    width: 100%;
    margin: 0 auto;
  }
}

.map-container {
  width: 100%;
  overflow: hidden;
  border-radius: 20px;
  background: #2a2a2a;
  transition: transform 0.3s ease;
}

.map-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.map-container iframe {
  filter: invert(90%) hue-rotate(180deg) contrast(90%);
  /* Dark Mode Map Hack */
}

.alert-atraso {
  background: rgba(241, 196, 15, 0.15);
  border: 1px solid #f39c12;
  color: #e67e22;
  padding: 1rem;
  border-radius: 12px;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 6px rgba(241, 196, 15, 0.05);
}

.alert-atraso strong {
  font-weight: 700;
  color: #d35400;
}

/* Business Hours Widget (Top of Form) */
.business-hours-widget {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  /* Light border for light theme */
  border-radius: 12px;
  padding: 1rem;
}

/* Pix Payment Styles */
.pix-payment-container {
  display: none;
  /* Auto-show via JS */
  margin: 1.5rem 0 !important;
  padding: 1.25rem !important;
  border: 2px solid rgba(240, 181, 98, 0.3) !important;
  border-radius: 16px !important;
  background: rgba(240, 181, 98, 0.08) !important;
  transition: all 0.3s ease;
  position: relative;
  grid-column: 1 / -1 !important;
}

.pix-payment-container:hover {
  background: rgba(240, 181, 98, 0.12) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 15px rgba(240, 181, 98, 0.15);
}

.pix-checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 15px !important;
  cursor: pointer;
  width: 100%;
  margin: 0 !important;
}

.pix-checkbox-label input[type="checkbox"] {
  width: 24px !important;
  height: 24px !important;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.pix-label-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text);
  /* For dark mode contrast */
  font-weight: 600;
  font-size: 1.05rem;
}

.pix-icon {
  font-size: 1.4rem;
}

.pix-title {
  color: #d35400;
  /* Darker orange for light mode, overridden below for dark mode */
}

/* Dark Mode Adjustment for Title */
body:not(.theme-salao_beleza) .pix-title {
  color: var(--primary);
}

.pix-badge {
  background: var(--primary);
  color: #121211;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pix-helper-text {
  display: block;
  margin-top: 8px;
  margin-left: 40px;
  /* Align with text, skipping checkbox */
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Light Theme Overrides (if needed) */
body.theme-salao_beleza .pix-payment-container {
  background: #fff8f0 !important;
  border-color: #e67e22 !important;
}

body.theme-salao_beleza .pix-label-text {
  color: #2c3e50;
}



.business-hours-widget h4 {
  color: #1c1c1a;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.hours-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.95rem;
  color: #555;
}

.hours-content p {
  margin: 0;
  max-width: none;
  /* Override general p max-width */
}

.lunch-time {
  font-size: 0.85em;
  color: #888;
  margin-top: 0.2rem;
}

/* Fix for Price Summary Black Box */
#price-summary {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0;
}

#price-summary span {
  color: inherit;
}

#summary-total {
  color: var(--primary) !important;
}
/* Mensagem específica de erro de agendamento (dia fechado / antecedência) */
@keyframes booking-warning-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px); }
  30% { transform: translateX(10px); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
  90% { transform: translateX(4px); }
}
@keyframes booking-warning-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    border-color: #ef4444;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    border-color: #dc2626;
  }
}
.booking-warning {
  background: #fee2e2;
  border: 2px solid #ef4444;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  animation: booking-warning-shake 0.6s ease-in-out,
             booking-warning-pulse 1.5s ease-in-out 0.6s 2;
}
