/* Menu Digitale Operatore - Stili per visualizzazione cassa */

.menu-digitale-operatore {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* ============================================
   VISUALIZZAZIONE CASSA
   ============================================ */

.menu-cassa {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    max-height: 100vh;
}

/* Container categorie - barra orizzontale in alto */
.cassa-categorie-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px;
    gap: 15px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f8f9fa;
    flex-shrink: 0;
    min-height: 120px;
}

.cassa-categorie-container::-webkit-scrollbar {
    height: 8px;
}

.cassa-categorie-container::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.cassa-categorie-container::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 4px;
}

/* Item categoria */
.cassa-categoria-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 100px;
    max-width: 120px;
    padding: 10px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    background-color: #ffffff;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cassa-categoria-item:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cassa-categoria-item.active {
    background-color: #007bff;
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.cassa-categoria-item.active .cassa-categoria-nome {
    color: #ffffff;
    font-weight: 600;
}

/* Icona categoria */
.cassa-categoria-icon {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid #dee2e6;
    background-color: #ffffff;
}

.cassa-categoria-item.active .cassa-categoria-icon {
    border-color: #ffffff;
}

.cassa-categoria-icon-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid #dee2e6;
}

.cassa-categoria-item.active .cassa-categoria-icon-placeholder {
    border-color: #ffffff;
}

/* Nome categoria */
.cassa-categoria-nome {
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    text-align: center;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
}

/* Container prodotti - area scrollabile sotto */
.cassa-prodotti-container {
    flex: 1;
    height: calc(70vh - 120px);
    max-height: calc(70vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background-color: #ffffff;
    -webkit-overflow-scrolling: touch;
    position: relative;
    min-height: 0;
}

.cassa-prodotti-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 18px;
    font-weight: 500;
}

/* Griglia prodotti - quadrati piccoli */
.cassa-prodotti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

/* Item prodotto - quadrato piccolo */
.cassa-prodotto-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 140px;
    padding: 12px;
    background-color: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.cassa-prodotto-item:hover {
    border-color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #f8f9ff;
}

.cassa-prodotto-item:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Icona prodotto (placeholder e immagine) */
.cassa-prodotto-icon-wrapper {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.cassa-prodotto-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cassa-prodotto-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
}

.cassa-prodotto-icon-placeholder svg {
    width: 100%;
    height: 100%;
    max-width: 48px;
    max-height: 48px;
}

/* Nome prodotto */
.cassa-prodotto-nome {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 4px;
    word-wrap: break-word;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prezzo prodotto */
.cassa-prodotto-prezzo {
    font-size: 14px;
    font-weight: 700;
    color: #28a745;
    text-align: center;
    margin-top: auto;
}

/* Tags prodotto */
.cassa-prodotto-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-top: 6px;
    width: 100%;
}

.cassa-prodotto-tags .tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cassa-prodotto-tags .tag-novita {
    background-color: #ffc107;
    color: #212529;
}

.cassa-prodotto-tags .tag-limited {
    background-color: #dc3545;
    color: #ffffff;
}

/* ============================================
   EFFETTO CLICK - ILLUMINAZIONE BLU
   ============================================ */

/* Animazione fade-out per l'illuminazione blu */
@keyframes flashBlueFade {
    0% {
        background-color: rgba(0, 123, 255, 0.4);
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.5);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

/* Effetto flash blu per item prodotto */
.cassa-prodotto-item.flash-added {
    background-color: rgba(0, 123, 255, 0.4) !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.5) !important;
    animation: flashBlueFade 0.8s ease-out forwards !important;
    border-color: #007bff !important;
}

/* Tema dark - effetto flash blu */
.theme-dark .cassa-prodotto-item.flash-added {
    background-color: rgba(0, 123, 255, 0.5) !important;
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.6) !important;
}

/* Bold per nome prodotto quando aggiunto */
.cassa-prodotto-item.added-bold .cassa-prodotto-nome {
    font-weight: 700 !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .cassa-prodotti-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .cassa-categoria-item {
        min-width: 90px;
        max-width: 100px;
    }
    
    .cassa-categoria-icon,
    .cassa-categoria-icon-placeholder {
        width: 70px;
        height: 70px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .cassa-categorie-container {
        padding: 10px;
        gap: 10px;
    }
    
    .cassa-categoria-item {
        min-width: 80px;
        max-width: 90px;
        padding: 8px;
    }
    
    .cassa-categoria-icon,
    .cassa-categoria-icon-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .cassa-categoria-nome {
        font-size: 12px;
    }
    
    .cassa-prodotti-container {
        padding: 15px;
    }
    
    .cassa-prodotti-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }
    
    .cassa-prodotto-item {
        min-height: 120px;
        padding: 10px;
    }
    
    .cassa-prodotto-nome {
        font-size: 12px;
    }
    
    .cassa-prodotto-prezzo {
        font-size: 13px;
    }
}

