/**
 * Estilos del frontend para reservas de espacios
 */

/* Día seleccionado por el usuario */
.calendar__day.selected {
    background: #0073aa;
    color: #fff;
}

.grve-notification.danger {
    width: 100%;
    color: #8c0000;
    background: #ffc4c4;
    padding: 10px;
    border: solid #8c0000 1px;
}

.c-reserva-calendario p {
    width: 100%;
}

/* Contenedor general */
.calendar {
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    font-family: sans-serif;
}

/* Header: 7 columnas */
.calendar__header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f5f5f5;
    text-align: center;
}

.calendar__header-day {
    padding: 10px 0;
    font-weight: bold;
    border-right: 1px solid #e0e0e0;
}

.calendar__header-day:last-child {
    border-right: none;
}

/* Body: 7 columnas, filas automáticas */
.calendar__body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(80px, auto);
}

.calendar__day {
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 6px;
    position: relative;
    cursor: pointer;
}

.calendar__day:nth-child(7n) {
    border-right: none;
}

.calendar__day--empty {
    background: #fafafa;
    cursor: default;
}

.calendar__date {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

/* Estados especiales */
.calendar__day--today {
    background: #e1f5fe;
}

.calendar__day--occupied-full {
    background: #ffebee;
    color: #c62828;
    cursor: not-allowed;
}

.calendar__day--occupied-partial {
    background: #fff3e0;
}

/* Info de reservas */
.calendar__info {
    font-size: 0.75rem;
    margin-top: 4px;
}

.calendar__tramo {
    display: inline-block;
    margin-right: 2px;
    padding: 2px 4px;
    border-radius: 4px;
    background: #eee;
}

.c-reserva-calendario #calendar-container .calendar {
    max-width: 100%;
}

.gdpr-consent {
    display: block;
    margin-top: 20px;
    font-size: 0.9em;
}

.gdpr-consent input[type="checkbox"] {
    margin-right: 6px;
}

/* Responsive: scroll horizontal en móvil */
@media (max-width: 600px) {
    .calendar {
        overflow-x: auto;
    }
    
    .calendar__header,
    .calendar__body {
        min-width: 700px;
    }
}

/* Estilos para días seleccionados */
.reserva-dia-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.reserva-dia-fecha {
    flex: 1;
}

.reserva-dia-horas {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reserva-dia-horas label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    font-weight: 500;
}

.reserva-dia-horas select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

.reserva-dia-horas select:hover {
    border-color: #999;
}

.reserva-dia-horas select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.reserva-dia-remove {
    flex-shrink: 0;
}

.reserva-dia-remove a {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: #dc3232;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
}

.reserva-dia-remove a:hover {
    background: #a00;
}

/* Estilos para el shortcode de mostrar espacios */
.reservas-espacios-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.reservas-espacios-hotel-group {
    margin-bottom: 40px;
}

.reservas-espacios-hotel-group:last-child {
    margin-bottom: 0;
}

.reservas-espacios-hotel-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.reservas-espacios-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    width: 100%;
}

.reservas-espacio-form {
    display: flex;
    flex: 0 0 auto;
    width: 15.625rem;
    min-width: 15.625rem;
    max-width: 15.625rem;
}

.reservas-espacio-button {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: #333 !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    padding: 15px !important;
    transition: all 0.3s ease !important;
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
    font-family: inherit !important;
    font-size: inherit !important;
    cursor: pointer !important;
    text-align: left !important;
    margin: 0 !important;
}

.reservas-espacio-button:hover {
    border-color: #ddd !important;
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
    color: #333 !important;
}

.reservas-espacio-button:focus {
    outline: 2px solid #ddd !important;
    outline-offset: 2px !important;
    background: #fff !important;
    background-color: #fff !important;
}

.reservas-espacio-imagen {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 15px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.reservas-espacio-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    min-width: 100%;
    min-height: 100%;
}

.reservas-espacio-titulo {
    text-align: center;
    padding: 10px 0;
}

.reservas-espacio-titulo span {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    display: block;
    line-height: 1.4;
}

.reservas-espacio-button:hover .reservas-espacio-titulo span {
    color: #333 !important;
}

.reservas-espacio-deshabilitado {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.reservas-espacio-deshabilitado::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

/* Responsive */
@media (min-width: 1921px) {
    .reservas-espacios-grid {
        flex-wrap: nowrap;
    }
}

@media (min-width: 1601px) and (max-width: 1920px) {
    .reservas-espacios-grid {
        flex-wrap: wrap;
        gap: 1.25rem;
    }
    
    .reservas-espacio-form {
        width: calc((100% - 3.75rem) / 4);
        min-width: calc((100% - 3.75rem) / 4);
        max-width: calc((100% - 3.75rem) / 4);
    }
}

@media (min-width: 1401px) and (max-width: 1600px) {
    .reservas-espacios-grid {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .reservas-espacio-form {
        width: calc((100% - 3rem) / 4);
        min-width: calc((100% - 3rem) / 4);
        max-width: calc((100% - 3rem) / 4);
    }
}

@media (min-width: 1201px) and (max-width: 1400px) {
    .reservas-espacios-grid {
        flex-wrap: wrap;
        gap: 0.875rem;
    }
    
    .reservas-espacio-form {
        width: calc((100% - 2.625rem) / 4);
        min-width: calc((100% - 2.625rem) / 4);
        max-width: calc((100% - 2.625rem) / 4);
    }
}

@media (max-width: 1200px) {
    .reservas-espacios-grid {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .reservas-espacio-form {
        width: calc((100% - 3rem) / 4);
        min-width: calc((100% - 3rem) / 4);
        max-width: calc((100% - 3rem) / 4);
    }
}

@media (max-width: 992px) {
    .reservas-espacios-grid {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .reservas-espacio-form {
        width: calc((100% - 2rem) / 3);
        min-width: calc((100% - 2rem) / 3);
        max-width: calc((100% - 2rem) / 3);
    }
}

@media (max-width: 768px) {
    .reservas-espacios-grid {
        flex-wrap: wrap;
        gap: 0.9375rem;
    }
    
    .reservas-espacio-form {
        width: calc((100% - 0.9375rem) / 2);
        min-width: calc((100% - 0.9375rem) / 2);
        max-width: calc((100% - 0.9375rem) / 2);
    }
    
    .reservas-espacio-button {
        padding: 0.75rem !important;
        min-height: 12.5rem;
    }
    
    .reservas-espacio-imagen {
        aspect-ratio: 4 / 3;
        margin-bottom: 0.75rem;
    }
    
    .reservas-espacios-hotel-title {
        font-size: 1.3em;
        margin-bottom: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .reservas-espacios-grid {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .reservas-espacio-form {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }
    
    .reservas-espacio-button {
        padding: 0.9375rem !important;
        min-height: 13.75rem;
    }
    
    .reservas-espacio-imagen {
        aspect-ratio: 4 / 3;
        margin-bottom: 0.625rem;
    }
}

/* Estilos para el formulario de reserva */
.reservas-espacios-mensaje {
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.reservas-calendario-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reservas-calendario-controls label {
    font-weight: 600;
    margin-right: 5px;
}

.reservas-calendario-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.reservas-formulario-reserva {
    max-width: 600px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.reservas-form-field {
    margin-bottom: 15px;
}

.reservas-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.reservas-form-field input[type="text"],
.reservas-form-field input[type="email"],
.reservas-form-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.reservas-form-field input[type="text"]:focus,
.reservas-form-field input[type="email"]:focus,
.reservas-form-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.reservas-form-submit {
    margin-top: 20px;
}
