/* ========== POS SPECIFIC VARIABLES ========== */
:root {
    --bg-active: #ffffcc;
    --cart-header-bg: #eceff1;
}

/* Header and Sidebar are managed by shared.css */

.total-display {
    display: flex;
    align-items: center;
    gap: 24px;
}

.cart-count-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 4px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.cart-count-badge i {
    font-size: 14px;
    opacity: 0.9;
}

#cart-count-val {
    font-size: 20px;
    color: #fbbf24; /* Vivid orange/yellow */
    line-height: 1;
}

.global-discount-container {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.discount-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.discount-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

.global-discount-input {
    width: 70px;
    height: 32px;
    background: white;
    border: none;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.total-main {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.total-label {
    font-size: 12px;
    opacity: 0.8;
}

.total-amount {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 1px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========== CONTAINER PRINCIPALE ========== */
.pos-container {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 8px;
    padding: 8px;
    height: calc(100vh - 60px);
    /* Allineato con l'altezza dell'header */
}

/* ========== SEZIONE SINISTRA ========== */
.pos-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Campo Ricerca */
.search-section {
    background: white;
    padding: 8px;
    /* Ridotto */
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    /* Ridotto */
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* Griglia Carrello */
.cart-section {
    flex: 1;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cart-table th {
    padding: 6px 4px;
    /* Ridotto */
    font-size: 10px;
    /* Ridotto */
}

.cart-table td {
    padding: 1px;
    /* Ridotto */
}

.cart-table input {
    padding: 4px;
    font-size: 12px;
}

/* Shortcuts F1-F7 */
.shortcuts-section {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: white;
    padding: 6px;
    border-radius: 6px;
}

.shortcut-btn {
    padding: 4px;
    font-size: 11px;
    background: #78909c;
}

/* Tastierino Numerico (Alta Densità - 6 colonne) */
.keypad-section {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 4px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 280px;
    /* Molto più basso */
}

.keypad-btn {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    font-size: 16px;
    /* Ridotto proporzionalmente */
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.keypad-btn.qty-key-btn {
    font-size: 20px;
}

.keypad-btn.ok-btn {
    grid-column: 3;
    grid-row: 4;
    /* Spostato per far spazio */
    font-size: 14px;
}

/* Pulsanti Azione (Griglia fitta 3 colonne) */
.actions-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 4px;
}

.action-btn {
    padding: 6px 2px;
    font-size: 9px;
    /* Molto piccolo per densità */
    font-weight: 700;
    height: 42px;
    border-radius: 4px;
}

.cart-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.cart-table tbody tr:nth-child(even) {
    background: var(--bg-alt);
}

.cart-table tbody tr.active-row {
    background: var(--bg-active) !important;
}

.discounted-row {
    background-color: #fff9c4 !important;
    /* Giallo limone chiaro */
}

.discounted-row .discount-input {
    background-color: #f57c00 !important;
    /* Arancio */
    color: white !important;
    font-weight: 800;
    border-radius: 4px;
}

.cart-table th,
.cart-table td {
    padding: 2px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
}

/* Input nel carrello */
.cart-input {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.cart-input:hover {
    border-color: #ddd;
    background: #fff;
}

.cart-input:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 35, 126, 0.1);
}

.qty-input,
.price-input,
.discount-input {
    text-align: right;
    font-weight: 600;
}

.cart-table input {
    width: 100%;
    border: 1px solid transparent;
    padding: 4px 2px !important;
    font-size: 12px !important;
    outline: none;
    border-radius: 4px;
}

.cart-table input:focus {
    border-color: var(--primary);
    background: #f1f8ff;
}

.vat-cell,
.stock-cell {
    font-size: 12px;
    text-align: center;
    color: #666;
    font-weight: 600;
}

.total-cell {
    font-weight: 800;
    color: var(--primary);
    text-align: right;
    padding-right: 10px !important;
    font-size: 16px !important;
}

.cart-table input.price-input-active {
    background: var(--bg-active);
    border: 2px solid var(--warning);
    font-weight: bold;
}

.cart-table .total-cell {
    font-weight: 800;
    color: var(--primary);
    font-size: 16px !important;
}

.cart-table .delete-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.cart-table .delete-btn:hover {
    opacity: 0.8;
}

/* ========== SEZIONE DESTRA: GRIGLIA UNIFICATA ========== */
.pos-right {
    background: #f8f9fa;
    padding: 4px;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.unified-sidebar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    /* 4 righe normali, 1 doppia per pagamenti, 3 normali */
    grid-template-rows: 65px 65px 65px 65px 130px 65px 65px 65px;
    gap: 3px;
}

/* Pulsanti Base (Griglia) */
.keypad-btn,
.action-btn,
.shortcut-btn {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 13px;
    /* Unificato come richiesto */
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2px;
    line-height: 1.1;
    transition: all 0.1s;
    user-select: none;
}

/* ... existing code ... */

.keypad-btn:active,
.action-btn:active {
    transform: translateY(1px);
    filter: brightness(0.9);
}

.compact-change-calc {
    display: flex;
    align-items: center;
    gap: 4px;
}

.change-display {
    background: #263238;
    color: #4caf50;
    font-weight: 800;
    border-radius: 8px;
    padding: 0 10px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.change-display.negative {
    color: #f44336;
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--text-primary);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 1000;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* Modale Ricerca Grafica */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#search-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 80% !important;
    /* Allargato come richiesto */
    height: 85% !important;
    max-width: 1200px !important;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 0 !important;
}

.category-btn {
    padding: 6px 12px !important;
    background: #ffffff;
    color: #444;
    border: 2px solid #ddd;
    border-radius: 25px;
    cursor: pointer;
    font-size: 12px !important;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.category-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

/* Colori Random per Categorie (Alternati via JS o Classi) */
.cat-tag-1 {
    border-color: #f44336;
    color: #d32f2f;
}

.cat-tag-2 {
    border-color: #2196f3;
    color: #1976d2;
}

.cat-tag-3 {
    border-color: #4caf50;
    color: #388e3c;
}

.cat-tag-4 {
    border-color: #ff9800;
    color: #f57c00;
}

.cat-tag-5 {
    border-color: #9c27b0;
    color: #7b1fa2;
}

.cat-tag-6 {
    border-color: #00bcd4;
    color: #0097a7;
}

.category-btn.active.cat-tag-1 {
    background: #f44336;
    color: white;
}

.category-btn.active.cat-tag-2 {
    background: #2196f3;
    color: white;
}

.category-btn.active.cat-tag-3 {
    background: #4caf50;
    color: white;
}

.category-btn.active.cat-tag-4 {
    background: #ff9800;
    color: white;
}

.category-btn.active.cat-tag-5 {
    background: #9c27b0;
    color: white;
}

.category-btn.active.cat-tag-6 {
    background: #00bcd4;
    color: white;
}

.modal-header {
    background: var(--primary-dark);
    color: white;
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 14px;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-search-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
    outline: none;
}

.modal-search-input:focus {
    border-color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.product-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
}

.product-card:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Colori Specifici per Prodotti (Keyword Mapping) */
.product-card.product-rosa {
    border-left: 8px solid #ff80ab;
}

.product-card.product-rosso {
    border-left: 8px solid #ef5350;
}

.product-card.product-blu {
    border-left: 8px solid #42a5f5;
}

.product-card.product-verde {
    border-left: 8px solid #66bb6a;
}

.product-card.product-giallo {
    border-left: 8px solid #ffee58;
}

/* ========== RICERCA GRAFICA LEGACY STYLE ========== */
.legacy-search-container {
    display: flex;
    flex-direction: row;
    height: 100%;
}

.legacy-search-container * {
    font-size: 12px !important;
}

.legacy-cat-btn {
    padding: 6px 4px !important;
    font-size: 11px !important;
    line-height: normal !important;
}

.product-tile-name {
    font-size: 10px !important;
    line-height: 0.9 !important;
}

.product-tile-price {
    font-size: 10px !important;
}

.modal-sidebar {
    width: 160px;
    background: #f5f5f5;
    border-right: 2px solid #ddd;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
}

.sidebar-info {
    font-size: 11px !important;
    font-weight: 800;
    text-align: center;
    padding: 2px !important;
    background: #eee;
    border: 1px solid #ccc;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-btn-large {
    height: 45px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
}

.categories-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 0;
}

.legacy-cat-btn {
    padding: 8px 6px;
    text-align: left;
    background: white;
    border: 1px solid #ddd;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
}

.legacy-cat-btn.active {
    background: var(--primary);
    color: white;
}

.legacy-close-btn {
    height: 40px;
    background: #ff0000;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
}

.modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #f8f9fa;
    overflow: hidden;
    justify-content: flex-start !important;
    /* Forza l'inizio in alto */
}

.modal-search-wrapper {
    margin-bottom: 10px;
}

.products-legacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-rows: 75px;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    align-content: start !important;
    /* Forza le righe verso l'alto */
}

.product-tile {
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
}

.product-tile:active {
    transform: scale(0.95);
}

.product-tile-name {
    font-weight: 800;
    font-size: 11px;
    text-align: center;
    margin-bottom: 3px;
    text-transform: uppercase;
    line-height: 1;
}

.product-tile-price {
    font-weight: 800;
    font-size: 11px;
}

/* Colori Sfondi (Tile Legacy) */
.tile-rosa {
    background: #fce4ec;
    color: #ad1457;
}

.tile-rosso {
    background: #ef5350;
    color: white;
}

.tile-blu {
    background: #42a5f5;
    color: white;
}

.tile-verde {
    background: #66bb6a;
    color: white;
}

.tile-giallo {
    background: #fff176;
    color: #f57f17;
}

/* Context Menu Legacy */
.legacy-context-menu {
    position: absolute;
    background: white;
    border: 2px solid #333;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    min-width: 180px;
    padding: 4px;
}

.legacy-context-menu .menu-item {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.legacy-context-menu .menu-item:last-child {
    border-bottom: none;
}

.legacy-context-menu .menu-item:hover {
    background: var(--primary);
    color: white;
}

.legacy-context-menu .menu-section-title {
    font-size: 11px;
    font-weight: 900;
    color: #666;
    padding: 8px 12px 4px 12px;
    letter-spacing: 1px;
}

.legacy-context-menu .menu-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.legacy-context-menu .color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px 12px;
}

.legacy-context-menu .color-swatch {
    width: 35px;
    height: 35px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.1s;
}

.legacy-context-menu .color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.legacy-context-menu .color-swatch-more {
    width: 35px;
    height: 35px;
    border-radius: 4px;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.legacy-context-menu .menu-item.cancel {
    background: #fff5f5;
    color: #c62828;
}

.tile-nero {
    background: #212121;
    color: white;
}

.tile-bianco {
    background: #ffffff;
    color: #333;
}

.tile-marrone {
    background: #8d6e63;
    color: white;
}

.tile-viola {
    background: #ab47bc;
    color: white;
}

.tile-arancio {
    background: #ffa726;
    color: white;
}

.tile-grigio {
    background: #9e9e9e;
    color: white;
}

.tile-lilla {
    background: #ce93d8;
    color: white;
}

.tile-celeste {
    background: #90caf9;
    color: #0d47a1;
}

.tile-fucsia {
    background: #f06292;
    color: white;
}

.tile-oro {
    background: #d4af37;
    color: white;
}

.tile-argento {
    background: #c0c0c0;
    color: #333;
}

/* ========== MODALE CLIENTI ========== */
.client-item:hover {
    background: #e3f2fd !important;
    transition: background 0.2s;
}

/* ========== PULSANTI SPECIALI ========== */
.courtesy-btn {
    background: #607d8b !important;
    color: white !important;
    font-size: 11px !important;
}

.invoice-btn {
    background: #3f51b5 !important;
    color: white !important;
    font-size: 11px !important;
}

.voucher-row td {
    background: #ffebee;
    border-top: 2px solid #f44336;
    font-size: 14px;
}

/* ========== SIDEBAR NAVIGATION ========== */
.pos-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: #1a237e;
    color: white;
    z-index: 5000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.pos-sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 24px;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 14px;
    letter-spacing: 2px;
    opacity: 0.7;
    margin: 0;
}

.sidebar-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-section-title {
    padding: 16px 20px 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 800;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 20px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    width: 100%;
}

.nav-link-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4900;
    display: none;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

/* ========== POS BUTTON COLORS (USER REQUEST) ========== */
#btn-pay-cash,
.pay-cash-btn {
    background-color: #10b981 !important;
    /* Green */
    color: white !important;
    border: 1px solid #059669 !important;
}

#btn-pay-card,
.pay-card-btn {
    background-color: #3b82f6 !important;
    /* Blue */
    color: white !important;
    border: 1px solid #2563eb !important;
}

#btn-delete-row,
#btn-return,
.delete-row-btn {
    background-color: #f59e0b !important;
    /* Orange */
    color: white !important;
    border: 1px solid #d97706 !important;
}

#btn-clear-cart,
.clear-cart-btn {
    background-color: #ef4444 !important;
    /* Red */
    color: white !important;
    border: 1px solid #dc2626 !important;
}

#btn-generic,
.generic-btn {
    background-color: #d97706 !important;
    /* Ocher/Dark Yellow */
    color: white !important;
    border: 1px solid #b45309 !important;
}

#btn-search-graphic,
.search-graphic-btn {
    background-color: #10b981 !important;
    /* Green */
    color: white !important;
    border: 1px solid #059669 !important;
}

/* Hover effects for the colored buttons */
#btn-pay-cash:hover,
.pay-cash-btn:hover,
#btn-pay-card:hover,
.pay-card-btn:hover,
#btn-delete-row:hover,
#btn-return:hover,
.delete-row-btn:hover,
#btn-clear-cart:hover,
.clear-cart-btn:hover,
#btn-generic:hover,
.generic-btn:hover,
#btn-search-graphic:hover,
.search-graphic-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#btn-pay-cash:active,
.pay-cash-btn:active,
#btn-pay-card:active,
.pay-card-btn:active,
#btn-delete-row:active,
#btn-return:active,
.delete-row-btn:active,
#btn-clear-cart:active,
.clear-cart-btn:active,
#btn-generic:active,
.generic-btn:active,
#btn-search-graphic:active,
.search-graphic-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* ========== MODALE MULTI SCAN ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    /* NASCOSTO DI DEFAULT */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
    /* VISIBILE QUANDO ATTIVO */
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: #e0e0e0;
    border: 1px solid #999;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #d0d0d0;
}

.qty-btn:active {
    background: #bdbdbd;
    transform: translateY(1px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.highlight-swap { opacity: 0.5; border: 2px dashed #333 !important; }
