/* Variables de color y tipografía compartidas por toda la página. */
:root {
  color-scheme: dark;
  --background: #11110f;
  --surface: #191916;
  --surface-raised: #201f1b;
  --text: #f3efe7;
  --muted: #a19c91;
  --accent: #c99b59;
  --accent-light: #e2bd82;
  --line: rgba(243, 239, 231, 0.12);
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* El modelo de caja consistente evita sumar padding y bordes al tamaño de los elementos. */
* {
  box-sizing: border-box;
}

/* Navegación suave para enlaces que llevan a secciones de la misma página. */
html {
  scroll-behavior: smooth;
}

/* Fondo, ancho mínimo y colores base del documento. */
body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
}

/* Hereda la tipografía del sitio en los controles del formulario. */
button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Encabezado, marca y pie de página. */
.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px max(6.5vw, calc((100vw - 1200px) / 2));
}

.site-header {
  min-height: 84px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent-light);
  font-family: "Playfair Display", serif;
  font-size: 15px;
  font-weight: 700;
}

.brand-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.brand-name span {
  color: var(--accent-light);
}

.header-link,
.site-footer > a:last-child {
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
}

.header-link span,
.site-footer > a:last-child span {
  margin-left: 7px;
}

/* Sección inicial: contenido promocional e ilustración decorativa. */
.hero {
  display: grid;
  min-height: 575px;
  grid-template-columns: 1fr 0.9fr;
  align-items: center;
  gap: 7vw;
  padding: 65px max(10vw, calc((100vw - 1120px) / 2));
}

.hero-copy {
  padding: 20px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 24px;
  color: var(--accent-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.21em;
}

.eyebrow-line {
  width: 25px;
  height: 1px;
  background: var(--accent);
}

h1,
h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
}

