/* ============================================
   site.css — App-wide overrides & components
   ============================================ */

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    font-family: 'Montserrat', sans-serif;
}

a {
    font-family: 'Montserrat', sans-serif;
}

/* ---------- Focus ring ---------- */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ---------- Footer ---------- */
footer {
    padding-bottom: .5rem !important;
    padding-top: .5rem !important;
}

footer p {
    margin-bottom: 0px;
}

.footer img {
    vertical-align: middle;
}

.footer a:hover {
    text-decoration: underline;
}

/* ---------- Modal ---------- */
.modal-content {
    color: #212529;
}

/* ---------- FullCalendar ---------- */

.fc-slot-active {
    background-color: rgba(52, 152, 219, 0.3) !important;
    border: 2px solid #3498db !important;
}

.fc-timegrid-slot,
.fc-daygrid-day {
    cursor: pointer;
}

.fc-timegrid-slot:hover {
    background-color: rgba(33, 150, 243, 0.1);
    transition: background-color 0.2s;
}

.fc-daygrid-day:hover {
    background-color: rgba(33, 150, 243, 0.1);
    transition: background-color 0.2s;
}

.fc-event.fuera-jornada {
    pointer-events: none;
}

.fc-event-title {
    font-weight: bold;
    font-size: 0.9rem;
}

.fc-event-time {
    font-size: 0.6rem;
    color: #444;
}

.fc-daygrid-event .fc-event-time {
    display: inline;
    font-weight: normal;
    font-size: 0.75rem;
}

#calendario-container {
    min-height: 400px;
    overflow-x: auto;
    width: 100%;
}

.fc-event-title,
.fc-event-main {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    font-weight: bold !important;
    font-size: 0.9rem !important;
    line-height: 1.2rem !important;
    padding: 2px !important;
}

.fc-timegrid-event-harness {
    height: auto !important;
    min-height: 30px !important;
}

.fc-timegrid-col-frame {
    min-height: 100% !important;
}

.fc-toolbar-title {
    font-weight: bold;
}

.fc-col-header-cell-cushion {
    font-weight: bold;
    text-transform: capitalize;
    text-decoration: none;
}

.fc-header-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

@media (max-width: 575.98px) {
    #crearReserva .fc-timegrid-event-harness {
        right: 30% !important;
    }

    .fc-header-toolbar {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "title  title  title"
            "nav    .      views";
        align-items: center;
        gap: .25rem;
    }

    .fc-header-toolbar .fc-toolbar-chunk:first-child {
        grid-area: nav;
    }

    .fc-header-toolbar .fc-toolbar-chunk:nth-child(2) {
        grid-area: title;
    }

    .fc-header-toolbar .fc-toolbar-chunk:last-child {
        grid-area: views;
    }

    .fc .fc-toolbar-title {
        font-size: 1rem;
        text-align: center;
    }

    .fc .fc-button {
        font-size: .75rem;
        padding: .25rem .4rem;
    }

    .fc-button-active {
        box-shadow: none !important;
    }
}

/* ---------- Turno cards (Reserva Create) ---------- */

.tarjetaTurno {
    border-left: 5px solid #6366f1;
    border-radius: .5rem;
    padding: 1rem;
    background: #f8f9fa;
    margin-bottom: .5rem;
}

.datos-turno {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .25rem 1.5rem;
    margin-bottom: .75rem;
}

.datos-turno .etiqueta {
    font-weight: 600;
}

.dato-comentarios {
    grid-column: 1 / -1;
}

.tarjetaTurno button {
    width: 100%;
}

/* ---------- LOGIN ---------- */

.login-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.card-login {
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    animation: fade-slide .6s ease-out;
}

.btn-brand {
    background: #6366f1;
    color: #fff;
}

.btn-brand:hover {
    background: #4f46e5;
}

.input-group .input-group-text,
.input-group .form-control {
    height: 2.6rem;
}

@media (max-width:575.98px) {
    .card-login h3 {
        font-size: 1.35rem;
    }

    .form-label {
        font-size: .9rem;
    }

    .form-control {
        font-size: .95rem;
    }

    .input-group .form-control,
    .input-group .input-group-text {
        height: 3rem;
    }

    .btn-brand {
        padding: .65rem;
        font-size: 1rem;
    }
}

@keyframes fade-slide {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Select2 ---------- */
.select2-container .select2-selection--single {
    height: 38px;
    padding: 6px 12px;
}

/* ---------- Form switch ---------- */
.form-switch {
    padding-left: 0;
}

.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.3rem;
    margin-left: 0;
}

/* ---------- Public booking wrappers ---------- */

.card.selected {
    border-color: #6366f1;
    background-color: #eef2ff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.hidden {
    display: none;
}

.sucursales-wrapper,
.tiposervicio-wrapper,
.servicios-wrapper,
#calendario-horarios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

button#btnConfirmar {
    background-color: #6366f1;
    border: none;
    padding: 0.8rem 1.5rem;
    color: white;
    font-weight: bold;
    border-radius: 6px;
    margin-top: 1rem;
    transition: background-color 0.2s;
}

button#btnConfirmar:hover {
    background-color: #4f46e5;
}

/* ---------- Gallery images ---------- */

.img-galeria {
    display: inline-block;
    max-height: 65vh;
    width: auto;
    object-fit: contain;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 2.5rem;
    height: 2.5rem;
}

/* ---------- Loading overlay ---------- */

#overlay-cargando {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    font-size: 1.2rem;
    color: #555;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 5px solid #ccc;
    border-top: 5px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
