/* =========================================
   1. ANIMACIONES Y EFECTOS VISUALES
   ========================================= */

/* Efecto Hover en tarjetas de productos */
.product-card {
    transition: all 0.2s ease-out;
}

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

/* Badge de Ranking (Degradado) */
.rank-badge {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* Animación 'Wiggle' para varita mágica */
@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.magic-btn:hover svg {
    animation: wiggle 0.5s ease-in-out infinite;
}

/* =========================================
   2. SCROLLBAR PERSONALIZADO
   ========================================= */
.scroll-custom::-webkit-scrollbar {
    width: 6px;
}

.scroll-custom::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* =========================================
   3. COMPONENTES DE UI (Scanner, Status)
   ========================================= */

/* Contenedor del escáner QR */
#reader {
    border-radius: 1rem;
    overflow: hidden;
}

/* Indicadores de Conexión (Punto verde/rojo) */
.status-dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-online {
    background-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.status-offline {
    background-color: #ef4444;
}

/* Modal con z-index superior a todo */
.z-modal {
    z-index: 9999;
}

/* =========================================
   4. ESTILOS DE TICKET Y PAGOS
   ========================================= */

/* Quitar borde al último ítem del ticket */
.ticket-row:last-child {
    border-bottom: none;
}

/* Input de Precio (Quitar flechas numéricas) */
.price-input::-webkit-inner-spin-button,
.price-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Botones de Medio de Pago */
.pm-btn {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.pm-btn.active {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* =========================================
   5. TABLA ESTILO EXCEL (Inventario Lista)
   ========================================= */

.excel-row {
    display: grid;
    grid-template-columns: 40px 1fr 2fr 1fr 1fr 1fr 100px;
    gap: 8px;
    align-items: center;
}

.excel-header {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 10px;
    color: #64748b;
    background: #f1f5f9;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 4px;
}
/* ==========================================
   ESTILOS MÁGICOS PARA IMPRESIÓN (TICKET Y A4)
   ========================================== */
@media print {
    body * { visibility: hidden; }

    /* Mostrar solo la sección que esté activa (sin la clase hidden) */
    #printSection:not(.hidden), #printSection:not(.hidden) * { visibility: visible; }
    #printLabelsSection:not(.hidden), #printLabelsSection:not(.hidden) * { visibility: visible; }

    /* 1. Formato Ticket Térmico */
    #printSection:not(.hidden) {
        display: block !important;
        position: absolute; left: 0; top: 0; width: 80mm;
        padding: 0; margin: 0;
        font-family: 'Courier New', Courier, monospace; color: black;
    }

    /* 2. Formato Hoja A4 Etiquetas */
    #printLabelsSection:not(.hidden) {
        display: block !important;
        position: absolute; left: 0; top: 0;
        width: 210mm; /* Ancho estándar de hoja A4 */
        background: white;
    }

    .label-page {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 columnas de etiquetas */
        grid-auto-rows: 25mm; /* Alto de cada etiqueta */
        gap: 3mm;
        padding: 10mm; /* Margen de la hoja para que la impresora no corte los bordes */
    }

    .sticker-label {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        outline: 1px dashed #ccc; /* Línea de corte suave */
        page-break-inside: avoid; /* Evita que una etiqueta se imprima mitad en una hoja y mitad en otra */
        padding: 2mm;
    }

    .no-print-bg { background: transparent !important; box-shadow: none !important; border: none !important; }
}