/* ============================================
   POS Y ETIQUETAS - CHICHILOS
   ============================================ */

/* --- POS --- */
.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.pos-scan {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff8f8;
    border: 2px solid rgba(227, 6, 19, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.pos-scan input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    font-size: 20px;
    font-family: ui-monospace, Consolas, monospace;
    letter-spacing: 0.08em;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
}

.pos-scan input[type="number"] {
    flex: 0 0 80px;
    font-size: 16px;
}

.pos-scan input:focus {
    outline: none;
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.pos-buscar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin: -6px 0 12px;
}

.pos-buscar select {
    padding: 8px 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    max-width: 100%;
}

.pos-buscar small {
    color: #718096;
}

.pos-resultados {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 45vh;
    overflow-y: auto;
    margin-bottom: 16px;
}

.pos-resultados:empty {
    display: none;
}

.pos-resultado {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 10px 12px;
}

.pos-resultado-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.pos-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pos-chip {
    border: 1px solid #E30613;
    background: #fff8f8;
    color: #1a202c;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.2;
    text-align: left;
}

.pos-chip:hover:not(:disabled) {
    background: #E30613;
    color: white;
}

.pos-chip:disabled {
    border-color: #cbd5e0;
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

.pos-chip small {
    display: block;
    font-size: 11px;
    opacity: 0.8;
}

.pos-scan-icon {
    font-size: 18px;
    color: #E30613;
    letter-spacing: -2px;
}

.table.pos-table,
.table.etq-table {
    min-width: 0;
}

.pos-table input[type="number"],
.etq-table input[type="number"] {
    width: 64px;
    padding: 6px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
}

.pos-vacio {
    text-align: center;
    color: #718096;
    padding: 30px 12px !important;
}

.pos-cobro {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 80px;
}

.pos-total-label {
    color: #718096;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pos-total {
    font-size: 40px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
    margin-top: -8px;
}

.pos-items {
    color: #718096;
    font-size: 13px;
    margin-top: -8px;
}

.pos-cobrar {
    font-size: 18px;
    padding: 16px;
}

.pos-cobrar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pos-ultima {
    font-size: 13px;
    color: #2f855a;
}

.pos-flash {
    animation: posFlash 0.6s ease;
}

@keyframes posFlash {
    from { background: #c6f6d5; }
    to { background: transparent; }
}

/* --- ETIQUETAS --- */
.etq-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.etq-layout h3 {
    font-size: 16px;
    margin: 0 0 12px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.etq-badge {
    background: #E30613;
    color: white;
    font-size: 12px;
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 500;
}

.etq-productos {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.etq-producto {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px;
}

.etq-producto-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.etq-tallas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
}

.etq-talla {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: #f7fafc;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
}

.etq-talla input {
    width: 52px;
    padding: 4px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
}

.etq-config {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.etq-config label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4a5568;
}

.etq-config input {
    width: 70px;
    padding: 6px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
}

.etq-preview-wrap {
    background: #edf2f7;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

/* En pantalla 50mm se ve chico: ampliar sólo la vista previa */
.etq-preview-wrap .etiqueta {
    zoom: 1.6;
}

.etq-ayuda {
    font-size: 12px;
    color: #718096;
    margin-top: 10px;
}

/* La etiqueta en sí (preview y ventana de impresión comparten estos estilos) */
.etiqueta {
    background: white;
    color: black;
    box-sizing: border-box;
    padding: 1.5mm 2mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.etiqueta-nombre {
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.etiqueta svg {
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 1024px) {
    .pos-layout,
    .etq-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .pos-cobro {
        position: static;
    }
}
