﻿/* CONTENEDOR */
.pedido-container {
    max-width: 1400px;
    margin: auto;
    padding: 1rem;
}

/* GRID PRINCIPAL */
.pedido-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

/* PRODUCTOS */
.pedido-productos {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* DETALLE */
.pedido-detalle {
    border-radius: 16px;
    background: var(--rz-base-default);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* SCROLL INTERNO */
.detalle-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* MESAS */
.pedido-mesas {
    margin-top: 1rem;
}

/* ACCIONES */
.pedido-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}


/* GRID */
.productos-grid-pedido {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

/* CARD */
.producto-card-pos-pedido {
    background: var(--rz-base-default);
    border-radius: 16px;
    padding: .8rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
    position: relative;
    border: 2px solid transparent;
}

    /* HOVER */
    .producto-card-pos-pedido:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 10px 25px rgba(0,0,0,.1);
    }

    /* ACTIVO */
    .producto-card-pos-pedido.active {
        border: 2px solid var(--rz-primary);
        box-shadow: 0 0 0 3px rgba(var(--rz-primary-rgb), .15);
        animation: pulseSelect .3s ease;
    }

/* IMAGEN */
.producto-img-pedido img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

/* PLACEHOLDER */
.producto-placeholder-pedido {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--rz-primary);
}

/* INFO */
.producto-info-pedido {
    margin-top: .5rem;
}

.producto-nombre-pedido {
    font-weight: 600;
    display: block;
}

.producto-categoria-pedido {
    font-size: .75rem;
    color: var(--rz-text-secondary-color);
}

/* CHECK */
.producto-check-pedido {
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--rz-primary);
    font-size: 20px;
    animation: scaleIn .2s ease;
}

/* ANIMACIONES */
@keyframes pulseSelect {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* CONTENEDOR */
.mesas-container-pedido {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

/* HEADER */
.mesas-header-pedido {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* SEARCH */
.mesa-search-pedido {
    max-width: 200px;
}

/* CHIPS */
.mesas-chips-pedido {
    display: flex;
    gap: .6rem;
    overflow-x: auto;
    padding-bottom: .5rem;
}

.mesa-chip-pedido.disabled-mesa {
    opacity: 0.5;
    filter: grayscale(1);
    cursor: not-allowed;
    pointer-events: none; /* Evita el click */
}

/* CHIP */
.mesa-chip-pedido {
    min-width: 120px;
    padding: .6rem .8rem;
    border-radius: 12px;
    background: var(--rz-base-default);
    border: 1px solid rgba(0,0,0,.08);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    transition: .2s;
}

    /* HOVER */
    .mesa-chip-pedido:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,.08);
    }

    /* ACTIVA */
    .mesa-chip-pedido.active {
        border: 2px solid var(--rz-primary);
        background: rgba(var(--rz-primary-rgb), .08);
    }

    /* DISABLED */
    .mesa-chip-pedido.disabled {
        opacity: .5;
        cursor: not-allowed;
    }

/* NOMBRE */
.mesa-nombre-pedido {
    font-weight: 600;
}

/* ESTADO */
.mesa-estado-pedido {
    font-size: .75rem;
    font-weight: 600;
}

    /* COLORES */
    .mesa-estado-pedido.disponible {
        color: var(--rz-success);
    }

    .mesa-estado-pedido.reservada {
        color: var(--rz-warning);
    }

    .mesa-estado-pedido.ocupada {
        color: var(--rz-secondary);
    }



/* CONTENEDOR */
.pedido-detalle-container {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

/* ITEM */
.pedido-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.8rem;
    padding: .7rem .9rem;
    border-radius: 14px;
    background: var(--rz-base-default);
    border: 1px solid rgba(0,0,0,.06);
    margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
    .pedido-item {
        grid-template-columns: 1fr auto;
    }

    .pedido-item-info {
        grid-column: 1 / span 2; 
        border-bottom: 1px solid rgba(0,0,0,0.03);
        padding-bottom: 0.4rem;
    }

    .pedido-item-controls {
        justify-content: flex-start;
    }

    .pedido-item-total {
        text-align: right;
        font-size: 0.9rem;
    }

    .pedido-item-delete {
        grid-row: 1;
        grid-column: 2;
    }
}

    /* HOVER */
    .pedido-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0,0,0,.08);
    }

