/* ========================================================= */
/* --- MODAL WIZARD DE RESERVACIONES (FASE 1) --- */
/* ========================================================= */

.reserva-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.reserva-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.reserva-modal {
  background: #ffffff;
  width: 95%;
  max-width: 650px;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reserva-modal-overlay.active .reserva-modal {
  transform: scale(1);
}

.reserva-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
}

.reserva-header-text h2 {
  font-size: 1.4rem;
  color: #333;
  margin: 0 0 0.2rem 0;
  font-family: 'Open Sauce One', sans-serif;
}

.reserva-header-text p {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
  font-weight: 500;
}

.close-modal-btn {
  background: #f4f0ec;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #333;
  font-size: 1.2rem;
  transition: background 0.2s;
}

.close-modal-btn:hover { background: #e5dfd5; }

/* Progress Bar */
.wizard-progress-bar {
  width: 100%;
  height: 4px;
  background: #f4f0ec;
}
.wizard-progress-fill {
  height: 100%;
  background: #9FC3E0;
  transition: width 0.4s ease;
}

/* Form Body */
.reserva-body {
  padding: 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex-grow: 1;
}

/* Steps */
.wizard-step {
  display: none;
  animation: fadeInRight 0.4s ease forwards;
}
.wizard-step.active {
  display: block;
}
.wizard-step.slide-left {
  animation: fadeInLeft 0.4s ease forwards;
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.wizard-step h3 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1.5rem;
  font-family: 'Open Sauce One', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #f4f0ec;
  padding-bottom: 0.5rem;
}

/* Inputs */
.reserva-form-group {
  margin-bottom: 1.2rem;
}

.reserva-form-group label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.reserva-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fafafa;
  transition: all 0.2s;
}

.reserva-input:focus {
  outline: none;
  border-color: #9FC3E0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(159, 195, 224, 0.15);
}

.reserva-input.error {
  border-color: #d73a49;
  background: #fffafa;
}

/* Radio Group Estético */
.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #555;
  background: #f4f0ec;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-align: center;
}

.radio-label input[type="radio"] { display: none; }
.radio-label:has(input[type="radio"]:checked) {
  background: #f1f8fc;
  color: #2b6a9c;
  border-color: #9FC3E0;
}

/* Premium Package Cards */
.paquetes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 500px) {
  .paquetes-grid { grid-template-columns: 1fr; }
}

.paquete-card {
  border: 2px solid #eaeaea;
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  background: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.paquete-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  border-color: #dcdcdc;
}

.paquete-card.selected {
  border-color: #F8B4A6;
  background: #fffcfb;
  box-shadow: 0 8px 24px rgba(248, 180, 166, 0.15);
  transform: translateY(-4px);
}
.paquete-card.selected::before {
  content: '✓ SELECCIONADO';
  position: absolute;
  top: 0;
  right: 0;
  background: #F8B4A6;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 12px;
  border-bottom-left-radius: 12px;
  letter-spacing: 0.05em;
}

.paquete-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  font-family: 'Open Sauce One', sans-serif;
}
.paquete-price {
  font-size: 1.3rem;
  color: #F8B4A6;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.paquete-sub {
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
  margin-bottom: 1rem;
}

.paquete-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  flex-grow: 1;
}
.paquete-card ul li {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.4rem;
  position: relative;
  padding-left: 1.2rem;
}
.paquete-card ul li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: #9FC3E0;
  font-size: 0.7rem;
  top: 2px;
}
.paquete-capacity {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  text-align: center;
  background: #f4f0ec;
  padding: 0.6rem;
  border-radius: 8px;
}
.paquete-card.selected .paquete-capacity {
  background: #fbe6e1;
  color: #c95d46;
}

/* Steppers */
.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem;
  background: #fafafa;
  border-radius: 16px;
  border: 1px solid #f0f0f0;
  margin-bottom: 1.2rem;
}
.stepper-label {
  font-size: 1rem;
  color: #333;
  font-weight: 600;
}
.stepper-label span {
  display: block;
  font-size: 0.75rem;
  color: #888;
  font-weight: 400;
  margin-top: 0.2rem;
}
.stepper-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-radius: 30px;
  border: 1px solid #eee;
  padding: 0.2rem;
}
.stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f4f0ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  color: #333;
  transition: all 0.2s;
}
.stepper-btn:hover { background: #e0d9d0; }
.stepper-value {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* Dynamic Edades */
.edades-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Validation Capacity */
.capacity-box {
  background: #f4f0ec;
  padding: 1.2rem;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 1rem;
  transition: all 0.3s;
  border: 1px solid transparent;
}
.capacity-box.error {
  background: #fffafa;
  border-color: #ffc1c0;
}
.capacity-text { font-size: 0.95rem; color: #555; font-weight: 500; }
.capacity-numbers { font-size: 1.8rem; font-weight: 700; color: #333; margin: 0.2rem 0; }
.capacity-error-msg { display: none; color: #d73a49; font-size: 0.85rem; font-weight: 600; }
.capacity-box.error .capacity-error-msg { display: block; }
.capacity-box.error .capacity-numbers { color: #d73a49; }

/* Resumen Box (Step 4) */
.resumen-box {
  background: #f9fbfd;
  border: 1px solid #e1eef7;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.resumen-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px dashed #dbe6ef;
}
.resumen-row:last-child { border-bottom: none; padding-bottom: 0; }
.resumen-label { color: #666; font-size: 0.9rem; }
.resumen-val { color: #222; font-weight: 600; font-size: 0.95rem; text-align: right;}
.resumen-total { 
  background: #eef5fa; 
  padding: 1rem; 
  border-radius: 12px; 
  margin-top: 1rem;
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.resumen-total .resumen-label { font-weight: 700; color: #333; font-size: 1rem;}
.resumen-total .resumen-val { font-size: 1.4rem; color: #9FC3E0; font-weight: 700; }

/* Footer Nav */
.reserva-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}
.btn-wizard {
  padding: 1rem 1.5rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  border: none;
}
.btn-back {
  background: #f4f0ec;
  color: #555;
  display: none; /* hidden on step 1 */
}
.btn-back:hover { background: #e0d9d0; }
.btn-next {
  background: #9FC3E0;
  color: #fff;
  flex-grow: 1;
  text-align: center;
}
.btn-next:hover {
  background: #8ab4d6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(159, 195, 224, 0.4);
}
.btn-next:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


/* Corrección Crítica - Scroll Wizard Paso 2 */
#reserva-form-element {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

.reserva-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

.reserva-footer {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
}

@media (max-width: 768px) {
  .reserva-modal {
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    overflow: hidden !important;
  }

  #reserva-form-element {
    height: 100% !important;
    max-height: 100% !important;
  }

  .reserva-body {
    padding: 1.25rem !important;
    overflow-y: auto !important;
    min-height: 0 !important;
  }

  .reserva-footer {
    position: relative !important;
    bottom: auto !important;
    background: #fff !important;
    z-index: 20 !important;
  }

  .paquetes-grid {
    grid-template-columns: 1fr !important;
  }
}

@supports (height: 100svh) {
  @media (max-width: 768px) {
    .reserva-modal {
      height: calc(100svh - 24px) !important;
      max-height: calc(100svh - 24px) !important;
    }
  }
}