h1 {
  max-width: 570px;
  font-size: clamp(46px, 6vw, 78px);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

h1 em {
  color: var(--accent-light);
  font-weight: 600;
}

.hero-description {
  max-width: 390px;
  margin: 23px 0 30px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 31px;
  padding: 14px 18px;
  background: var(--accent);
  color: #19140e;
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-link:hover {
  transform: translateY(-2px);
  background: var(--accent-light);
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7aa77b;
  box-shadow: 0 0 12px rgba(122, 167, 123, 0.5);
}

.hero-art {
  display: block;
  width: 100%;
  height: 375px;
  overflow: hidden;
  object-fit: contain;
  object-position: center;
}

/* Fondo y márgenes de la sección de reservas. */
.booking-section {
  padding: 76px max(10vw, calc((100vw - 1120px) / 2)) 92px;
  background: #171715;
}

/* Título de sección e introducción alineados en el encabezado. */
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.section-heading .eyebrow {
  margin-bottom: 14px;
}

/* Tamaño del título de la sección de reservas. */
h2 {
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: -0.035em;
}

.section-intro {
  max-width: 300px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* Panel para consultar disponibilidad según la fecha seleccionada. */
.availability-form {
  margin-bottom: 22px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.availability-controls {
  display: flex;
  gap: 10px;
}

/* Campo de fecha: permite encogerse sin desbordar el panel. */
.availability-controls input {
  min-width: 0;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  text-align: center;
}

/* Acción que envía la fecha para volver a cargar la página. */
.availability-controls button {
  padding: 0 16px;
  border: 0;
  background: var(--accent);
  color: var(--background);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

/* Cuadrícula del formulario con los tres pasos de la reserva. */
.booking-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 25px 28px;
  padding: 31px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* Coloca servicio, horarios y nombre en el orden visual del formulario. */
.booking-card > .form-step:nth-of-type(1) {
  grid-column: 1;
  grid-row: 1;
}

.booking-card > .form-step:nth-of-type(2) {
  grid-column: 1 / -1;
  grid-row: 2;
}

.booking-card > .form-step:nth-of-type(3) {
  grid-column: 2;
  grid-row: 1;
}

/* Número y contenido de cada paso del formulario. */
.form-step {
  display: flex;
  gap: 14px;
}

.step-number {
  padding-top: 2px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.step-content {
  min-width: 0;
  flex: 1;
}

.field-label {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* Apariencia común de los controles y su estado de foco. */
.step-content select,
.step-content input {
  width: 100%;
  min-height: 47px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.step-content select {
  text-align-last: center;
}

.step-content select:focus,
.step-content input:focus {
  border-color: var(--accent);
}

.step-content select:invalid {
  color: var(--muted);
}

/* Agrupación horizontal de campos de fecha y hora cuando se usan juntos. */
.date-time-fields {
  display: flex;
  gap: 8px;
}

.date-time-fields input {
  min-width: 0;
}

/* Cuadrícula de horarios que devuelve el servidor; se oculta mientras está deshabilitada. */
.time-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  width: 100%;
  margin: 10px 0 0;
  padding: 2px;
  border: 0;
}

.time-options:disabled {
  display: none;
}

/* Cada opción mantiene el radio accesible y muestra visualmente la hora. */
.time-option {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 7px;
  border: 1px solid rgba(226, 189, 130, 0.4);
  background: var(--surface-raised);
  color: var(--accent-light);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.time-option:hover {
  transform: translateY(-1px);
  border-color: var(--accent-light);
  background: #2a2822;
}

/* Resalta el horario elegido, el foco de teclado y el indicador circular. */
.time-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(201, 155, 89, 0.2);
  color: #fff2d6;
}

.time-option::before {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 1px solid var(--accent-light);
  border-radius: 50%;
  content: "";
}

.time-option:has(input:checked)::before {
  background: var(--accent-light);
  box-shadow: inset 0 0 0 2px var(--surface-raised);
}

.time-option:has(input:focus-visible) {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

/* El radio nativo permanece en el formulario aunque su indicador se dibuje en CSS. */
.time-options input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  opacity: 0;
  accent-color: var(--accent);
}

/* Centra mensajes de disponibilidad y resalta el campo para el nombre. */
.step-content > .field-hint {
  text-align: center;
}

#customer-name {
  font-weight: 600;
}

#customer-document {
  font-weight: 600;
}

#customer-name::placeholder {
  text-align: center;
}

#customer-document::placeholder {
  text-align: center;
}

.identity-fields {
  display: grid;
  gap: 16px;
}

/* Texto auxiliar y botón para confirmar la cita. */
.field-hint,
.form-footnote {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.whatsapp-button {
  display: flex;
  min-height: 51px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  background: #3f8255;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease;
}

.whatsapp-button:hover {
  background: #347248;
}

/* Apariencia del botón cuando todavía no hay un horario válido seleccionado. */
.whatsapp-button:disabled {
  background: #44433f;
  color: var(--muted);
  cursor: not-allowed;
}

.whatsapp-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.button-arrow {
  margin-left: 4px;
}

/* Nota inferior del formulario y texto oculto solo para lectores de pantalla. */
.form-footnote {
  grid-column: 1 / -1;
  margin: -13px 0 0;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

/* Pie de página y variante compacta de la marca. */
.site-footer {
  min-height: 92px;
  border-top: 1px solid var(--line);
}

.footer-brand .brand-mark {
  width: 33px;
  height: 33px;
}

.footer-brand .brand-name {
  font-size: 10px;
}

.site-footer p {
  color: var(--muted);
  font-size: 11px;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: color 180ms ease, border-color 180ms ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  border-color: var(--accent);
  color: var(--accent-light);
}

.social-links svg {
  width: 19px;
  height: 19px;
}

/* Ajustes para tabletas y teléfonos en orientación vertical. */
@media (max-width: 760px) {
  .site-header,
  .site-footer {
    padding-right: 6vw;
    padding-left: 6vw;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 62px 8vw 50px;
  }

  .hero-art {
    height: 315px;
  }

  .booking-section {
    padding: 58px 8vw 68px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }

  .booking-card {
    grid-template-columns: 1fr;
    padding: 24px 19px;
  }

  .booking-card > .form-step:nth-of-type(1),
  .booking-card > .form-step:nth-of-type(2),
  .booking-card > .form-step:nth-of-type(3) {
    grid-column: 1;
    grid-row: auto;
  }

  .time-options {
    gap: 8px;
  }

  .availability-form {
    padding: 20px;
  }

  .availability-controls {
    flex-direction: column;
  }

  .availability-controls button {
    min-height: 45px;
  }

  .whatsapp-button,
  .form-footnote {
    grid-column: 1;
  }
}

/* Ajustes adicionales para pantallas estrechas. */
@media (max-width: 430px) {
  .site-header {
    min-height: 72px;
  }

  .brand-name {
    font-size: 10px;
  }

  .header-link {
    font-size: 11px;
  }

  .hero {
    padding-top: 48px;
  }

  .hero-art {
    height: 275px;
  }

  .site-footer {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .site-footer p {
    order: 1;
    width: 100%;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Respeta la preferencia del usuario de reducir desplazamientos y animaciones. */
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
