/* ============================================================
   ESTILOS PROFESIONALES PARA MÓDULO DE BODEGA
   Diseño premium alineado con la página de Ajustes
   Optimizado para móvil (títulos legibles, botones compactos)
   ============================================================ */

/* Animación de entrada suave */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.group-container {
    animation: fadeInUp 0.4s ease-out;
}

/* ==================== TARJETA DE GRUPO - DISEÑO FLOTANTE ==================== */

.bodega-group-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.35);
    border-radius: 0;
    padding: 0.5rem 0.25rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: none;
    box-shadow: none;
}

@media (min-width: 640px) {
    .bodega-group-card {
        padding: 0.75rem 0.5rem;
        margin-bottom: 0.75rem;
    }
}

.dark .bodega-group-card {
    background: transparent;
    border-bottom: 1px solid rgba(51, 65, 85, 0.25);
}

.bodega-group-card:hover {
    background: rgba(234, 88, 12, 0.02);
    border-bottom-color: rgba(234, 88, 12, 0.15);
    transform: none;
    box-shadow: none;
}

.dark .bodega-group-card:hover {
    background: rgba(234, 88, 12, 0.04);
    border-bottom-color: rgba(234, 88, 12, 0.2);
}

/* Indicador lateral de grupo - sutil */
.bodega-group-indicator {
    width: 0.25rem;
    height: 1.75rem;
    background: linear-gradient(180deg, #ea580c 0%, #dc2626 100%);
    border-radius: 999px;
    box-shadow: 0 0 6px rgba(234, 88, 12, 0.2);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

@media (min-width: 640px) {
    .bodega-group-indicator {
        width: 0.3rem;
        height: 2rem;
        box-shadow: 0 0 8px rgba(234, 88, 12, 0.25);
    }
}

.bodega-group-card:hover .bodega-group-indicator {
    box-shadow: 0 0 12px rgba(234, 88, 12, 0.35);
}

/* ==================== ESTADÍSTICAS DEL GRUPO (BULTOS Y TONELADAS) ==================== */

.bodega-group-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .bodega-group-stats {
        gap: 1.25rem;
    }
}

.bodega-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 38px;
}

@media (min-width: 640px) {
    .bodega-stat-item {
        min-width: 70px;
    }
}

.bodega-stat-value {
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}

@media (min-width: 640px) {
    .bodega-stat-value {
        font-size: 1.5rem;
    }
}

.bultos-stat .bodega-stat-value {
    color: #ea580c;
}

.dark .bultos-stat .bodega-stat-value {
    color: #f97316;
}

.toneladas-stat .bodega-stat-value {
    color: #059669;
}

.dark .toneladas-stat .bodega-stat-value {
    color: #34d399;
}

.bodega-stat-label {
    font-size: 0.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-top: 0.1rem;
}

@media (min-width: 640px) {
    .bodega-stat-label {
        font-size: 0.6rem;
        letter-spacing: 0.12em;
        margin-top: 0.15rem;
    }
}

.dark .bodega-stat-label {
    color: #64748b;
}