/* Mobile piccolo */
@media (max-width: 480px) {
    .cassa-prodotti-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .cassa-prodotto-item {
        min-height: 110px;
        padding: 8px;
    }
    
    .cassa-prodotto-nome {
        font-size: 11px;
    }
    
    .cassa-prodotto-prezzo {
        font-size: 12px;
    }
}

/* ============================================
   VISUALIZZAZIONE OPERATORE
   ============================================ */

.menu-operatore {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    max-height: 100vh;
    background-color: #ffffff;
}

/* Container categorie - barra orizzontale compatta in alto per schermi verticali */
.operatore-categorie-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    gap: 10px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f8f9fa;
    flex-shrink: 0;
    min-height: 90px;
}

.operatore-categorie-container::-webkit-scrollbar {
    height: 6px;
}

.operatore-categorie-container::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.operatore-categorie-container::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 3px;
}

/* Item categoria - più compatto per schermi verticali */
.operatore-categoria-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 70px;
    max-width: 80px;
    padding: 8px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    background-color: #ffffff;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.operatore-categoria-item:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.operatore-categoria-item.active {
    background-color: #007bff;
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.operatore-categoria-item.active .operatore-categoria-nome {
    color: #ffffff;
    font-weight: 600;
}

/* Icona categoria - più piccola per schermi verticali */
.operatore-categoria-icon {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 2px solid #dee2e6;
    background-color: #ffffff;
}

.operatore-categoria-item.active .operatore-categoria-icon {
    border-color: #ffffff;
}

.operatore-categoria-icon-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 2px solid #dee2e6;
}

.operatore-categoria-item.active .operatore-categoria-icon-placeholder {
    border-color: #ffffff;
}

/* Nome categoria - più piccolo per schermi verticali */
.operatore-categoria-nome {
    font-size: 11px;
    font-weight: 500;
    color: #212529;
    text-align: center;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
}

/* Container prodotti - area scrollabile sotto */
.operatore-prodotti-container {
    flex: 1;
    height: calc(100vh - 90px);
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    background-color: #ffffff;
    -webkit-overflow-scrolling: touch;
    position: relative;
    min-height: 0;
}

.operatore-prodotti-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
    font-weight: 500;
}

/* Griglia prodotti - ottimizzata per schermi verticali */
.operatore-prodotti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 10px 0;
}

/* Item prodotto - compatto per schermi verticali */
.operatore-prodotto-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 130px;
    padding: 10px;
    background-color: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.operatore-prodotto-item:hover {
    border-color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #f8f9ff;
}

.operatore-prodotto-item:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Icona prodotto (placeholder) */
.operatore-prodotto-icon-wrapper {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.operatore-prodotto-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 6px;
}

.operatore-prodotto-icon-placeholder svg {
    width: 100%;
    height: 100%;
    max-width: 40px;
    max-height: 40px;
}

/* Nome prodotto */
.operatore-prodotto-nome {
    font-size: 12px;
    font-weight: 600;
    color: #212529;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 4px;
    word-wrap: break-word;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prezzo prodotto */
.operatore-prodotto-prezzo {
    font-size: 13px;
    font-weight: 700;
    color: #28a745;
    text-align: center;
    margin-top: auto;
}

/* Tags prodotto */
.operatore-prodotto-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-top: 4px;
    width: 100%;
}

.operatore-prodotto-tags .tag {
    display: inline-block;
    padding: 2px 5px;
    font-size: 9px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.operatore-prodotto-tags .tag-novita {
    background-color: #ffc107;
    color: #212529;
}

.operatore-prodotto-tags .tag-limited {
    background-color: #dc3545;
    color: #ffffff;
}

/* Effetto flash blu per item prodotto operatore */
.operatore-prodotto-item.flash-added {
    background-color: rgba(0, 123, 255, 0.4) !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.5) !important;
    animation: flashBlueFade 0.8s ease-out forwards !important;
    border-color: #007bff !important;
}

/* Bold per nome prodotto quando aggiunto */
.operatore-prodotto-item.added-bold .operatore-prodotto-nome {
    font-weight: 700 !important;
}

/* ============================================
   TEMA DARK
   ============================================ */

/* Container categorie - tema dark */
.theme-dark .cassa-categorie-container {
    background-color: #21252a;
    border-bottom-color: rgba(255, 255, 255, 0.05);
    scrollbar-color: #434a54 #21252a;
}

.theme-dark .cassa-categorie-container::-webkit-scrollbar-track {
    background: #21252a;
}

.theme-dark .cassa-categorie-container::-webkit-scrollbar-thumb {
    background-color: #434a54;
}

