.estado {
    pointer-events: none;
}

body {
    background-repeat: space;
}

table#data_table tbody tr td {
    vertical-align: middle !important;
}

.tnr {
    display: inline !important;
}

#resumen {
    font-family: 'Calibri' !important;
    font-size: 15px !important;
    color: black !important;
    width: 600;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    border: none;
}

#resumen td {
    padding: 0;
}

.dt-button-collection.dtb-collection-closeable {
    width: 60% !important;
}

.dtsp-panes .dtsp-panesContainer {
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    padding: 0px !important;
}

.dtsp-searchPane {
    margin-top: 0px !important;
}

/* ============================================ */
/* NUEVO: Grid visual de productos (POS)       */
/* ============================================ */

/* ============================================ */
/* Mapa visual de mesas                        */
/* ============================================ */

@media (max-width: 767.98px) {
    #formModal .modal-dialog {
        max-width: 100%;
        margin: 10px;
    }
    
    .room-section {
        max-width: 100%;
    }

    .room-canvas.order-mode,
    .room-canvas.edit-mode {
        max-width: 100%;
    }
}

.room-section {
    margin: 0 auto 20px;
    max-width: 644px;
}

.room-title {
    font-size: 16px;
    font-weight: 700;
    color: #495057;
    padding: 8px 12px;
    background: #e9ecef;
    border-radius: 6px 6px 0 0;
    border-left: 4px solid #007bff;
}

#tableMapContainer .room-title {
    cursor: pointer;
    user-select: none;
}

#tableMapContainer .room-title:hover {
    background: #dee2e6;
}

#tableMapContainer .room-chevron {
    width: 16px;
    text-align: center;
    margin-right: 6px;
}

.room-canvas {
    position: relative;
    min-height: 120px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.table-marker {
    width: 74px;
    height: 59px;
    background: #fff;
    border: 2px solid #28a745;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: relative;
    flex-shrink: 0;
}

.table-marker:hover {
    border-color: #007bff;
    box-shadow: 0 3px 10px rgba(0,123,255,0.2);
    transform: translateY(-2px);
}

.table-marker.selected {
    border-color: #007bff;
    background: #007bff;
    color: #fff;
    box-shadow: 0 3px 12px rgba(0,123,255,0.3);
}

.table-marker-label {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
}

/* === Mapa en modo edición (settings) === */
.room-canvas.edit-mode,
.room-canvas.order-mode {
    position: relative;
    display: block;
    padding: 16px;
    box-sizing: border-box;
    min-height: 520px;
}

.room-canvas.edit-mode .table-marker,
.room-canvas.order-mode .table-marker {
    position: absolute !important;
    margin: 0;
}

.room-canvas.order-mode,
.room-canvas.edit-mode {
    overflow: hidden;
    max-width: 644px;
}

.room-canvas.edit-mode .table-marker {
    cursor: grab;
}

.room-canvas.edit-mode .table-marker:active {
    cursor: grabbing;
}

/* === Mesas ocupadas === */
.table-marker.occupied {
    background: #f8d7da;
    border-color: #dc3545;
    opacity: 0.7;
}

.table-marker.occupied:hover {
    border-color: #dc3545;
    box-shadow: none;
    transform: none;
    cursor: pointer;
}

/* === Elementos decorativos del mapa === */
.map-element {
    position: absolute;
    border: 1px solid #ced4da;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 1;
    transform-origin: center center;
}

.map-element-label {
    font-weight: 600;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
    padding: 2px;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

/* En modo edición son seleccionables/movibles */
.room-canvas.edit-mode .map-element {
    pointer-events: auto;
    cursor: grab;
    user-select: none;
    transition: width 0.3s ease, height 0.3s ease;
}

.room-canvas.edit-mode .map-element:active {
    cursor: grabbing;
}

.room-canvas.edit-mode .map-element.selected {
    outline: 2px dashed #007bff;
    outline-offset: 2px;
}

/* Las mesas van encima de los elementos decorativos */
.room-canvas.edit-mode .table-marker,
.room-canvas.order-mode .table-marker {
    z-index: 2;
}

/* Toolbar para agregar elementos */
.element-toolbar,
.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.element-toolbar .btn {
    font-size: 14px;
    padding: .25rem .75rem;
}

/* Gap utility (Bootstrap 4 no tiene gap-*) */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ============================================ */
/* Modal responsivo de productos (POS)          */
/* ============================================ */

#formModal .modal-xl {
    max-width: 1100px;
}

#formModal .modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* --- Categorías: horizontal en móvil, vertical en desktop --- */

.category-tabs-wrapper {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 8px;
}

#categoryTabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 2px;
    padding-bottom: 2px;
}

#categoryTabs .nav-link {
    border-radius: 0;
    color: #495057;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.15s ease;
}

#categoryTabs .nav-link:hover {
    background-color: #e9ecef;
}