.bodega-stat-divider {
    width: 1px;
    height: 1.5rem;
    background: linear-gradient(180deg, transparent 0%, #e2e8f0 50%, transparent 100%);
    border-radius: 1px;
}

@media (min-width: 640px) {
    .bodega-stat-divider {
        height: 2.25rem;
    }
}

.dark .bodega-stat-divider {
    background: linear-gradient(180deg, transparent 0%, #475569 50%, transparent 100%);
}

/* ==================== BOTÓN DE COLAPSO ==================== */

.bodega-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.55rem;
    background: rgba(241, 245, 249, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.5);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .bodega-collapse-btn {
        width: 2rem;
        height: 2rem;
        border-radius: 0.65rem;
    }
}

.dark .bodega-collapse-btn {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    color: #64748b;
}

.bodega-collapse-btn:hover {
    background: rgba(234, 88, 12, 0.1);
    border-color: rgba(234, 88, 12, 0.3);
    color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.bodega-collapse-btn.collapsed {
    transform: rotate(180deg);
}

/* ==================== TARJETAS DE PRODUCTO ==================== */

.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Badge de código del producto */
.product-badge {
    transition: all 0.2s ease;
}

/* ==================== SCROLLBAR ==================== */

#bodega-grid-container {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

#bodega-grid-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#bodega-grid-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

#bodega-grid-container::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 10px;
    transition: background 0.2s ease;
}

#bodega-grid-container::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* ==================== ESTADO VACÍO ==================== */

.empty-state {
    animation: pulse 2s infinite;
}

/* ==================== BOTONES DE ACCIÓN ==================== */

.action-button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-button:hover {
    transform: translateY(-1px);
}

.action-button:active {
    transform: translateY(0);
}

/* ==================== VISTA LISTADO - TARJETAS ESTILO CUADRÍCULA ==================== */

.bodega-list-row {
    animation: fadeInUp 0.25s ease-out;
    position: relative;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(226, 232, 240, 0.5) !important;
    border-radius: 1rem !important;
    padding: 0.625rem 0.75rem !important;
    backdrop-filter: blur(6px);
}

@media (min-width: 640px) {
    .bodega-list-row {
        border-radius: 1.25rem !important;
        padding: 0.75rem 1rem !important;
    }
}

.dark .bodega-list-row {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(51, 65, 85, 0.3) !important;
}

.bodega-list-row:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(234, 88, 12, 0.25) !important;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.08);
}

.dark .bodega-list-row:hover {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(234, 88, 12, 0.35) !important;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.3);
}

.bodega-list-view {
    width: 100%;
    padding: 0 !important;
}

/* Tabular numbers - alineación de dígitos para valores numéricos */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Nombre del producto en listado - destacar */
.bodega-list-row .leading-tight {
    line-height: 1.15;
}

/* ============================================================
   ESTILOS PARA MÓDULO DE INVENTARIO (Producción)
   Diseño premium consistente con el resto de la aplicación
   ============================================================ */

/* ─── ENCABEZADO DEL GRUPO ─── */

.inventario-grupo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid rgba(226, 232, 240, 0.5);
    transition: all 0.3s ease;
	background: transparent;
}

@media (min-width: 640px) {
    .inventario-grupo-header {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
}

.dark .inventario-grupo-header {
    border-bottom-color: rgba(51, 65, 85, 0.4);
}

.inventario-grupo-indicator {
    width: 0.3rem;
    height: 2rem;
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.25);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* ─── TARJETA DE PRODUCTO ─── */

.inventario-producto-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 1.25rem;
    padding: 0.875rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
    .inventario-producto-card {
        border-radius: 1.5rem;
        padding: 1rem;
    }
}

.dark .inventario-producto-card {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(51, 65, 85, 0.4);
}

.inventario-producto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.12);
    border-color: rgba(249, 115, 22, 0.25);
}

.dark .inventario-producto-card:hover {
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.4);
    border-color: rgba(249, 115, 22, 0.3);
}

/* ─── BADGE DE PESO ─── */

.inventario-peso-badge {
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .inventario-peso-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.75rem;
        border-radius: 0.7rem;
    }
}

.dark .inventario-peso-badge {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: #94a3b8;
}

/* ─── CAJAS DE ESTADÍSTICAS (Inicial / Ventas / Sistema) ─── */

.inventario-stat-box {
    background: rgba(241, 245, 249, 0.6);
    border-radius: 0.65rem;
    transition: all 0.2s ease;
}

.dark .inventario-stat-box {
    background: rgba(30, 41, 59, 0.5);
}

.inventario-stat-label {
    font-size: 0.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    display: block;
    line-height: 1;
}

@media (min-width: 640px) {
    .inventario-stat-label {
        font-size: 0.55rem;
        letter-spacing: 0.12em;
    }
}

.dark .inventario-stat-label {
    color: #64748b;
}

/* ─── INPUT DE STOCK FINAL ─── */

.inventario-input {
    width: 100%;
    padding: 0.65rem;
    font-size: 1rem;
    font-weight: 900;
    text-align: center;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (min-width: 640px) {
    .inventario-input {
        padding: 0.75rem;
        font-size: 1.1rem;
        border-radius: 1rem;
    }
}

.inventario-input::placeholder {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.85rem;
}

.inventario-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12), inset 0 1px 3px rgba(0, 0, 0, 0.04);
    background: #fff;
}

