/* =============================
   RESERVA CSS MEJORADO v3.0
   ============================= */

/* Reset y base */
* {
  box-sizing: border-box;
}

/* Hero de Servicios */
.page-hero {
  position: relative;
  background: url('../img/hero-servicios.webp') center/cover no-repeat;
  height: 60vh;
  display: flex;
  align-items: center;
  color: #fff;
}

.page-hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.page-hero .hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

/* Ajustes de texto */
.page-hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.page-hero p {
  font-size: 1.2rem;
}

.reservation-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

.reservation-card:hover {
  box-shadow: 0 25px 80px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.card-header {
  background: linear-gradient(135deg, #2d5a27 0%, #4a8c4a 100%);
  color: white;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="70" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
  pointer-events: none;
}

.card-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.card-header p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0;
  position: relative;
  z-index: 1;
}

.card-body {
  padding: 3rem 2.5rem;
  background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%);
}

/* Grupos de formulario */
.form-group {
  margin-bottom: 2.5rem;
  position: relative;
}

.form-group label {
  font-weight: 600;
  color: #2d5a27;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.form-group label i {
  margin-right: 0.75rem;
  width: 18px;
  text-align: center;
  color: #4a8c4a;
  font-size: 1.1rem;
}

.form-group label .text-danger {
  margin-left: 0.25rem;
  font-weight: 700;
}

/* Campos de entrada */
.form-control, .form-select {
  border: 2px solid #e8ecf0;
  border-radius: 12px;
  padding: 15px 20px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  width: 100%;
  font-weight: 500;
  line-height: 1.5;
}

.form-control:hover, .form-select:hover {
  border-color: #d1d9e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.form-control:focus, .form-select:focus {
  border-color: #2d5a27;
  box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1), 0 4px 12px rgba(0,0,0,0.08);
  background: white;
  outline: none;
  transform: translateY(-1px);
}

/* Input groups */
.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-group-text {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #e8ecf0;
  border-right: none;
  border-radius: 12px 0 0 12px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  transition: all 0.3s ease;
}

.input-group .form-control {
  border-left: none;
  border-radius: 0 12px 12px 0;
}

.input-group:focus-within .input-group-text {
  background: linear-gradient(135deg, #2d5a27 0%, #4a8c4a 100%);
  color: white;
  border-color: #2d5a27;
}

.input-group:focus-within .form-control {
  border-color: #2d5a27;
}

/* Select específico */
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px 12px;
  padding-right: 45px;
}

.form-select optgroup {
  background: #f8f9fa;
  color: #2d5a27;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 8px 8px 8px;
  border-top: 1px solid #e9ecef;
}

.form-select optgroup:first-child {
  border-top: none;
}

.form-select optgroup option {
  background: white;
  color: #495057;
  font-weight: 500;
  padding: 10px 15px;
  margin: 2px 0;
}

.form-select option[data-pack="true"] {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  color: #2d5a27;
  font-weight: 600;
}

/* Estados de validación */
.form-control.is-valid,
.form-select.is-valid {
  border-color: #28a745;
  box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.valid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #28a745;
  font-weight: 500;
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #dc3545;
  font-weight: 500;
}

