/* ==========================================================================
   CANCHEETAH - BOOKING GRID MOBILE (ESTILO PLAYTOMIC)
   Optimizada para UX táctil, scroll horizontal fluido y grilla compacta
   ========================================================================== */

@media (max-width: 767.98px) {

    .booking-section {
        padding-bottom: 0;
    }

    /* ─── ENCABEZADO MOBILE (DEPORTES + CANCHAS) ─── */
    .mobile-booking-header {
        padding: 1.125rem 1rem 0.25rem 1rem;
    }

    /* ─── FILTRO DE DEPORTES MOBILE ─── */
    .mobile-sports-bar {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 2px 2px 10px 2px;
        margin-bottom: 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-sports-bar::-webkit-scrollbar {
        display: none;
    }

    .m-sport-pill {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.09);
        color: var(--text-muted, #94a3b8);
        border-radius: 50px;
        padding: 6px 14px;
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        white-space: nowrap;
        user-select: none;
    }

    .m-sport-pill:active {
        transform: scale(0.96);
    }

    .m-sport-pill.active {
        background: rgba(168, 85, 247, 0.16);
        border-color: var(--accent-p, #7c3aed);
        color: #fff;
        box-shadow: 0 0 14px rgba(124, 58, 237, 0.25);
    }

    .m-pill-badge {
        font-size: 0.68rem;
        background: rgba(255, 255, 255, 0.1);
        padding: 1px 6px;
        border-radius: 10px;
        color: #fff;
    }
    .m-sport-pill.active .m-pill-badge {
        background: var(--accent-p, #7c3aed);
    }

    /* ─── CARRUSEL HORIZONTAL DE CANCHAS (PLAYTOMIC TABS) ─── */
    .mobile-courts-scroll {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 4px 1rem 14px 1rem;
        margin: 0 -1rem 16px -1rem;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .mobile-courts-scroll::-webkit-scrollbar {
        display: none;
    }

    .mobile-court-tab {
        flex: 0 0 auto;
        min-width: 140px;
        max-width: 175px;
        background: var(--bg-card, #0c1024);
        border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
        border-radius: 14px;
        padding: 10px 12px;
        text-align: left;
        cursor: pointer;
        scroll-snap-align: start;
        transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 6px;
        user-select: none;
    }

    .mobile-court-tab:active {
        transform: scale(0.97);
    }

    .mobile-court-tab.active {
        background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
        border-color: var(--accent-c, #a855f7);
        box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    }

    .m-court-tab__top {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .m-court-tab__emoji {
        font-size: 1.1rem;
        line-height: 1;
        flex-shrink: 0;
    }

    .m-court-tab__name {
        font-family: 'Outfit', sans-serif;
        font-size: 0.88rem;
        font-weight: 700;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .m-court-tab__bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
    }

    .m-court-tab__price {
        font-family: 'Outfit', sans-serif;
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--accent-c, #06b6d4);
    }

    .mobile-court-tab.active .m-court-tab__price {
        color: #38bdf8;
    }

    .m-court-tab__badge {
        font-size: 0.65rem;
        font-weight: 700;
        padding: 1px 5px;
        border-radius: 4px;
        background: rgba(74, 222, 128, 0.15);
        color: #4ade80;
        border: 1px solid rgba(74, 222, 128, 0.3);
    }

    /* ─── CONTENEDOR DE HORARIOS ─── */
    #mobileSlots {
        display: flex;
        flex-direction: column;
        gap: 22px;
        padding: 0.25rem 1rem 1.75rem 1rem;
    }

    /* ─── PERÍODOS DEL DÍA (MAÑANA, TARDE, NOCHE) ─── */
    .m-period-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .m-period-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.76rem;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.65);
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .m-period-title {
        display: flex;
        align-items: center;
        gap: 6px;
        color: #fff;
    }

    .m-period-title i {
        color: var(--accent-c, #a855f7);
        font-size: 0.88rem;
    }

    .m-period-count {
        font-size: 0.7rem;
        font-weight: 600;
        color: #34d399;
        background: rgba(52, 211, 153, 0.1);
        padding: 2px 8px;
        border-radius: 12px;
        border: 1px solid rgba(52, 211, 153, 0.22);
    }

    /* ─── GRILLA DE TURNOS (3 COLUMNAS RESPONSIVE) ─── */
    .m-slots-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    @media (min-width: 480px) {
        .m-slots-grid {
            grid-template-columns: repeat(4, 1fr);
        }
    }

    /* ─── BOTÓN DE TURNO COMPACTO ─── */
    .m-slot-btn {
        background: var(--bg-card, #0c1024);
        border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
        border-radius: 12px;
        padding: 9px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 52px;
        text-align: center;
        cursor: pointer;
        user-select: none;
        transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
        position: relative;
    }

    .m-slot-btn:active {
        transform: scale(0.95);
    }

    /* Disponible */
    .m-slot-btn.available {
        border-color: rgba(168, 85, 247, 0.32);
        background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(168, 85, 247, 0.12) 100%);
    }

    .m-slot-btn.available:hover {
        border-color: var(--accent-c, #a855f7);
        box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
    }

    .m-slot-btn .m-slot-time {
        font-family: 'Outfit', sans-serif;
        font-size: 0.96rem;
        font-weight: 800;
        color: #fff;
        line-height: 1.1;
    }

    .m-slot-btn .m-slot-price {
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--accent-c, #06b6d4);
        margin-top: 3px;
        line-height: 1;
    }

    .m-slot-btn.available .m-slot-price {
        color: #38bdf8;
    }

    /* Con promo */
    .m-slot-btn.has-promo .m-slot-price {
        color: #4ade80;
    }

    .m-slot-promo-dot {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #4ade80;
        box-shadow: 0 0 6px #4ade80;
    }

    /* Ocupado */
    .m-slot-btn.occupied {
        background: rgba(255, 255, 255, 0.02);
        border-color: rgba(255, 255, 255, 0.04);
        opacity: 0.38;
        cursor: not-allowed;
    }

    .m-slot-btn.occupied .m-slot-time {
        color: rgba(255, 255, 255, 0.35);
        text-decoration: line-through;
        font-weight: 600;
    }

    .m-slot-btn.occupied .m-slot-price {
        color: rgba(255, 255, 255, 0.2);
        font-size: 0.65rem;
    }

    /* Pasado */
    .m-slot-btn.past {
        display: none;
    }

    /* Empty state para la cancha */
    .mobile-no-slots {
        text-align: center;
        padding: 2.5rem 1rem;
        background: var(--bg-card, #0c1024);
        border: 1px dashed rgba(255, 255, 255, 0.1);
        border-radius: 16px;
    }

    .mobile-no-slots i {
        font-size: 2.2rem;
        color: rgba(255, 255, 255, 0.25);
    }

    .mobile-no-slots p {
        color: var(--text-muted, #94a3b8);
        margin-top: 0.75rem;
        font-size: 0.88rem;
    }

    /* Skeleton mientras carga */
    .m-slots-skeleton {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .m-skeleton-box {
        height: 52px;
        background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card2) 50%, var(--bg-card) 100%);
        background-size: 200% 100%;
        animation: m-skeleton-loading 1.2s ease-in-out infinite;
        border-radius: 12px;
        border: 1px solid var(--border);
    }

    @keyframes m-skeleton-loading {
        0%   { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
}