.dark .inventario-input {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(51, 65, 85, 0.6);
    color: #f1f5f9;
}

.dark .inventario-input::placeholder {
    color: #475569;
}

.dark .inventario-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.2);
    background: rgba(15, 23, 42, 0.95);
}

/* ─── ESTADO VACÍO ─── */

.inventario-empty-state {
    animation: fadeInUp 0.4s ease-out;
}

.inventario-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 1.25rem;
}

@media (min-width: 640px) {
    .inventario-empty-icon {
        width: 4rem;
        height: 4rem;
        border-radius: 1.5rem;
    }
}

.dark .inventario-empty-icon {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

/* ─── INDICADOR DE PRODUCCIÓN (display numérico) ─── */

.inventario-producto-card [id^="produccion-display-"] {
    transition: all 0.2s ease;
}

/* ─── BOTÓN DE COLAPSAR GRUPO (rotate) ─── */

.inventario-grupo-header button.rotate-180 svg {
    transform: rotate(180deg);
}

/* ─── RESPONSIVE GRID PARA GRUPOS ─── */

[data-products-container] {
    transition: all 0.3s ease;
}

[data-products-container].hidden {
    display: none;
}

/* ============================================================
   LAYOUT BASE GLOBAL PARA TODAS LAS PÁGINAS
   Estructura estándar reutilizable del ERP
   Controla: margen superior, padding lateral, ancho máximo,
   separación entre secciones y espaciado encabezado-contenido.
   ============================================================ */
.page-container {
    max-width: 80rem;              /* max-w-7xl */
    margin-left: auto;
    margin-right: auto;
    padding: 0.75rem 0.75rem 1.5rem; /* top 12px mobile, sides 12px, bottom 24px */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;                   /* space-y-6 = 24px entre secciones */
}

@media (min-width: 768px) {
    .page-container {
        padding: 1.5rem 1.5rem 2rem; /* top 24px desktop (~20-30px bajo nav), sides 24px */
        gap: 2rem;                   /* space-y-8 = 32px entre secciones */
    }
}

/* ============================================================
   CALCULADORA CONTEXTUAL DE INVENTARIO
   Panel compacto flotante, coherente con el módulo de inventario.
   ============================================================ */
.inventario-calc-panel {
    position: fixed;
    z-index: 90;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 0.75rem;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.dark .inventario-calc-panel {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(51, 65, 85, 0.6);
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.6);
}

.inventario-calc-panel.hidden {
    display: none;
}

/* Título con nombre del producto + botón cerrar */
.inventario-calc-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.dark .inventario-calc-title {
    color: #e2e8f0;
    border-bottom-color: rgba(51, 65, 85, 0.5);
}

.inventario-calc-close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inventario-calc-close svg {
    width: 0.9rem;
    height: 0.9rem;
}

.inventario-calc-close:hover {
    background: rgba(226, 232, 240, 0.6);
    color: #475569;
}

.dark .inventario-calc-close:hover {
    background: rgba(51, 65, 85, 0.6);
    color: #e2e8f0;
}

/* Navegación Anterior / Siguiente */
.inventario-calc-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin: 0.5rem 0;
}

.inventario-calc-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: #f8fafc;
    color: #475569;
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inventario-calc-nav-btn svg {
    width: 0.8rem;
    height: 0.8rem;
}

.inventario-calc-nav-btn:hover:not(:disabled) {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.4);
    color: #ea580c;
}

.dark .inventario-calc-nav-btn {
    background: #1e293b;
    border-color: rgba(51, 65, 85, 0.7);
    color: #cbd5e1;
}

.dark .inventario-calc-nav-btn:hover:not(:disabled) {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.4);
    color: #f97316;
}

.inventario-calc-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Display de la calculadora */
.inventario-calc-display {
    padding: 0.65rem 0.75rem;
    border-radius: 0.8rem;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 1.4rem;
    font-weight: 900;
    text-align: right;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.5rem;
    min-height: 3rem;
}

.dark .inventario-calc-display {
    background: #0f172a;
    color: #f1f5f9;
}

