/* ============================================
   RESET Y BASE
   ============================================ */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #020204;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.background_glow {
    position: fixed;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 70vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(255, 30, 56, 0.12) 0%, rgba(2, 2, 4, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.main_wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 14px 40px 14px;

    @media (min-width: 900px) {
        padding: 20px 16px 40px 16px;
    }
}

/* ============================================
   BANNER RRPP DESTACADO
   ============================================ */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(255, 30, 56, 0.2), inset 0 0 10px rgba(255, 30, 56, 0.1); }
    50% { box-shadow: 0 0 20px rgba(255, 30, 56, 0.4), inset 0 0 15px rgba(255, 30, 56, 0.2); }
    100% { box-shadow: 0 0 10px rgba(255, 30, 56, 0.2), inset 0 0 10px rgba(255, 30, 56, 0.1); }
}

.banner_rrpp_fijo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 30, 56, 0.08);
    border: 1px solid rgba(255, 30, 56, 0.4);
    padding: 10px 20px;
    border-radius: 30px;
    margin: 0 auto 16px auto;
    width: fit-content;
    max-width: 95%;
    backdrop-filter: blur(10px);
    animation: pulseGlow 2.5s infinite ease-in-out;
}

.banner_rrpp_fijo .rrpp_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff1e38;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    box-shadow: 0 0 10px rgba(255, 30, 56, 0.5);
    flex-shrink: 0;
}

.banner_rrpp_fijo .rrpp_icon svg {
    width: 14px;
    height: 14px;
    color: #fff;
}

.banner_rrpp_fijo span {
    font-size: 0.85rem;
    color: #ddd;
    line-height: 1.3;
    text-align: center;
}

.banner_rrpp_fijo strong {
    color: #ff1e38;
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 30, 56, 0.3);
}

@media (min-width: 900px) {
    .banner_rrpp_fijo {
        padding: 12px 24px;
        margin: 0 auto 24px auto;
    }
    .banner_rrpp_fijo span {
        font-size: 0.95rem;
    }
    .banner_rrpp_fijo strong {
        font-size: 1.05rem;
    }
}

/* ============================================
   HEADER
   ============================================ */
