/* ---------- RESET ---------- */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.4;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}
h1 {
    color: #2c3e50;
    margin: 0;
}
.precio {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    color: #27ae60;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

/* ---------- NAVEGACIÓN ---------- */
.navegacion-fecha {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.btn-nav {
    padding: 10px 15px;
    background: #34495e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}
.btn-nav:hover { background: #2c3e50; }
.fecha-titulo {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    background: rgba(255,255,255,0.8);
    padding: 5px 15px;
    border-radius: 20px;
}

/* ---------- SEMANA (CALENDARIO) ---------- */
.semana-container {
    overflow-x: auto; /* IMPORTANTE: Activa scroll horizontal */
    -webkit-overflow-scrolling: touch;
}

.semana-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 10px;
    min-width: 800px; /* Asegura que no se colapse en móviles */
}

.dia-header {
    background: #34495e;
    color: white;
    padding: 8px 5px;
    text-align: center;
    border-radius: 5px;
}
.dia-nombre { font-weight: bold; font-size: 14px; }
.dia-fecha { font-size: 11px; opacity: .9; }

.semana-body {
    display: flex;
    min-width: 800px; /* Debe coincidir con el header */
}

.hora-columna-horas {
    width: 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hora-etiqueta {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    color: #7f8c8d;
    margin-right: 4px;
}

.semana-dias-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
}

.dia-columna {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hora-casilla-semana {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all .2s ease;
    text-align: center;
    padding: 2px;
}

/* ESTADOS DE LAS CASILLAS */
.hora-casilla-semana.disponible { background: #27ae60; color: white; }
.hora-casilla-semana.disponible:hover { background: #2ecc71; transform: scale(1.02); }

.hora-casilla-semana.caducada { background: #bdc3c7; color: #fff; cursor: not-allowed; opacity: 0.6; }

.hora-casilla-semana.reservada { 
    background: #e74c3c; color: white; cursor: not-allowed; 
    font-size: 9px; line-height: 1.1; 
}

.hora-casilla-semana.reservada-admin { 
    background: #e67e22 !important; color: white; cursor: not-allowed; 
    font-size: 9px; line-height: 1.1; 
}

/* ---------- MODAL ---------- */
.modal-oculto { display: none; }
#modal-reserva {
    position: fixed; z-index: 1000; left: 0; top: 0; 
    width: 100%; height: 100%; background: rgba(0,0,0,.6); 
    display: none; align-items: center; justify-content: center;
}
/* Cuando se muestra el modal */
#modal-reserva:not(.modal-oculto) { display: flex; }

.modal-contenido {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    width: 95%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.modal-cerrar {
    position: absolute; top: 10px; right: 15px;
    font-size: 24px; cursor: pointer; color: #999;
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input { 
    width: 100%; padding: 12px; border: 1px solid #ddd; 
    border-radius: 5px; font-size: 16px; 
}

.btn-reservar {
    width: 100%; padding: 12px; background: #3498db;
    color: white; border: none; border-radius: 5px;
    font-size: 16px; font-weight: bold; cursor: pointer;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .semana-container { padding: 10px; }
    .btn-nav { padding: 8px 12px; font-size: 13px; }
    .fecha-titulo { font-size: 14px; }
}

@media (max-width: 480px) {
    .container { padding: 10px; }
    .precio { font-size: 16px; }
}