/* Item categoria - tema dark */
.theme-dark .cassa-categoria-item {
    background-color: #1b1d21;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-dark .cassa-categoria-item:hover {
    background-color: #2a2d35;
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.theme-dark .cassa-categoria-item.active {
    background-color: #007bff;
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* Icona categoria - tema dark */
.theme-dark .cassa-categoria-icon {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: #1b1d21;
}

.theme-dark .cassa-categoria-icon-placeholder {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Nome categoria - tema dark */
.theme-dark .cassa-categoria-nome {
    color: #ffffff;
}

/* Container prodotti - tema dark */
.theme-dark .cassa-prodotti-container {
    background-color: #1b1d21;
}

.theme-dark .cassa-prodotti-message {
    color: #898989;
}

/* Item prodotto - tema dark */
.theme-dark .cassa-prodotto-item {
    background-color: #21252a;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-dark .cassa-prodotto-item:hover {
    border-color: #007bff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    background-color: #2a2d35;
}

/* Icona prodotto - tema dark */
.theme-dark .cassa-prodotto-icon-wrapper {
    background-color: #1b1d21;
    border-color: rgba(255, 255, 255, 0.05);
}

.theme-dark .cassa-prodotto-icon-placeholder {
    background-color: #1b1d21;
    border-color: rgba(255, 255, 255, 0.05);
}

/* Nome prodotto - tema dark */
.theme-dark .cassa-prodotto-nome {
    color: #ffffff;
}

/* Prezzo prodotto - tema dark */
.theme-dark .cassa-prodotto-prezzo {
    color: #28a745;
}

/* Tags prodotto - tema dark (mantengono gli stessi colori per visibilità) */
.theme-dark .cassa-prodotto-tags .tag-novita {
    background-color: #ffc107;
    color: #212529;
}

.theme-dark .cassa-prodotto-tags .tag-limited {
    background-color: #dc3545;
    color: #ffffff;
}

/* Visualizzazione operatore - tema dark */
.theme-dark .menu-operatore {
    background-color: #1b1d21;
}

.theme-dark .operatore-categorie-container {
    background-color: #21252a;
    border-bottom-color: rgba(255, 255, 255, 0.05);
    scrollbar-color: #434a54 #21252a;
}

.theme-dark .operatore-categorie-container::-webkit-scrollbar-track {
    background: #21252a;
}

.theme-dark .operatore-categorie-container::-webkit-scrollbar-thumb {
    background-color: #434a54;
}

.theme-dark .operatore-categoria-item {
    background-color: #1b1d21;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-dark .operatore-categoria-item:hover {
    background-color: #2a2d35;
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.theme-dark .operatore-categoria-item.active {
    background-color: #007bff;
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.theme-dark .operatore-categoria-icon {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: #1b1d21;
}

.theme-dark .operatore-categoria-icon-placeholder {
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .operatore-categoria-nome {
    color: #ffffff;
}

.theme-dark .operatore-prodotti-container {
    background-color: #1b1d21;
}

.theme-dark .operatore-prodotti-message {
    color: #898989;
}

.theme-dark .operatore-prodotto-item {
    background-color: #21252a;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-dark .operatore-prodotto-item:hover {
    border-color: #007bff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    background-color: #2a2d35;
}

.theme-dark .operatore-prodotto-icon-wrapper {
    background-color: #1b1d21;
    border-color: rgba(255, 255, 255, 0.05);
}

.theme-dark .operatore-prodotto-icon-placeholder {
    background-color: #1b1d21;
    border-color: rgba(255, 255, 255, 0.05);
}

.theme-dark .operatore-prodotto-nome {
    color: #ffffff;
}

.theme-dark .operatore-prodotto-prezzo {
    color: #28a745;
}

.theme-dark .operatore-prodotto-tags .tag-novita {
    background-color: #ffc107;
    color: #212529;
}

.theme-dark .operatore-prodotto-tags .tag-limited {
    background-color: #dc3545;
    color: #ffffff;
}

.theme-dark .operatore-prodotto-item.flash-added {
    background-color: rgba(0, 123, 255, 0.5) !important;
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.6) !important;
}

/* Responsive per visualizzazione operatore */
@media (max-width: 480px) {
    .operatore-categorie-container {
        padding: 8px;
        gap: 8px;
        min-height: 80px;
    }
    
    .operatore-categoria-item {
        min-width: 60px;
        max-width: 70px;
        padding: 6px;
    }
    
    .operatore-categoria-icon,
    .operatore-categoria-icon-placeholder {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .operatore-categoria-nome {
        font-size: 10px;
    }
    
    .operatore-prodotti-container {
        padding: 10px;
        height: calc(100vh - 80px);
        max-height: calc(100vh - 80px);
    }
    
    .operatore-prodotti-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 10px;
    }
    
    .operatore-prodotto-item {
        min-height: 120px;
        padding: 8px;
    }
    
    .operatore-prodotto-nome {
        font-size: 11px;
    }
    
    .operatore-prodotto-prezzo {
        font-size: 12px;
    }
}

/* ============================================
   POPUP OPZIONI PRODOTTO (SOLO CASSA)
   ============================================ */

.popup-opzioni-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.popup-opzioni-overlay.popup-opzioni-active {
    opacity: 1;
    pointer-events: all;
}

.popup-opzioni-prodotto {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    min-width: 300px;
    max-width: 90%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.popup-opzioni-prodotto.popup-opzioni-active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.popup-opzioni-content {
    padding: 20px;
}

.popup-opzioni-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
    text-align: center;
}

.popup-opzioni-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-opzioni-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #007bff;
    color: #ffffff;
}

.popup-opzioni-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.popup-opzioni-btn:active {
    transform: translateY(0);
}

.popup-opzioni-btn-close {
    background-color: #6c757d;
}

.popup-opzioni-btn-close:hover {
    background-color: #5a6268;
}

/* Tema dark - popup opzioni */
.theme-dark .popup-opzioni-prodotto {
    background-color: #21252a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.theme-dark .popup-opzioni-title {
    color: #ffffff;
}

.theme-dark .popup-opzioni-btn {
    background-color: #007bff;
}

.theme-dark .popup-opzioni-btn:hover {
    background-color: #0056b3;
}

.theme-dark .popup-opzioni-btn-close {
    background-color: #434a54;
}

.theme-dark .popup-opzioni-btn-close:hover {
    background-color: #5a6268;
}

/* ============================================
   SELETTORE IMMAGINI
   ============================================ */

.selettore-immagine-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.selettore-immagine-overlay.selettore-immagine-active {
    opacity: 1;
    pointer-events: all;
}

.selettore-immagine-prodotto {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.selettore-immagine-prodotto.selettore-immagine-active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.selettore-immagine-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 90vh;
}

.selettore-immagine-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
}

.selettore-immagine-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    min-height: 200px;
    max-height: calc(90vh - 140px);
}

.selettore-immagine-item {
    aspect-ratio: 1;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
}

.selettore-immagine-item:hover {
    border-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.selettore-immagine-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.selettore-immagine-loading,
.selettore-immagine-error,
.selettore-immagine-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
}

.selettore-immagine-error {
    color: #dc3545;
}

.selettore-immagine-pagination {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background-color: #f8f9fa;
}

.selettore-immagine-pagination-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #ffffff;
    color: #212529;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selettore-immagine-pagination-btn:hover:not(:disabled) {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.selettore-immagine-pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.selettore-immagine-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #e9ecef;
    color: #6c757d;
}

.selettore-immagine-pagination-info {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.selettore-immagine-actions {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.selettore-immagine-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selettore-immagine-btn-cancel {
    background-color: #6c757d;
    color: #ffffff;
}

.selettore-immagine-btn-cancel:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.selettore-immagine-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selettore-immagine-loading-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
}

/* Tema dark - selettore immagini */
.theme-dark .selettore-immagine-prodotto {
    background-color: #21252a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.theme-dark .selettore-immagine-title {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .selettore-immagine-grid {
    background-color: #1b1d21;
}

.theme-dark .selettore-immagine-item {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: #2a2d35;
}

.theme-dark .selettore-immagine-item:hover {
    border-color: #007bff;
}

.theme-dark .selettore-immagine-loading,
.theme-dark .selettore-immagine-error,
.theme-dark .selettore-immagine-empty {
    color: #898989;
}

.theme-dark .selettore-immagine-error {
    color: #dc3545;
}

.theme-dark .selettore-immagine-pagination {
    background-color: #1b1d21;
    border-top-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .selettore-immagine-pagination-btn {
    background-color: #21252a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.theme-dark .selettore-immagine-pagination-btn:hover:not(:disabled) {
    background-color: #007bff;
    border-color: #007bff;
}

.theme-dark .selettore-immagine-pagination-btn:disabled {
    background-color: #2a2d35;
    color: #6c757d;
}

.theme-dark .selettore-immagine-pagination-info {
    color: #898989;
}

.theme-dark .selettore-immagine-actions {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .selettore-immagine-btn-cancel {
    background-color: #434a54;
}

.theme-dark .selettore-immagine-btn-cancel:hover {
    background-color: #5a6268;
}

/* Responsive selettore immagini */
@media (max-width: 768px) {
    .selettore-immagine-prodotto {
        width: 95%;
        max-height: 85vh;
    }
    
    .selettore-immagine-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 15px;
    }
    
    .selettore-immagine-title {
        font-size: 18px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .selettore-immagine-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
        padding: 10px;
    }
}

