/* ==================================== */
/* 🎨 Variables y Configuración Global */
/* ==================================== */

:root {
  /* Paleta de colores */
  --color-primary: #0b63d6; /* Azul principal (reserva) */
  --color-accent: #8b5e3c;  /* Color de acento (seleccionados) */
  --color-text: #212121;
  --color-light-bg: #f0f0f0; /* Fondo claro para hover/botones */
  --color-white: #fff;
  --color-shadow: rgba(0, 0, 0, 0.06);

  /* Espaciado */
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
}

/* Reset ligero (se mantiene, agrupando propiedades) */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--color-text); /* Establecer color de texto base */
}

/* Clases de utilidad */
.hidden {
  display: none !important; /* !important asegura que se oculte */
}

/* ==================================== */
/* 📄 Componente: Header y Navegación */
/* ==================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--color-white);
  box-shadow: 0 2px 8px var(--color-shadow);
  z-index: 60;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--spacing-sm);
}

.brand {
  font-weight: 700;
  font-size: 18px;
}

/* Nav */
.nav {
  display: flex;
  gap: var(--spacing-sm);
}

.nav-btn {
  background: transparent;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--spacing-sm);
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s ease;
}

.nav-btn:hover {
  background: var(--color-light-bg);
}

/* Botón de reserva (Modificador) */
.reserva {
  background: var(--color-primary);
  color: var(--color-white);
  /* Hover para botones primarios */
  transition: background 0.2s ease;
}

.reserva:hover {
  background: #0950b3; /* Un tono ligeramente más oscuro */
}


/* ==================================== */
/* 🖼️ Componente: Modal */
/* ==================================== */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 20px;
}

.modal-content {
  width: 100%;
  max-width: 560px;
  background: var(--color-white);
  border-radius: var(--spacing-md);
  padding: 18px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.close {
  position: absolute;
  right: 14px;
  top: 10px;
  background: transparent;
  border: none;
  font-size: 26px;
  cursor: pointer;
  line-height: 1; /* Para alinear el contenido del icono/texto */
  padding: 4px; /* Aumentar el área de clic */
}


/* ==================================== */
/* 🔢 Componente: Step-Wizard y Nav */
/* ==================================== */

.step-title {
  font-size: 20px;
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

/* Nav horizontal (botones en una fila) */
.step-nav-horizontal {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
  align-items: center;
  justify-content: space-between;
}

.step-prev, 
.step-next {
  padding: 10px 14px;
  border-radius: var(--spacing-sm);
  border: none;
  cursor: pointer;
  font-weight: 600;
  min-width: 120px;
  transition: background 0.2s ease;
}

.blue-btn {
  background: var(--color-primary);
  color: var(--color-white);
}

.blue-btn:hover {
  background: #0950b3;
}

/* ==================================== */
/* 👤 Componente: Personas */
/* ==================================== */

.personas-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.persona-btn {
  padding: 10px 14px;
  border-radius: var(--spacing-sm);
  background: #efefef;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.persona-btn.selected {
  background: var(--color-accent);
  color: var(--color-white);
}

.persona-btn.grande {
  padding: 10px 18px;
  font-weight: 700;
}

/* ==================================== */
/* 📅 Componente: Calendario */
/* ==================================== */

.mes-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.mes-selector button {
  background: #eee;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.dias-header,
.dias-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.dias-header {
  margin-bottom: 6px;
}

.dias-header-item {
  text-align: center;
  font-weight: 700;
  padding: 6px 0;
  font-size: 13px;
  color: #444;
}

.dias-grid {
  gap: var(--spacing-sm);
}

.dia-item {
  /* Propiedades de diseño y alineación */
  background: #fbfbfb;
  border-radius: var(--spacing-sm);
  padding: 10px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Propiedades de interacción */
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.dia-item:not(.vacio):not(.pasado):hover {
    border: 1px solid #ccc;
}

/* Modificadores del día */
.dia-item.vacio {
  background: transparent;
  cursor: default;
  border: none;
}

.dia-item.pasado {
  background: #eee;
  color: #888;
  cursor: not-allowed;
}

.dia-item.selected {
  background: var(--color-accent);
  color: var(--color-white);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dia-item.hoy {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px; /* Opcional: para que no agrande el elemento */
}


/* ==================================== */
/* 🕑 Componente: Horas */
/* ==================================== */

.tabs {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.tab-btn {
  flex: 1;
  padding: var(--spacing-sm);
  border-radius: var(--spacing-sm);
  border: none;
  background: #eee;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-btn.active {
  background: var(--color-accent);
  color: var(--color-white);
}

.horas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
}

.hora-item {
  padding: 10px;
  border-radius: var(--spacing-sm);
  background: #f3f3f3;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.hora-item:hover:not(.selected) {
    background: #e0e0e0;
}

.hora-item.selected {
  background: var(--color-accent);
  color: var(--color-white);
}


/* ==================================== */
/* ✅ Mensaje de Confirmación */
/* ==================================== */

.mensaje-confirmacion {
  margin-top: 14px;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  /* Propiedades de animación */
  opacity: 0;
  transition: opacity 0.5s ease, color 0.2s ease;
}

.mensaje-confirmacion.visible {
  opacity: 1;
}

.mensaje-confirmacion.exito {
  color: #28a745; /* verde */
}

.mensaje-confirmacion.error {
  color: #dc3545; /* rojo */
}

/* Mensajes de error */
.mensaje-error {
  color: #dc3545;       /* rojo */
  font-weight: 600;
  font-size: 14px;
  margin-top: 4px;
  visibility: hidden;   /* siempre ocupa espacio pero invisible */
}
.mensaje-error.visible {
  visibility: visible;
}

/* ==================================== */
/* 📱 Responsive / Media Queries */
/* ==================================== */

@media (max-width: 520px) {
  .modal-content {
    padding: var(--spacing-md);
  }
  .dia-item {
    min-height: 56px;
  }
  .step-prev,
  .step-next {
    /* Usar flex-grow para que ocupen el espacio disponible, manteniendo min-width */
    min-width: 44%; 
    font-size: 14px;
  }
}