/* MORFáR v1.0.3
   Ajuste definitivo: formulario más ancho y calendario sin desplazamiento lateral. */

/* La sección de reserva aprovecha prácticamente todo el ancho de la pantalla. */
#reservar.wrap{
  width:min(1520px, calc(100% - 40px));
  max-width:none;
}

/* Resumen lateral compacto + formulario flexible. */
#reservar .reserve{
  grid-template-columns:240px minmax(0, 1fr);
  gap:24px;
  align-items:start;
}

#reservar .reserve > *,
#reservar .form,
#reservar .student-card,
#reservar .reserve-grid{
  min-width:0;
}

/* La grilla entra dentro del formulario. No tiene scroll horizontal. */
#reservar .reserve-grid{
  width:100%;
  max-width:100%;
  overflow:visible;
  padding:10px;
}

/* Se anulan los anchos mínimos agregados en correcciones anteriores. */
#reservar .reserve-grid table{
  width:100%;
  min-width:0 !important;
  max-width:100%;
  table-layout:fixed;
  border-spacing:7px 10px;
}

/* Columna de semana más angosta; los cinco días se reparten por igual. */
#reservar .reserve-grid th:first-child,
#reservar .reserve-grid td:first-child{
  width:92px !important;
}

#reservar .reserve-grid th:not(:first-child),
#reservar .reserve-grid td:not(:first-child){
  width:auto !important;
}

/* Tarjetas parejas, pero suficientemente compactas para entrar. */
#reservar .reserve-grid .day{
  width:100%;
  min-width:0;
  min-height:172px;
  height:100%;
  display:flex;
  flex-direction:column;
  padding:10px;
  overflow-wrap:anywhere;
  word-break:normal;
}

#reservar .reserve-grid .day strong{
  font-size:14px;
  line-height:1.15;
}

#reservar .reserve-grid .day span{
  font-size:11px;
  line-height:1.25;
}

#reservar .reserve-grid .day em{
  margin-top:auto;
  padding-top:10px;
  font-size:13px;
}

/* Evita cualquier desplazamiento general de la página. */
html,
body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

/* En notebooks medianas, el resumen pasa arriba para darle todo el ancho a la grilla. */
@media(max-width:1180px){
  #reservar .reserve{
    grid-template-columns:1fr;
  }

  #reservar .summary{
    position:static;
  }

  #reservar .reserve-grid th:first-child,
  #reservar .reserve-grid td:first-child{
    width:82px !important;
  }

  #reservar .reserve-grid{
    padding:7px;
  }

  #reservar .reserve-grid table{
    border-spacing:5px 8px;
  }

  #reservar .reserve-grid .day{
    min-height:162px;
    padding:8px;
  }
}

/* En tablet se mantiene la grilla completa, compactando textos. */
@media(max-width:820px){
  #reservar.wrap{
    width:calc(100% - 20px);
  }

  #reservar .form{
    padding:16px;
  }

  #reservar .reserve-grid th:first-child,
  #reservar .reserve-grid td:first-child{
    width:60px !important;
  }

  #reservar .reserve-grid th{
    padding:7px 3px;
    font-size:11px;
  }

  #reservar .reserve-grid .day{
    min-height:150px;
    padding:6px;
  }

  #reservar .reserve-grid .day strong{
    font-size:11px;
  }

  #reservar .reserve-grid .day span{
    font-size:9px;
  }

  #reservar .reserve-grid .day em{
    font-size:10px;
  }
}