.form-control.is-valid ~ .valid-feedback,
.form-select.is-valid ~ .valid-feedback {
  display: block;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback {
  display: block;
}

/* Textarea */
.form-control[rows] {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* Métodos de pago */
.payment-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  padding: 2rem;
  margin: 2rem 0;
  border: 2px solid #e8ecf0;
}
.payment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.payment-options .form-check {
  margin: 0;
  padding: 1rem;
  background: white;
  border-radius: 10px;
  border: 2px solid #e8ecf0;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: flex-start;
}

.payment-options .form-check:hover {
  border-color: #2d5a27;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.payment-options .form-check-input:checked + .form-check-label {
  color: #2d5a27;
  font-weight: 600;
}

.payment-options .form-check-input {
  margin-top: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
}

.payment-options .form-check-label {
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.payment-options .form-check-label i {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* Resumen de precio */
.price-display {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  border-radius: 15px;
  padding: 2rem;
  margin: 2rem 0;
  border: 2px solid #c8e6c8;
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.1);
}

.price-summary h4 {
  color: #2d5a27;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.price-details {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  border: 1px solid #c8e6c8;
}

.price-details .d-flex {
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 500;
}

.price-total-line {
  border-top: 2px solid #2d5a27;
  margin-top: 1rem;
  padding-top: 1rem !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
}

.price-amount {
  color: #2d5a27;
  font-weight: 700;
  font-size: 1.3rem;
}

/* Mensajes de estado */
.status-message {
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  animation: slideInUp 0.3s ease;
}

.status-message i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.status-message.loading {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1976d2;
  border: 2px solid #90caf9;
}

.status-message.success {
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%);
  color: #2e7d32;
  border: 2px solid #a5d6a7;
}

.status-message.error {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  color: #c62828;
  border: 2px solid #ef9a9a;
}

/* Botón principal */
.btn-primary {
  background: linear-gradient(135deg, #2d5a27 0%, #4a8c4a 100%);
  border: none;
  border-radius: 12px;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.3);
  text-transform: none;
  position: relative;
  overflow: hidden;
  align-items: center;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e3d1b 0%, #2d5a27 100%);
  box-shadow: 0 6px 25px rgba(45, 90, 39, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(45, 90, 39, 0.3);
}

.btn-primary:disabled {
  background: #6c757d;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  opacity: 0.6;
}

.btn-secondary {
  background: #6c757d;
  border: none;
  border-radius: 12px;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

/* Área del botón de envío */
.text-center {
  text-align: center !important;
}

.submit-button-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 2rem !important;
  padding: 1rem 0;
}

.btn-primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Información adicional */
.text-muted {
  color: #6c757d !important;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: block;
}

.max-personas-info {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #495057;
  font-weight: 500;
}

/* Animaciones */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* =============================
   RESPONSIVIDAD - FORMULARIO
   ============================= */

/* --- Tablet (max 768px) --- */
@media (max-width: 768px) {
  .page-hero {
    height: 45vh;
  }

  .page-hero h1 {
    font-size: 2.2rem;
  }

  .page-hero p {
    font-size: 1rem;
  }

  .card-body {
    padding: 2rem 1.5rem;
  }

  .card-header {
    padding: 2rem 1.5rem;
  }

  .card-header h2 {
    font-size: 1.6rem;
  }

  .form-control, .form-select {
    padding: 12px 15px;
    font-size: 16px; /* Evita zoom en iOS */
  }

  .input-group-text {
    padding: 12px 14px;
    min-width: 44px;
  }

  .price-display, .payment-section {
    padding: 1.5rem;
  }

  .btn-primary {
    padding: 12px 25px;
    font-size: 1rem;
  }
}

/* --- Movil (max 576px) --- */
@media (max-width: 576px) {
  .page-hero {
    height: 35vh;
  }

  .page-hero h1 {
    font-size: 1.8rem;
  }

  .reservation-card {
    border-radius: 15px;
    margin: 0.5rem;
  }

  .card-body {
    padding: 1.25rem 1rem;
  }

  .card-header {
    padding: 1.25rem 1rem;
  }

  .card-header h2 {
    font-size: 1.3rem;
  }

  .card-header p {
    font-size: 0.9rem;
  }

  .form-group {
    margin-bottom: 1.5rem;
  }

  /* Input groups: icono + input siempre inline */
  .input-group {
    flex-wrap: wrap;
  }

  .input-group-text {
    padding: 10px 12px;
    min-width: 42px;
    flex: 0 0 auto;
    border-radius: 12px 0 0 12px;
    border-right: none;
  }

  .input-group .form-control {
    flex: 1 1 0%;
    min-width: 0;
    border-radius: 0 12px 12px 0;
    border-left: none;
  }

  /* Boton "Elegir" del calendario: debajo en nueva linea */
  .input-group .btn-outline-primary {
    flex: 0 0 100%;
    margin-top: 0.5rem;
    border-radius: 12px;
  }

  /* Pago */
  .payment-section {
    padding: 1rem;
  }

  .payment-options {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .payment-options .form-check {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .payment-options .form-check-input {
    margin-top: 0.35rem;
  }

  .payment-options .form-check-label {
    flex: 1;
    align-items: flex-start;
    gap: 0.35rem;
    line-height: 1.4;
  }

  .payment-options .form-check-label small {
    margin-top: 0.15rem;
  }

  /* Precio */
  .price-display {
    padding: 1rem;
  }

  .price-summary h4 {
    font-size: 1.1rem;
  }

  .price-details .d-flex {
    font-size: 0.9rem;
  }

  .price-amount {
    font-size: 1.1rem;
  }
}

/* Modal de fecha/hora - Base */
.modal-fecha-hora {
  z-index: 1055 !important;
  display: none; /* Oculto por defecto */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7); /* Overlay oscuro */
  backdrop-filter: blur(4px);
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

/* Fuerza scroll permitido cuando el modal está abierto */
body.modal-open-custom,
html.modal-open-custom {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  position: static !important;
}

/* Si algún script agrega la clase de Bootstrap .modal-open, también permitimos scroll */
body.modal-open {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
}

.modal-fecha-hora.show {
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}

.modal-fecha-hora .modal-dialog {
  max-width: 900px;
  margin: 20px auto;
  z-index: 1056 !important;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
  touch-action: pan-y;
  pointer-events: auto;
  width: auto;
}

.modal-fecha-hora.show .modal-dialog {
  transform: scale(1);
}

.modal-fecha-hora .modal-content {
  border: none;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  z-index: 1057 !important;
  display: flex;
  flex-direction: column;
  height: auto;
  touch-action: pan-y;
  max-height: 85vh;
  overflow-y: auto; /* scroll dentro del contenido para alcanzar el footer */
  -webkit-overflow-scrolling: touch;
}

  .modal-fecha-hora .modal-header {
    background: linear-gradient(135deg, #2d5a27 0%, #4a8c4a 100%);
    color: white;
    border: none;
    padding: 1.25rem;
    text-align: center;
    position: relative;
  }

.modal-fecha-hora .modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
  pointer-events: none;
}

.modal-fecha-hora .modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  position: relative;
  z-index: 1;
}

.modal-fecha-hora .btn-close {
  background: rgba(255,255,255,0.2);
  opacity: 1;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: brightness(0) invert(1);
  position: relative;
  z-index: 1;
}

.modal-fecha-hora .btn-close:hover {
  background: rgba(255,255,255,0.3);
}

.modal-fecha-hora .modal-body {
  padding: 0;
  background: #fafbfc;
  flex: 1 1 auto;
  touch-action: pan-y;
  overflow: visible;
  min-height: 0;
}

.modal-fecha-hora .modal-footer {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #e8ecf0;
  z-index: 2;
}

/* Layout principal del modal */
.datetime-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
}

/* Panel de calendario */
.calendar-panel {
  background: white;
  padding: 1.5rem;
  border-right: 2px solid #f0f2f5;
}

.calendar-panel h4 {
  color: #2d5a27;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  font-size: 1.2rem;
}

.calendar-panel h4 i {
  margin-right: 0.75rem;
  color: #4a8c4a;
}

/* Calendario personalizado */
.custom-calendar {
  max-width: 100%;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.calendar-nav {
  background: none;
  border: none;
  color: #2d5a27;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav:hover {
  background: #e8f5e8;
  color: #1e3d1b;
}

.calendar-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-month-year {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2d5a27;
  text-align: center;
  min-width: 150px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 0.5rem;
}

.calendar-day-header {
  background: #2d5a27;
  color: white;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-day-header:first-child {
  border-radius: 8px 0 0 0;
}

.calendar-day-header:last-child {
  border-radius: 0 8px 0 0;
}

.calendar-day {
  background: white;
  border: none;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  font-size: 0.9rem;
}

.calendar-day:hover {
  background: #e8f5e8;
  color: #2d5a27;
}

.calendar-day.disabled {
  color: #ccc;
  cursor: not-allowed;
  background: #f8f9fa;
}

.calendar-day.disabled:hover {
  background: #f8f9fa;
  color: #ccc;
}

.calendar-day.selected {
  background: linear-gradient(135deg, #2d5a27 0%, #4a8c4a 100%);
  color: white;
  font-weight: 700;
}

.calendar-day.selected:hover {
  background: linear-gradient(135deg, #1e3d1b 0%, #2d5a27 100%);
  color: white;
}

.calendar-day.today {
  background: #fff3cd;
  color: #856404;
  font-weight: 700;
}

.calendar-day.today:hover {
  background: #ffeaa7;
}

.calendar-day.has-availability::after {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: #28a745;
  border-radius: 50%;
}

/* Panel de horarios */
.time-panel {
  background: #fafbfc;
  padding: 1.5rem;
}

.time-panel h4 {
  color: #2d5a27;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  font-size: 1.2rem;
}

.time-panel h4 i {
  margin-right: 0.75rem;
  color: #4a8c4a;
}

.time-slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.time-slot {
  background: white;
  border: 2px solid #e8ecf0;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.time-slot:hover {
  border-color: #2d5a27;
  box-shadow: 0 4px 12px rgba(45, 90, 39, 0.1);
  transform: translateY(-1px);
}

.time-slot.selected {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  border-color: #2d5a27;
  color: #2d5a27;
  font-weight: 700;
}

.time-slot.disabled {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.time-slot.disabled:hover {
  border-color: #e8ecf0;
  box-shadow: none;
  transform: none;
}

.time-slot-time {
  font-size: 1.1rem;
  font-weight: 600;
}

.time-slot-info {
  font-size: 0.85rem;
  color: #6c757d;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.time-slot-availability {
  font-weight: 600;
}

.time-slot-availability.available {
  color: #28a745;
}

.time-slot-availability.limited {
  color: #ffc107;
}

.time-slot-availability.full {
  color: #dc3545;
}

/* Estado de carga */
.time-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: #6c757d;
}

.time-loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #2d5a27;
}

.time-loading p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

/* Estado sin horarios */
.no-times {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: #6c757d;
  text-align: center;
}

.no-times i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #dc3545;
}

.no-times h5 {
  color: #495057;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.no-times p {
  margin: 0;
  font-size: 0.95rem;
}

/* Footer del modal */
.modal-fecha-hora .modal-footer {
  background: white;
  border: none;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid #f0f2f5;
  z-index: 2;
}

.selected-datetime {
  color: #2d5a27;
  font-weight: 600;
  font-size: 1rem;
}

.modal-fecha-hora .btn {
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.modal-fecha-hora .btn-secondary {
  background: #6c757d;
  border: none;
}

.modal-fecha-hora .btn-success {
  background: linear-gradient(135deg, #2d5a27 0%, #4a8c4a 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.3);
}

.modal-fecha-hora .btn-success:hover {
  background: linear-gradient(135deg, #1e3d1b 0%, #2d5a27 100%);
  box-shadow: 0 6px 25px rgba(45, 90, 39, 0.4);
  transform: translateY(-1px);
}

.modal-fecha-hora .btn-success:disabled {
  background: #6c757d;
  box-shadow: none;
  transform: none;
  opacity: 0.6;
}

/* Scrollbar personalizado */
.time-slots::-webkit-scrollbar {
  width: 6px;
}

.time-slots::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.time-slots::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.time-slots::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* =============================
   RESPONSIVIDAD - MODAL CALENDARIO
   ============================= */

/* --- Tablet (max 768px) --- */
@media (max-width: 768px) {
  .modal-fecha-hora .modal-dialog {
    margin: 10px;
    max-width: none;
    width: calc(100% - 20px);
    height: auto;
    overflow: visible;
  }

  .modal-fecha-hora .modal-content {
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .datetime-selector {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .calendar-panel {
    border-right: none;
    border-bottom: 2px solid #f0f2f5;
    padding: 1.25rem;
  }

  .time-panel {
    padding: 1.25rem;
  }

  .calendar-grid {
    gap: 1px;
  }

  .calendar-day {
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
  }

  .time-slots {
    max-height: 220px;
    overflow-y: auto;
  }

  .time-slot {
    padding: 0.75rem 1rem;
  }

  .time-slot-info {
    align-items: flex-end;
  }

  .modal-fecha-hora .modal-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    padding: 1rem 1.25rem;
  }

  .modal-fecha-hora .modal-footer .btn {
    width: 100%;
  }

  .selected-datetime {
    text-align: center;
    font-size: 0.9rem;
  }
}

/* --- Movil (max 576px) --- */
@media (max-width: 576px) {
  /* Modal: pantalla completa con scroll correcto */
  .modal-fecha-hora {
    padding: 0;
    align-items: stretch;
    overflow: hidden !important; /* solo el modal-body hace scroll */
  }

  .modal-fecha-hora .modal-dialog {
    width: 100%;
    margin: 0;
    height: 100%;
    max-height: none;
    overflow: visible;
    transform: none;
    border-radius: 0;
  }

  .modal-fecha-hora .modal-content {
    border-radius: 0;
    max-height: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* el body hace el scroll, no el content */
  }

  .modal-fecha-hora .modal-header {
    flex-shrink: 0;
    padding: 1rem;
  }

  .modal-fecha-hora .modal-header .modal-title {
    font-size: 1.1rem;
  }

  .modal-fecha-hora .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
  }

  .modal-fecha-hora .modal-footer {
    flex-shrink: 0;
    position: relative;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  }

  /* Layout 1 columna */
  .datetime-selector {
    display: block;
    min-height: auto;
  }

  .calendar-panel {
    padding: 1rem;
    border: none;
    border-bottom: 2px solid #f0f2f5;
  }

  .time-panel {
    padding: 1rem;
    padding-top: 0.75rem;
  }

  .calendar-panel h4,
  .time-panel h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .calendar-header {
    margin-bottom: 0.75rem;
  }

  .calendar-month-year {
    font-size: 1rem;
    min-width: 120px;
  }

  .calendar-nav {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .calendar-grid {
    gap: 1px;
    padding: 0.25rem;
  }

  .calendar-day-header {
    font-size: 0.7rem;
    padding: 0.5rem 0.2rem;
  }

  .calendar-day {
    padding: 0.5rem 0.2rem;
    font-size: 0.8rem;
  }

  .time-slots {
    max-height: none;
    overflow: visible;
  }

  .time-slot {
    padding: 0.75rem 1rem;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .time-slot-time {
    font-size: 1rem;
  }

  .time-slot-info {
    font-size: 0.8rem;
    align-items: flex-end;
  }

  /* Loading y no-times compactos */
  .time-loading,
  .no-times {
    padding: 2rem 1rem;
  }

  .no-times i {
    font-size: 2rem;
  }
}