.header_top {
    text-align: center;
    padding: 0 0 20px 0;

    & h1 {
        font-weight: 900;
        font-size: 2rem;
        letter-spacing: -0.5px;
        text-transform: uppercase;
        background: linear-gradient(135deg, #ffffff 40%, #ff1e38 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        text-shadow: 0 0 25px rgba(255, 30, 56, 0.3);
        margin-bottom: 6px;

        @media (min-width: 900px) {
            font-size: 2.5rem;
        }
    }

    & .subtitle {
        color: #888;
        font-size: 0.8rem;
        font-weight: 500;
        letter-spacing: 1px;
        text-transform: uppercase;

        @media (min-width: 900px) {
            font-size: 0.9rem;
        }
    }
}

/* ============================================
   SELECTOR DE FECHAS
   ============================================ */
.fechas_scroll {
    display: flex;
    gap: 10px;
    padding-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;

    &::-webkit-scrollbar {
        display: none;
    }

    & .btn_fecha {
        background: rgba(20, 20, 28, 0.8);
        color: #999;
        border: 1px solid rgba(255, 255, 255, 0.06);
        padding: 10px 18px;
        border-radius: 25px;
        font-weight: 600;
        font-size: 0.8rem;
        text-transform: uppercase;
        cursor: pointer;
        backdrop-filter: blur(10px);
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
        white-space: nowrap;

        @media (min-width: 900px) {
            padding: 10px 22px;
            font-size: 0.85rem;
            border-radius: 30px;
        }

        &:hover {
            background: rgba(35, 35, 48, 0.9);
            color: #fff;
            border-color: rgba(255, 30, 56, 0.4);
        }

        &.active {
            background: #ff1e38;
            color: #fff;
            border-color: #ff1e38;
            box-shadow: 0 0 18px rgba(255, 30, 56, 0.45);
        }
    }
}

/* ============================================
   GRILLA PRINCIPAL Y COLUMNAS
   ============================================ */
.content_grid {
    display: flex;
    flex-direction: column;
    gap: 18px;

    @media (min-width: 900px) {
        display: grid;
        grid-template-columns: 2.2fr 1fr;
        align-items: start;
        gap: 20px;

        & .right_column {
            position: sticky;
            top: 20px;
        }
    }
}

.left_column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.glass_card {
    background: rgba(12, 12, 18, 0.85);
    border: 1px solid rgba(255, 30, 56, 0.15);
    border-radius: 18px;
    backdrop-filter: blur(20px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;

    @media (min-width: 900px) {
        border-radius: 20px;
    }

    &.p-0 {
        padding: 0;
    }
}

.flex_column {
    display: flex;
    flex-direction: column;
}

.mapa_area_relativa {
    position: relative;
    width: 100%;
    flex-grow: 1;
}

/* ============================================
   CARTEL DE INSTRUCCIÓN
   ============================================ */
.instruccion_top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 30, 56, 0.03);
    border-bottom: 1px solid rgba(255, 30, 56, 0.1);
    font-size: 0.8rem;
    color: #aaa;

    @media (min-width: 900px) {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    & svg {
        width: 14px;
        height: 14px;
        color: #ff1e38;
        flex-shrink: 0;
    }

    & strong {
        color: #fff;
        font-weight: 600;
    }
}

/* ============================================
   BURBUJA "ARRASTRÁ Y HACÉ ZOOM"
   ============================================ */
.burbuja_zoom {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ddd;
    font-size: 0.7rem;
    padding: 5px 12px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 60;
    pointer-events: none;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    white-space: nowrap;

    & .icono_explorar {
        width: 13px;
        height: 13px;
        color: #ff1e38;
        flex-shrink: 0;
    }
}

/* ============================================
   TOOLBAR DE ZOOM
   ============================================ */
.mapa_toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    z-index: 50;

    & button {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        background: rgba(18, 18, 25, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #ccc;
        font-size: 1.05rem;
        cursor: pointer;
        backdrop-filter: blur(5px);
        transition: background-color 0.2s, color 0.2s, border-color 0.2s;

        @media (min-width: 900px) {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            font-size: 1.1rem;
        }

        &:hover {
            background: #ff1e38;
            color: #fff;
            border-color: #ff1e38;
        }
    }
}

/* ============================================
   MAPA: VIEWPORT Y CONTENIDO
   ============================================ */
.mapa_viewport {
    width: 100%;
    height: 48vh;
    overflow: hidden;
    position: relative;
    touch-action: none;
    cursor: grab;

    @media (min-width: 900px) {
        height: 65vh;
    }

    &:active {
        cursor: grabbing;
    }
}

.mapa_content {
    position: relative;
    width: 100%;
    transform-origin: 0 0;
    will-change: transform;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);

    & #mapa_mesas {
        width: 100%;
        height: auto;
        display: block;
        pointer-events: none;
    }

    & #capa_banderas {
        position: absolute;
        inset: 0;
    }

    &.dragging {
        transition: none !important;
    }

    &.cargando {
        filter: blur(6px);
        opacity: 0.5;
        pointer-events: none;
        transition: filter 0.2s ease, opacity 0.2s ease;
    }
}

/* ============================================
   LOADER DEL MAPA
   ============================================ */
.mapa_loader {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 40;
    align-items: center;
    justify-content: center;
    background: rgba(2, 2, 4, 0.25);

    &.activo {
        display: flex;
    }

    & .spinner {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        border: 3px solid rgba(255, 255, 255, 0.15);
        border-top-color: #ff1e38;
        animation: girar 0.8s linear infinite;
    }
}

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

/* ============================================
   BANDERAS DE MESAS
   ============================================ */
.zona_mesa {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;

    & .bandera_mesa {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;

        &.gris {
            filter: grayscale(100%);
        }

        &.color {
            filter: none;
        }
    }
}

/* ============================================
   CARTEL DE PRECIOS Y SECTORES (DEBAJO DEL MAPA)
   ============================================ */
.precios_container {
    padding: 12px 14px;

    & .card_header {
        margin-bottom: 10px;
        text-align: center;

        & h2 {
            font-size: 0.78rem;
            font-weight: 800;
            color: #ff1e38;
            letter-spacing: 1px;
            text-transform: uppercase;
        }
    }
}

.precios_grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;

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

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

.precio_item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 8px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    min-width: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease;

    &:hover {
        background: rgba(255, 255, 255, 0.07);
        border-color: rgba(255, 30, 56, 0.3);
    }
}