/* INFO */
.pedido-item-info {
    display: flex;
    flex-direction: column;
}

.pedido-item-nombre {
    font-weight: 600;
}

.pedido-item-precio {
    font-size: .75rem;
    color: var(--rz-text-secondary-color);
}

/* CONTROLES */
.pedido-item-controls {
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* BOTONES */
.btn-cantidad {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: var(--rz-primary);
    color: white;
    cursor: pointer;
    transition: .2s;
}

    .btn-cantidad:hover {
        transform: scale(1.1);
    }

/* CANTIDAD */
.cantidad {
    min-width: 20px;
    text-align: center;
}

/* TOTAL */
.pedido-item-total {
    font-weight: bold;
    color: var(--rz-success);
}

/* DELETE */
.pedido-item-delete {
    margin-left: .5rem;
}

/* TOTAL FINAL */
.pedido-total {
    margin-top: .8rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(0,0,0,.08);
    text-align: right;
    font-size: 1.1rem;
}

/* EMPTY */
.pedido-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1rem;
    color: var(--rz-text-secondary-color);
}

/* ANIMACIÓN */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.pedido-item.new {
    animation: bounceIn .3s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    60% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* DESCRIPCIÓN */
.pedido-item-desc {
    margin-top: 2px;
    font-size: .75rem !important;
    border-radius: 8px !important;
    border: 1px dashed rgba(0,0,0,.1) !important;
    background: rgba(var(--rz-base-contrast-rgb), .03) !important;
    padding: 2px 6px !important;
}

    /* FOCUS */
    .pedido-item-desc:focus {
        border-color: var(--rz-primary) !important;
        background: white !important;
    }


/* FOOTER */
.detalle-footer {
    margin-top: 1rem;
    padding-top: .8rem;
    border-top: 1px solid rgba(0,0,0,.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* TOTAL */
.footer-total {
    font-size: 1.2rem;
    font-weight: 600;
}

/* ACCIONES */
.footer-actions {
    display: flex;
    gap: .6rem;
}

/* BOTÓN PRINCIPAL */
.btn-confirmar {
    padding: .6rem 1.2rem !important;
    font-size: .95rem !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
    transition: all .2s ease;
}

    /* HOVER */
    .btn-confirmar:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(0,0,0,.2);
    }

    /* CLICK */
    .btn-confirmar:active {
        transform: scale(0.96);
    }

/* CANCELAR */
.btn-cancelar {
    padding: .6rem 1rem !important;
    border-radius: 10px !important;
    opacity: .85;
    transition: .2s;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px; 
}

    .btn-cancelar:hover {
        opacity: 1;
    }

    .btn-cancelar .rz-button-icon-left {
        margin-right: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

.btn-confirmar.ready {
    animation: pulseReady 1s infinite;
}

@keyframes pulseReady {
    0% {
        box-shadow: 0 0 0 0 rgba(0,255,0,.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0,255,0,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0,255,0,0);
    }
}

.fly-item {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 9999;
    transition: all .6s cubic-bezier(.25,.8,.25,1);
}

    .fly-item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.pedido-item.updated {
    animation: pulseQty .25s ease;
}

@keyframes pulseQty {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.pedido-item.updated {
    animation: pulseQty .25s ease;
}

@keyframes pulseQty {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.producto-card-pos-pedido:active {
    transform: scale(0.95);
}

/* ============================= */
/* ESCRITORIO (>= 769px)         */
/* ============================= */
@media (min-width: 769px) {
    .pedido-layout {
        display: grid;
        grid-template-columns: 2fr 1fr; 
        gap: 1rem;
    }

    .pedido-drawer {
        display: flex;
        flex-direction: column;
        height: 80vh;
    }

    .drawer-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--rz-base);
    }

    .detalle-body {
        flex: 1;
        overflow-y: auto;
    }

    .detalle-footer {
        position: sticky;
        bottom: 0;
        background: var(--rz-base-default);
    }

    .drawer-header, .fab-carrito, .drawer-overlay {
        display: none !important;
    }

    .drawer-overlay {
        position: fixed;
        inset: 0;
        background: var(--rz-base);
        backdrop-filter: blur(4px);
        z-index: 900;
        animation: fadeOverlay .2s ease;
    }

    @keyframes fadeOverlay {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }
}

/* ============================= */
/* FIX GLOBAL PARA SCROLL MOBILE */
/* ============================= */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
    height: 100%;
    touch-action: none;
}

/* ============================= */
/* FAB FIX (MUY IMPORTANTE) */
/* ============================= */
.fab-carrito {
    will-change: transform;
    transform: translateZ(0);
}

/* ============================= */
/* DRAWER FIX */
/* ============================= */
.pedido-drawer {
    will-change: transform;
}

/* ============================= */
/* MÓVIL Y TABLET (<= 768px) */
/* ============================= */
@media (max-width: 768px) {

    .pedido-layout {
        display: block;
    }

    /* DRAWER CORREGIDO */
    .pedido-drawer {
        position: fixed !important;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 80vh;
        background: var(--rz-base);
        z-index: 1000 !important;
        box-shadow: 0 -10px 25px rgba(0,0,0,0.2);
        display: flex !important;
        flex-direction: column;
        transform: translateY(100%);
        visibility: hidden;
        transition: transform 0.35s ease, visibility 0.35s;
        will-change: transform;
    }

        .pedido-drawer.open {
            transform: translateY(0);
            visibility: visible;
        }

    /* HEADER FIX */
    .drawer-header {
        padding: .8rem 1rem;
        font-weight: 600;
        background: var(--rz-secondary-lighter);
        border-bottom: 1px solid var(--rz-base-300);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* FAB CORREGIDO */

    .rz-body {
        position: relative;
    }

    .fab-carrito {
        position: fixed;
        bottom: 24px;
        right: 20px;
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--rz-primary), #2563eb);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
        box-shadow: 0 10px 30px rgba(0,0,0,.3);
        z-index: 1000;

        transform: translateY(0);
        transition: transform .2s ease-out, opacity .2s ease;
    }

        .fab-carrito.hide {
            transform: translateY(100px) scale(0.8);
            opacity: 0;
            pointer-events: none;
        }


    .rz-body.modal-open {
        filter: blur(4px);
        opacity: 0.9;
    }
    /* BADGE */
    .fab-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        background: var(--rz-danger-dark);
        color: white;
        font-size: 11px;
        padding: 3px 7px;
        border-radius: 999px;
        font-weight: bold;
    }

    /* OVERLAY */
    .drawer-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        backdrop-filter: blur(3px);
        z-index: 900;
    }
}

