/* ═══════════════════════════════════════════════════════
   MODAL DE RESERVACIÓN — Chinampa Mitoti
   v2: Incluye calendario visual de fechas disponibles
   ═══════════════════════════════════════════════════════ */

/* ─── OVERLAY ─── */
.mitoti-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ─── MODAL CONTAINER ─── */
.mitoti-modal {
    background: var(--crema);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px) scale(0.97);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.mitoti-modal-overlay.active .mitoti-modal {
    transform: translateY(0) scale(1);
}

.mitoti-modal::-webkit-scrollbar { width: 4px; }
.mitoti-modal::-webkit-scrollbar-track { background: transparent; }
.mitoti-modal::-webkit-scrollbar-thumb { background: var(--rojo); border-radius: 2px; }

/* ─── HEADER ─── */
.mitoti-modal-header {
    background: var(--negro);
    padding: 2rem 2.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mitoti-modal-header h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: var(--rojo);
    line-height: 0.95;
    margin: 0;
}

.mitoti-modal-header p {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    letter-spacing: 0.08em;
}

.mitoti-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
    line-height: 1;
}

.mitoti-modal-close:hover { color: var(--rojo); }

/* ─── BODY ─── */
.mitoti-modal-body {
    padding: 2rem 2.5rem 2.5rem;
}

/* ─── FORM GROUPS ─── */
.mf-group {
    margin-bottom: 1.5rem;
}

.mf-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--rojo);
    margin-bottom: 0.5rem;
}

.mf-input,
.mf-select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid rgba(26, 26, 26, 0.15);
    background: var(--blanco);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--negro);
    transition: border-color 0.3s;
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
}

.mf-input:focus,
.mf-select:focus {
    border-color: var(--rojo);
}

.mf-input::placeholder {
    color: #bbb;
}

.mf-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ed3039' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ═══════════════════════════════════════════════════════
   CALENDARIO VISUAL — Selector de fechas disponibles
   ═══════════════════════════════════════════════════════ */

.mf-calendar-container {
    border: 1.5px solid rgba(26, 26, 26, 0.15);
    background: var(--blanco);
    min-height: 100px;
}

/* Loading / mensajes */
.mf-calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2rem 1rem;
    font-size: 0.85rem;
    color: #999;
    text-align: center;
}

.mf-cal-nodata {
    color: #999;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

.mf-cal-nodata strong {
    color: var(--rojo);
}

.mf-cal-link {
    color: var(--rojo);
    text-decoration: none;
    font-weight: 600;
}

.mf-cal-link:hover {
    text-decoration: underline;
}

/* Spinner pequeño */
.mf-spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(237, 48, 57, 0.2);
    border-top-color: var(--rojo);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* Navegación del calendario */
.mf-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem 0.5rem;
    border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

.mf-cal-month {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.15rem;
    color: var(--negro);
    letter-spacing: 0.05em;
    user-select: none;
}

.mf-cal-nav-btn {
    background: none;
    border: 1.5px solid rgba(26, 26, 26, 0.15);
    color: var(--negro);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s;
    user-select: none;
}

.mf-cal-nav-btn:hover:not(:disabled) {
    background: var(--rojo);
    border-color: var(--rojo);
    color: var(--blanco);
}

.mf-cal-nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* Grilla del calendario */
.mf-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 0.5rem 0.8rem 0.8rem;
}

/* Nombres de los días */
.mf-cal-dayname {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    text-align: center;
    padding: 0.4rem 0 0.2rem;
    user-select: none;
}

/* Día genérico */
.mf-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: rgba(26, 26, 26, 0.3);
    user-select: none;
    border: none;
    background: none;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
}

.mf-cal-empty {
    /* celda vacía antes del día 1 */
}

.mf-cal-past {
    color: rgba(26, 26, 26, 0.18);
}