.color_badge {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;

    &.rosa { background-color: #ff66ff; box-shadow: 0 0 6px #ff66ff; }
    &.verde { background-color: #22dd22; box-shadow: 0 0 6px #22dd22; }
    &.naranja { background-color: #ff8c22; box-shadow: 0 0 6px #ff8c22; }
    &.rojo { background-color: #ff2222; box-shadow: 0 0 6px #ff2222; }
    &.amarillo { background-color: #ffee22; box-shadow: 0 0 6px #ffee22; }
    &.celeste { background-color: #22bbff; box-shadow: 0 0 6px #22bbff; }
    &.violeta { background-color: #8822dd; box-shadow: 0 0 6px #8822dd; }
}

.nombre_sector {
    font-size: 0.68rem;
    font-weight: 600;
    color: #ccc;
    white-space: nowrap;
}

.monto_sector {
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    margin-left: auto;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

/* ============================================
   PANEL "TUS MESAS"
   ============================================ */
.seleccion_container {
    padding: 18px;

    @media (min-width: 900px) {
        padding: 24px;
    }

    & .header_seleccion {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);

        & h2 {
            font-size: 1rem;
            font-weight: 700;
            color: #fff;
            text-transform: uppercase;
            letter-spacing: 0.5px;

            @media (min-width: 900px) {
                font-size: 1.1rem;
            }
        }

        & .contador_badge {
            background: rgba(255, 30, 56, 0.15);
            color: #ff1e38;
            border: 1px solid rgba(255, 30, 56, 0.3);
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 700;
        }
    }

    & #lista_seleccionadas {
        list-style: none;
        min-height: 50px;
        margin-top: 6px;
        margin-bottom: 20px;
        max-height: 200px;
        overflow-y: auto;
        padding-right: 6px;

        &::-webkit-scrollbar {
            width: 6px;
        }

        &::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 6px;
        }

        &::-webkit-scrollbar-thumb {
            background: rgba(255, 30, 56, 0.45);
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.05);

            &:hover {
                background: rgba(255, 30, 56, 0.75);
            }
        }

        & li {
            border: 1px solid var(--color-mesa, #ff1e38);
            background: rgba(18, 18, 24, 0.75);
            box-shadow: 0 0 12px color-mix(in srgb, var(--color-mesa, #ff1e38) 22%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            padding: 12px 14px;
            border-radius: 12px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            animation: slideIn 0.3s ease forwards;

            & .mesa_info {
                display: flex;
                align-items: center;
                gap: 10px;
            }

            & .mesa_dot {
                width: 8px;
                height: 8px;
                border-radius: 50%;
                display: inline-block;
            }

            & .mesa_numero {
                font-weight: 700;
                color: #fff;
                font-size: 0.9rem;
            }

            & .mesa_precio {
                font-weight: 600;
                color: #bbb;
                font-size: 0.9rem;
            }
        }
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   BOTONES DE ACCIÓN
   ============================================ */
.acciones {
    display: flex;
    flex-direction: column;
    gap: 10px;

    & button {
        width: 100%;
        padding: 12px 16px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
        transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;

        & svg {
            width: 16px;
            height: 16px;
        }
    }

    & #btn_continuar {
        background: #ff1e38;
        color: #fff;
        border: none;
        box-shadow: 0 4px 18px rgba(255, 30, 56, 0.4);

        &:not(:disabled):hover {
            background: #e0152f;
            box-shadow: 0 6px 22px rgba(255, 30, 56, 0.6);
            transform: translateY(-1px);
        }

        &:disabled {
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.3);
            box-shadow: none;
            cursor: not-allowed;
        }
    }

    & #btn_cancelar {
        background: transparent;
        color: #777;
        border: 1px solid rgba(255, 255, 255, 0.08);

        &:hover {
            background: rgba(255, 255, 255, 0.04);
            color: #fff;
        }
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal_overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 100;

    &[style*="display: flex"] .modal_box {
        animation: popModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    & .modal_box {
        background: #121218;
        padding: 26px;
        border-radius: 18px;
        border: 1px solid rgba(255, 30, 56, 0.2);
        text-align: center;
        max-width: 310px;
        width: 90%;
        opacity: 0;
        transform: scale(0.9);
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8);

        & .modal_icon {
            color: #ff1e38;
            margin-bottom: 14px;

            & svg {
                width: 30px;
                height: 30px;
            }
        }

        & #modal_mensaje {
            font-size: 0.92rem;
            color: #ddd;
            font-weight: 500;
            margin-bottom: 22px;
            line-height: 1.45;
        }

        & #modal_cerrar {
            width: 100%;
            padding: 11px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #fff;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;

            &:hover {
                background: rgba(255, 30, 56, 0.2);
                border-color: #ff1e38;
            }
        }
    }
}

@keyframes popModal {
    to {
        opacity: 1;
        transform: scale(1);
    }
}