/* Teclado numérico */
.inventario-calc-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.inventario-calc-keys button {
    padding: 0.65rem 0;
    border-radius: 0.7rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: #ffffff;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.inventario-calc-keys button:active {
    transform: scale(0.93);
}

.dark .inventario-calc-keys button {
    background: #1e293b;
    border-color: rgba(51, 65, 85, 0.7);
    color: #f1f5f9;
}

.inventario-calc-keys .inventario-calc-op {
    background: #fff7ed;
    color: #ea580c;
    border-color: rgba(249, 115, 22, 0.3);
}

.dark .inventario-calc-keys .inventario-calc-op {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.3);
}

.inventario-calc-keys .inventario-calc-clear {
    background: #fef2f2;
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.dark .inventario-calc-keys .inventario-calc-clear {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.inventario-calc-keys .inventario-calc-eq {
    background: #0ea5e9;
    color: #ffffff;
    border-color: #0ea5e9;
}

.dark .inventario-calc-keys .inventario-calc-eq {
    background: #0284c7;
    border-color: #0284c7;
}

/* Botón principal "Agregar valor" */
.inventario-calc-add {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.85rem;
    border: none;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.inventario-calc-add:active {
    transform: scale(0.97);
}

.inventario-calc-add:hover {
    box-shadow: 0 10px 26px rgba(249, 115, 22, 0.4);
}

/* ============================================================
   RESPONSIVE MÓVIL — REALIZAR INVENTARIO
   Bottom sheet, botones grandes, navegación fija, overlay
   Solo se activa en viewports ≤ 767px. Escritorio intacto.
   ============================================================ */

@media (max-width: 767px) {

    /* ─── Contenedor principal: prevenir scroll horizontal ─── */
    #inventario-container {
        overflow-x: hidden;
        max-width: 100vw;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* ─── Tarjetas de producto optimizadas ─── */
    .inventario-producto-card {
        padding: 0.75rem;
        border-radius: 1rem;
        max-width: 100%;
        overflow: hidden;
    }

    .inventario-producto-card h3 {
        font-size: 0.8rem;
        max-width: 100px;
    }

    /* Stats más legibles */
    .inventario-stat-box .text-base {
        font-size: 0.9rem;
    }

    .inventario-stat-label {
        font-size: 0.5rem;
    }

    /* ─── Input de cantidad más grande ─── */
    .inventario-input {
        padding: 0.85rem;
        font-size: 1.15rem;
        border-radius: 1rem;
        min-height: 3rem;
        -webkit-appearance: none;
        appearance: none;
    }

    /* ─── Encabezado de grupo más compacto ─── */
    .inventario-grupo-header {
        padding: 0.5rem 0.25rem;
        margin-bottom: 0.5rem;
    }

    .inventario-grupo-header h4 {
        font-size: 0.75rem;
    }

    /* ─── OVERLAY semitransparente ─── */
    .inventario-calc-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .inventario-calc-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* ─── CALCULADORA: Bottom Sheet ─── */
    .inventario-calc-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100% !important;
        max-height: 58vh;
        border-radius: 1.5rem 1.5rem 0 0;
        padding: 1rem 1rem 1.25rem;
        z-index: 100;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
        overflow-y: auto;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    }

    .inventario-calc-panel:not(.hidden) {
        transform: translateY(0);
    }

    /* Título más grande */
    .inventario-calc-title {
        font-size: 0.8rem;
        padding: 0.25rem 0.25rem 0.6rem;
    }

    .inventario-calc-close {
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 0.65rem;
    }

    .inventario-calc-close svg {
        width: 1.1rem;
        height: 1.1rem;
    }

    /* Navegación Anterior/Siguiente más grande */
    .inventario-calc-nav {
        gap: 0.5rem;
        margin: 0.6rem 0;
    }

    .inventario-calc-nav-btn {
        padding: 0.7rem;
        font-size: 0.7rem;
        border-radius: 0.85rem;
        min-height: 2.75rem;
    }

    .inventario-calc-nav-btn svg {
        width: 0.9rem;
        height: 0.9rem;
    }

    /* Display más grande */
    .inventario-calc-display {
        font-size: 1.75rem;
        padding: 0.85rem 1rem;
        min-height: 3.5rem;
        border-radius: 0.9rem;
        margin-bottom: 0.6rem;
    }

    /* Teclado numérico: botones grandes para dedos */
    .inventario-calc-keys {
        gap: 0.5rem;
    }

    .inventario-calc-keys button {
        padding: 0.9rem 0;
        font-size: 1.25rem;
        border-radius: 0.85rem;
        min-height: 3.2rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Botón Agregar valor más grande */
    .inventario-calc-add {
        margin-top: 0.65rem;
        padding: 0.95rem;
        font-size: 0.85rem;
        border-radius: 1rem;
        min-height: 3.2rem;
        touch-action: manipulation;
    }

    /* ─── BARRA DE NAVEGACIÓN FIJA INFERIOR ─── */
    .inventario-mobile-nav {
        display: flex;
        align-items: center;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid rgba(226, 232, 240, 0.8);
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        z-index: 50;
        margin: 0 -0.5rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .dark .inventario-mobile-nav {
        background: rgba(15, 23, 42, 0.96);
        border-top-color: rgba(51, 65, 85, 0.6);
    }

    .inventario-mobile-nav-btn {
        flex: 1;
        padding: 0.75rem 0.5rem;
        border-radius: 0.85rem;
        font-weight: 900;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        border: 2px solid rgba(226, 232, 240, 0.8);
        background: #f8fafc;
        color: #475569;
        cursor: pointer;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        touch-action: manipulation;
        min-height: 2.75rem;
    }

    .dark .inventario-mobile-nav-btn {
        background: #1e293b;
        border-color: rgba(51, 65, 85, 0.7);
        color: #cbd5e1;
    }

    .inventario-mobile-nav-btn:active {
        transform: scale(0.96);
        background: rgba(249, 115, 22, 0.12);
        border-color: rgba(249, 115, 22, 0.45);
        color: #ea580c;
    }

    .dark .inventario-mobile-nav-btn:active {
        background: rgba(249, 115, 22, 0.18);
        color: #f97316;
    }

    .inventario-mobile-nav-btn:disabled {
        opacity: 0.35;
        pointer-events: none;
    }

    .inventario-mobile-nav-indicator {
        text-align: center;
        font-size: 0.65rem;
        font-weight: 800;
        color: #94a3b8;
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 3rem;
    }

    .dark .inventario-mobile-nav-indicator {
        color: #64748b;
    }

    /* ─── Botón Cerrar en bottom sheet ─── */
    .inventario-calc-close-btn {
        width: 100%;
        margin-top: 0.5rem;
        padding: 0.75rem;
        border-radius: 0.85rem;
        border: 2px solid rgba(226, 232, 240, 0.8);
        background: #f1f5f9;
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        cursor: pointer;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        min-height: 2.75rem;
    }

    .dark .inventario-calc-close-btn {
        background: #1e293b;
        border-color: rgba(51, 65, 85, 0.7);
        color: #94a3b8;
    }

    .inventario-calc-close-btn:active {
        transform: scale(0.97);
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
        color: #dc2626;
    }

    /* ─── Info de cantidad actual en el panel ─── */
    .inventario-calc-current-value {
        text-align: center;
        padding: 0.35rem 0.5rem;
        margin-bottom: 0.4rem;
        font-size: 0.6rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #94a3b8;
    }

    .inventario-calc-current-value span {
        display: block;
        font-size: 1.1rem;
        font-weight: 900;
        color: #334155;
        margin-top: 0.1rem;
    }

    .dark .inventario-calc-current-value span {
        color: #e2e8f0;
    }

    /* ─── Ajustar grid de productos en móvil ─── */
    #bodega-grid-container-inventario {
        gap: 0.5rem;
    }

    #bodega-grid-container-inventario [data-products-container] {
        gap: 0.5rem;
    }

    /* ─── Ajustar botones de acción en móvil ─── */
    #inventario-btn-guardar,
    #inventario-btn-cancelar {
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
        font-size: 0.7rem;
        border-radius: 1.25rem;
    }
}

/* ─── Fuera del media query: ocultar nav móvil en escritorio ─── */
.inventario-mobile-nav {
    display: none;
}

@media (max-width: 767px) {
    .inventario-mobile-nav {
        display: flex;
    }
}