#categoryTabs .nav-link.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* En desktop las categorías van en columna a la izquierda */
@media (min-width: 768px) {
    #stepProductGrid {
        display: flex;
        gap: 0;
        max-height: 460px;
    }

    .category-tabs-wrapper {
        flex: 0 0 220px;
        border-bottom: none;
        border-right: 1px solid #dee2e6;
        margin-bottom: 0;
        padding-right: 4px;
        overflow-y: auto;
    }

    #categoryTabs {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: visible;
    }

    #categoryTabs .nav-link {
        border-left: 3px solid transparent;
        border-bottom: none;
        width: 100%;
    }

    #categoryTabs .nav-link:hover {
        border-left-color: #adb5bd;
    }

    #categoryTabs .nav-link.active {
        border-left-color: #0056b3;
    }

    .tab-content {
        flex: 1;
        overflow: hidden;
    }
}

/* Buscador de productos en el header del modal */
#formModal .modal-header {
    padding-bottom: 6px;
}

#productSearch {
    border-radius: 20px;
    padding-left: 14px;
    font-size: 13px;
    height: 32px;
}

#formModal .modal-header .close {
    position: absolute;
    top: 8px;
    right: 12px;
}

/* Grid de productos */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 8px;
    max-height: 420px;
    overflow-y: auto;
}

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

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        max-height: 460px;
    }
}

/* Tarjeta de producto */
.product-card {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.product-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
    transform: translateY(-2px);
}

.product-card:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.product-card-img {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 8px;
}

.product-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card-body {
    padding: 8px 10px 10px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #28a745;
}

/* Selector táctil de cantidad */
.quantity-stepper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    touch-action: manipulation;
}

.qty-value {
    font-size: 28px;
    font-weight: 700;
    min-width: 48px;
    text-align: center;
    color: #212529;
    user-select: none;
}

.qty-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.qty-preset {
    min-width: 48px;
    height: 44px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    touch-action: manipulation;
}

.qty-preset.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Paso de modificadores */
#stepModifiers {
    padding: 0 4px;
}

#modifierContent .form-group {
    margin-bottom: 14px !important;
}

#modifierContent select.form-control-sm {
    padding: 6px 10px !important;
    font-size: 14px;
    min-height: 38px;
}

#modifierContent label.form-label-sm {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #495057;
}

#modifierContent .select2bs4,
#modifierContent select {
    width: 100% !important;
}

#modifierContent .select2-container .select2-selection--single {
    height: 38px !important;
}

/* Preview del producto en modificadores */
#modifierContent .col-2 {
    text-align: center;
    margin-bottom: 8px;
}

#modifierContent .col-10 p {
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.4;
}

#modCantidad, #modObservaciones {
    font-size: 14px;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qty-stepper .qty-minus {
    background: linear-gradient(135deg, #dc3545, #a71d2a);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 19px;
    padding: 2px 8px;
    cursor: pointer;
}

.qty-stepper .qty-minus:hover {
    background: linear-gradient(135deg, #c82333, #8b1a24);
}

.qty-stepper .qty-plus {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 19px;
    padding: 2px 8px;
    cursor: pointer;
}

.qty-stepper .qty-plus:hover {
    background: linear-gradient(135deg, #218838, #15652a);
}

.qty-stepper .qty-value {
    font-size: 18px;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    color: #212529;
    user-select: none;
}

/* ============================================
   CUSTOM BG GRADIENT CLASSES (AdminLTE style)
   ============================================ */
.bg-gradient-primary { background-image: linear-gradient(135deg, #1abb9c, #14967d) !important; }
.bg-gradient-info { background-image: linear-gradient(135deg, #17a2b8, #117a8b) !important; }
.bg-gradient-success { background-image: linear-gradient(135deg, #2fb344, #239137) !important; }
.bg-gradient-warning { background-image: linear-gradient(135deg, #f59f00, #cc8400) !important; }
.bg-gradient-danger { background-image: linear-gradient(135deg, #d63939, #b02e2e) !important; }
.bg-gradient-secondary { background-image: linear-gradient(135deg, #6c757d, #565e64) !important; }
.bg-gradient-dark { background-image: linear-gradient(135deg, #343a40, #23272b) !important; }

/* ============================================
   ORDER INFO CARD
   ============================================ */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.order-info-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: stretch;
    background: #fff;
}

.order-info-icon {
    width: 55px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}

.order-info-body {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.order-info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    line-height: 1.2;
}

.order-info-value {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.3;
    word-break: break-word;
}

.order-info-sub {
    font-size: 12px;
    color: #343a40;
    line-height: 1.2;
    margin-top: 2px;
}

/* Agrandar Pedido # y Total */
.order-info-card:first-child .order-info-value,
.order-info-card:last-child .order-info-value {
    font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 1800px) {
    .order-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .order-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .order-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .order-info-grid {
        grid-template-columns: 1fr;
    }

    .order-info-icon {
        width: 48px;
        min-height: 55px;
        font-size: 18px;
    }

    .order-info-body {
        padding: 6px 10px;
    }
}