/* ============================= */
/* OCULTAR FAB CUANDO ABRE DRAWER */
/* ============================= */
.pedido-drawer.open ~ .fab-carrito {
    opacity: 0;
    pointer-events: none;
}

/* ============================= */
/* SCROLL INTERNO LIMPIO */
/* ============================= */
#carrito-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.detalle-body {
    flex: 1;
    overflow-y: auto;
    padding: .5rem;
    padding-bottom: 100px;
}

#carrito-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.detalle-body {
    flex: 1;
    overflow-y: auto;
    padding: .5rem;
    padding-bottom: 100px;
}

.drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--rz-danger);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all .2s ease;
}

    .drawer-close:hover {
        background: var(--rz-danger-lighter);
        color: var(--rz-danger-dark);
    }

    .drawer-close:active {
        transform: scale(0.9);
    }


/*    Añadir peido CSS*/

/* ========================= */
/* VIEW GENERAL */
/* ========================= */
.pedido-view {
    background: var(--rz-base-default);
    border-radius: 18px;
    padding: 1.2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* ========================= */
/* HEADER */
/* ========================= */
.pedido-view-header {
    margin-bottom: 1rem;
}

    .pedido-view-header h2 {
        text-align: center;
        margin-bottom: 1rem;
        font-weight: 700;
    }

/* META GRID */
.pedido-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    justify-content: center;
}