/* Día disponible — interactivo */
.mf-cal-available {
    color: var(--negro);
    font-weight: 700;
    background: rgba(237, 48, 57, 0.08);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.mf-cal-available:hover {
    background: var(--rojo);
    color: var(--blanco);
}

/* Día seleccionado */
.mf-cal-selected,
.mf-cal-selected:hover {
    background: var(--rojo);
    color: var(--blanco);
}

/* Indicador de fecha seleccionada */
.mf-fecha-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(237, 48, 57, 0.06);
    border-top: 1px solid rgba(237, 48, 57, 0.12);
    font-size: 0.85rem;
    color: var(--negro);
    font-weight: 500;
}

.mf-fecha-icon {
    color: var(--rojo);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   PEOPLE COUNTER (sin cambios)
   ═══════════════════════════════════════════════════════ */

.mf-counter-row {
    display: flex;
    gap: 1.5rem;
}

.mf-counter {
    flex: 1;
}

.mf-counter-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--rojo);
    margin-bottom: 0.5rem;
    display: block;
}

.mf-counter-sublabel {
    font-size: 0.7rem;
    color: #999;
    display: block;
    margin-bottom: 0.4rem;
}

.mf-counter-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid rgba(26, 26, 26, 0.15);
    background: var(--blanco);
}

.mf-counter-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    color: var(--negro);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
    font-weight: 700;
}

.mf-counter-btn:hover { background: var(--rojo); color: var(--blanco); }
.mf-counter-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.mf-counter-btn:disabled:hover { background: transparent; color: var(--negro); }

.mf-counter-value {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--negro);
    min-width: 40px;
}

/* ─── PRICE SUMMARY ─── */
.mf-summary {
    background: var(--negro);
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.mf-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}

.mf-summary-label { color: rgba(255,255,255,0.5); }
.mf-summary-value { color: var(--blanco); font-weight: 500; }

.mf-summary-total {
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 0.5rem;
    padding-top: 0.8rem;
}

.mf-summary-total .mf-summary-label {
    color: var(--blanco);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mf-summary-total .mf-summary-value {
    color: var(--rojo);
    font-size: 1.3rem;
    font-weight: 700;
}

/* ─── CAPACITY NOTE ─── */
.mf-capacity-note {
    font-size: 0.78rem;
    color: #999;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mf-capacity-note.warning { color: var(--rojo); }

/* ─── SUBMIT BUTTON ─── */
.mf-submit {
    width: 100%;
    padding: 1rem;
    background: var(--rojo);
    color: var(--blanco);
    border: 2px solid var(--rojo);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.mf-submit:hover:not(:disabled) {
    background: var(--negro);
    border-color: var(--negro);
}

.mf-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mf-submit.loading {
    color: transparent;
    pointer-events: none;
}

.mf-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--blanco);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── ERROR MESSAGE ─── */
.mf-error {
    background: rgba(237, 48, 57, 0.1);
    border-left: 3px solid var(--rojo);
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: var(--rojo);
    margin-bottom: 1rem;
    display: none;
}

.mf-error.visible { display: block; }

/* ─── TERMS ─── */
.mf-terms {
    font-size: 0.75rem;
    color: #999;
    margin-top: 1rem;
    line-height: 1.5;
    text-align: center;
}

.mf-terms a {
    color: var(--rojo);
    text-decoration: none;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 575px) {
    .mitoti-modal { max-height: 100vh; }
    .mitoti-modal-header { padding: 1.5rem; }
    .mitoti-modal-body { padding: 1.5rem; }
    .mf-counter-row { flex-direction: column; gap: 1rem; }
    .mitoti-modal-header h3 { font-size: 1.6rem; }

    .mf-calendar-grid { gap: 1px; padding: 0.4rem 0.5rem 0.6rem; }
    .mf-cal-day { font-size: 0.78rem; }
    .mf-cal-dayname { font-size: 0.6rem; }
    .mf-cal-nav-btn { width: 28px; height: 28px; }
}