/* CARD META */
.meta-card {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .8rem;
    border-radius: 12px;
    background: var(--rz-base);
    font-size: .85rem;
    border: 1px solid rgba(0,0,0,.06);
}

    /* ESTADO */
    .meta-card.estado {
        font-weight: bold;
        background: rgba(var(--rz-primary-rgb), .1);
        color: var(--rz-primary);
    }

/* ========================= */
/* BODY */
/* ========================= */
.pedido-view-body {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

/* ========================= */
/* LISTA */
/* ========================= */
.pedido-view-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

/* ITEM */
.pedido-view-item {
    display: grid;
    grid-template-columns: 2fr .5fr .7fr .8fr;
    align-items: center;
    padding: .6rem .8rem;
    border-radius: 12px;
    background: var(--rz-base);
    border: 1px solid rgba(0,0,0,.05);
    transition: .2s;
}

    .pedido-view-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,.08);
    }

/* INFO */
.item-info {
    display: flex;
    flex-direction: column;
}

.nombre {
    font-weight: 600;
}

.desc {
    font-size: .75rem;
    color: var(--rz-text-secondary-color);
}

/* CANTIDAD */
.item-cantidad {
    text-align: center;
    font-weight: 600;
}

/* PRECIO */
.item-precio {
    text-align: right;
    font-size: .85rem;
}

/* TOTAL */
.item-total {
    text-align: right;
    font-weight: bold;
    color: var(--rz-success);
}

/* ========================= */
/* TOTAL FINAL */
/* ========================= */
.pedido-view-total {
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
    padding-top: .5rem;
    border-top: 1px solid rgba(0,0,0,.08);
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */
@media (max-width: 600px) {

    .pedido-view-item {
        grid-template-columns: 1fr auto;
        row-gap: .3rem;
    }

    .item-info {
        grid-column: 1 / span 2;
    }

    .item-precio {
        text-align: left;
    }

    .item-total {
        text-align: right;
    }
}
.pedido-view-item {
    display: grid;
    grid-template-columns: 1.5fr .5fr .7fr .8fr;
    align-items: center;
    padding: .7rem .9rem;
    border-radius: 12px;
    background: var(--rz-base-default);
    border: 1px solid rgba(var(--rz-base-contrast-rgb), .06);
    gap: .5rem;
}
html.dark .pedido-view-item,
.rz-dark .pedido-view-item {
    background: rgba(var(--rz-base-contrast-rgb), .08);
    border: 1px solid rgba(var(--rz-base-contrast-rgb), .12);
}
.pedido-view-item:hover {
    transform: translateY(-2px);
    /* sombra adaptable */
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

/* DARK HOVER */
html.dark .pedido-view-item:hover,
.rz-dark .pedido-view-item:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,.4);
}

/* 🔥 FIX MOBILE REAL */
@media (max-width: 600px) {

    .pedido-view-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .3rem;
    }

    .item-info {
        width: 100%;
    }

    .item-cantidad,
    .item-precio,
    .item-total {
        font-size: .85rem;
    }

    .item-total {
        font-weight: bold;
        color: var(--rz-success);
        align-self: flex-end;
    }
}
.nombre {
    font-weight: 600;
    font-size: .95rem;
}

.desc {
    font-size: .75rem;
    opacity: .7;
}
/*    Añadir peido CSS*/

