/**
 * Account Styles - Modern Design - VERSIONE SENZA INTERFERENZE FORM
 * File: assets/css/account-styles.css
 */

/* IMPORTANTE: Tutti i selettori sono specifici per evitare conflitti con form login/registrazione */

/* Menu navigazione moderno - SOLO per menu account loggato */
.woocommerce-account .woocommerce-MyAccount-navigation {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    margin: 0;
    padding: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation-link {
    border-bottom: 1px solid #f7f8fa;
}

.woocommerce-account .woocommerce-MyAccount-navigation-link:last-child {
    border-bottom: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation-link a {
    display: block;
    padding: 18px 24px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.woocommerce-account .woocommerce-MyAccount-navigation-link a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation-link.is-active a {
    background: #f7fafc;
    color: #2d3748;
    border-left-color: #148d46;
}

/* Badge NEW per menu - SOLO account loggato */
.woocommerce-account .new-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    animation: pulse-new 2s infinite;
}

@keyframes pulse-new {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.1); opacity: 0.8; }
}

/* Sezione categorie preferite - SPECIFICO */
.categories-preference-section {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.categories-preference-section h3 {
    margin: 0 0 16px 0;
    color: #2d3748;
    font-size: 18px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    text-align: center;
}

.category-item:hover {
    border-color: #148d46;
    background: #f0f9f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 141, 70, 0.15);
}

.category-item.selected {
    border-color: #148d46;
    background: #ecfdf5;
    box-shadow: 0 0 0 3px rgba(20, 141, 70, 0.1);
}

.category-item.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #148d46;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.category-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.category-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-item:hover .category-thumb img {
    transform: scale(1.05);
}

.category-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.category-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.2;
}

.category-count {
    color: #718096;
    font-size: 12px;
    margin-top: 4px;
}

/* Container prodotti consigliati - SPECIFICO */
#recommended-products-container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Header prodotti con paginazione - SPECIFICO */
#recommended-products-container .products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

#recommended-products-container .products-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 24px;
    font-weight: 700;
}

/* Controlli paginazione moderni */
#recommended-products-container .products-pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#recommended-products-container .pagination-arrow {
    background: transparent;
    border: none;
    color: #6b7280;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

#recommended-products-container .pagination-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #148d46;
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: -1;
}

#recommended-products-container .pagination-arrow:hover:not(:disabled)::before {
    opacity: 1;
    transform: scale(1);
}

#recommended-products-container .pagination-arrow:hover:not(:disabled) {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 141, 70, 0.4);
}

#recommended-products-container .pagination-arrow:active:not(:disabled) {
    transform: translateY(0);
}

#recommended-products-container .pagination-arrow:disabled {
    color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.5;
}

#recommended-products-container .pagination-arrow:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Stile specifico per le frecce */
#recommended-products-container .pagination-arrow.prev::after {
    content: '‹';
    font-size: 18px;
    line-height: 1;
}

#recommended-products-container .pagination-arrow.next::after {
    content: '›';
    font-size: 18px;
    line-height: 1;
}

#recommended-products-container .pagination-info {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    padding: 0 12px;
    white-space: nowrap;
    background: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    margin: 0 4px;
}

/* Micro-animazione per cambio pagina */
#recommended-products-container ul.products {
    transition: opacity 0.2s ease;
}

#recommended-products-container ul.products.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive moderno */
@media (max-width: 768px) {
    #recommended-products-container .products-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    #recommended-products-container .products-header h2 {
        text-align: center;
        font-size: 22px;
    }
    
    #recommended-products-container .products-pagination-nav {
        align-self: center;
        padding: 6px;
    }
    
    #recommended-products-container .pagination-arrow {
        width: 40px;
        height: 40px;
    }
    
    #recommended-products-container .pagination-info {
        font-size: 14px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    #recommended-products-container .products-header {
        gap: 12px;
    }
    
    #recommended-products-container .products-header h2 {
        font-size: 20px;
    }
    
    #recommended-products-container .products-pagination-nav {
        padding: 4px;
        gap: 6px;
    }
    
    #recommended-products-container .pagination-arrow {
        width: 32px;
        height: 32px;
    }
    
    #recommended-products-container .pagination-info {
        font-size: 12px;
        padding: 6px 10px;
        margin: 0 2px;
    }
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
    #recommended-products-container .products-pagination-nav {
        background: #374151;
        border-color: #4b5563;
    }
    
    #recommended-products-container .pagination-arrow {
        color: #9ca3af;
    }
    
    #recommended-products-container .pagination-info {
        background: #1f2937;
        color: #f9fafb;
        border-color: #374151;
    }
}

/* Effetti hover avanzati per desktop */
@media (hover: hover) {
    #recommended-products-container .pagination-arrow:hover:not(:disabled) {
        transform: translateY(-2px);
    }
    
    #recommended-products-container .products-pagination-nav:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* Riduce animazioni se preferenze utente */
@media (prefers-reduced-motion: reduce) {
    #recommended-products-container .pagination-arrow,
    #recommended-products-container .pagination-arrow::before,
    #recommended-products-container ul.products {
        transition: none;
    }
}
/* GRIGLIA PRODOTTI CONSIGLIATI - ULTRA SPECIFICO */
#recommended-products-container ul.products.columns-5 {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 30px !important;
    justify-content: center;
    margin: 0 auto;
    max-width: 1600px;
}

/* CARD PRODOTTI - ULTRA SPECIFICO */
#recommended-products-container ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    justify-content: space-between !important;
    
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 !important;
    list-style: none !important;
}

#recommended-products-container ul.products li.product:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(20, 141, 70, 0.15),
        0 0 0 1px rgba(20, 141, 70, 0.1);
    background: linear-gradient(145deg, #ffffff 0%, #f0f9f4 100%);
}

/* Container codici sconto - SPECIFICO */
#discount-codes-container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.discount-code-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.discount-code-item.disabled {
    background: #f3f4f6;
    border-color: #d1d5db;
    opacity: 0.7;
}

/* Badge NEW per coupon */
.new-coupon-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 10;
    animation: pulse-badge 2s infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.discount-code {
    font-family: monospace;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px dashed #148d46;
    color: #148d46;
    font-weight: bold;
    font-size: 14px;
}

.discount-code-item.disabled .discount-code {
    border-color: #9ca3af;
    color: #6b7280;
    background: #f9fafb;
}

/* ADMIN SECTIONS - ULTRA SPECIFICI */

#admin-coupon-creation-container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: 800px;
}

#admin-coupon-creation-container h2 {
    margin: 0 0 24px 0;
    color: #2d3748;
    font-size: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

/* Form creazione coupon - SPECIFICO PER ADMIN CONTAINER */
#admin-coupon-creation-container .coupon-creation-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
}

#admin-coupon-creation-container .form-group {
    margin-bottom: 20px;
}

#admin-coupon-creation-container .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

#admin-coupon-creation-container .form-group.half-width {
    margin-bottom: 0;
}

#admin-coupon-creation-container .form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

#admin-coupon-creation-container .form-group input,
#admin-coupon-creation-container .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

#admin-coupon-creation-container .form-group input:focus,
#admin-coupon-creation-container .form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#admin-coupon-creation-container .form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
}

/* Fix larghezza campi numerici - SPECIFICI */
#admin-coupon-creation-container #coupon-discount,
#admin-coupon-creation-container #usage-limit {
    min-width: 140px !important;
    text-align: center;
    font-weight: 600;
}

#admin-coupon-creation-container #coupon-discount:focus,
#admin-coupon-creation-container #coupon-duration:focus,
#admin-coupon-creation-container #usage-limit:focus {
    border-color: #148d46 !important;
    box-shadow: 0 0 0 3px rgba(20, 141, 70, 0.1) !important;
}

/* Nota importante - SPECIFICA */
#admin-coupon-creation-container .coupon-note {
    background: #fef3cd;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 16px;
    margin: 20px 0;
}

#admin-coupon-creation-container .coupon-note p {
    margin: 0;
    color: #92400e;
    font-size: 14px;
}

/* Azioni form - SPECIFICHE */
#admin-coupon-creation-container .form-actions {
    display: flex;
    gap: 24px !important;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    margin-top: 24px;
    justify-content: flex-start;
}

/* Button styles - SOLO per container specifici */
.categories-preference-section .button,
#recommended-products-container .button,
#discount-codes-container .button,
#admin-coupon-creation-container .button,
#admin-manage-coupons-container .button {
    background: #148d46;
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.categories-preference-section .button:hover,
#recommended-products-container .button:hover,
#discount-codes-container .button:hover,
#admin-coupon-creation-container .button:hover,
#admin-manage-coupons-container .button:hover {
    background: #148d46;
    transform: translateY(-1px);
}

#admin-coupon-creation-container .button.primary {
    background: #148d46;
    border: 2px solid #148d46;
    color: white;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

#admin-coupon-creation-container .button.primary:hover:not(:disabled) {
    background: #0f7b3c;
    border-color: #0f7b3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 141, 70, 0.3);
}

#admin-coupon-creation-container .button.primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#admin-coupon-creation-container .button.secondary {
    background: transparent;
    border: 2px solid #d1d5db;
    color: #6b7280;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

#admin-coupon-creation-container .button.secondary:hover {
    border-color: #9ca3af;
    color: #374151;
    transform: translateY(-1px);
}

/* Button small per azioni - SPECIFICI */
#discount-codes-container .button-small,
#admin-manage-coupons-container .button-small {
    background: #148d46;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#discount-codes-container .button-small:hover:not(.disabled),
#admin-manage-coupons-container .button-small:hover:not(.disabled) {
    background: #0f7b3c;
    transform: translateY(-1px);
}

#discount-codes-container .button-small.disabled,
#admin-manage-coupons-container .button-small.disabled {
    background: #9ca3af;
    color: #6b7280;
    cursor: not-allowed;
}

#discount-codes-container .button-small.secondary,
#admin-manage-coupons-container .button-small.secondary {
    background: #ef4444;
}

#discount-codes-container .button-small.secondary:hover,
#admin-manage-coupons-container .button-small.secondary:hover {
    background: #dc2626;
}

.discount-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #1f2937;
}

.discount-info p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.discount-info p.fraud-reason {
    color: #dc2626;
    font-weight: 500;
}

.discount-info small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
}

.discount-code-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===================================================== */
/* === GESTIONE COUPON ADMIN - SPECIFICI === */
/* ===================================================== */

#admin-manage-coupons-container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#admin-manage-coupons-container h2 {
    margin: 0 0 24px 0;
    color: #2d3748;
    font-size: 24px;
}

/* Statistiche overview */
.coupon-stats-overview {
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card.active {
    background: #ecfdf5;
    border-color: #10b981;
}

.stat-card.expired {
    background: #fef2f2;
    border-color: #ef4444;
}

.stat-card.usage {
    background: #eff6ff;
    border-color: #3b82f6;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 4px;
}

.stat-card.active .stat-number {
    color: #059669;
}

.stat-card.expired .stat-number {
    color: #dc2626;
}

.stat-card.usage .stat-number {
    color: #2563eb;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Tabella coupon admin - SPECIFICA */
.coupons-table-container {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.admin-coupons-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.admin-coupons-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    border-bottom: 2px solid #e5e7eb;
}

.admin-coupons-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.coupon-row:hover {
    background: #f8fafc;
}

.coupon-row.expired {
    opacity: 0.7;
    background: #f9fafb;
}

.coupon-code-cell code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #1e40af;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.expired {
    background: #fef2f2;
    color: #991b1b;
}

.status-badge.deactivated {
    background: #f3f4f6;
    color: #6b7280;
}

.coupon-actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Messaggi admin - SPECIFICI */
#admin-coupon-creation-container .admin-success-message {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 16px;
    border-radius: 6px;
    margin: 16px 0;
    font-weight: 500;
}

#admin-coupon-creation-container .admin-error-message {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 16px;
    border-radius: 6px;
    margin: 16px 0;
    font-weight: 500;
}

/* Stati di caricamento - SPECIFICI */
.loading-products,
.loading-categories,
.loading-stats,
.loading-all-coupons {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.loading-products::before,
.loading-categories::before,
.loading-stats::before,
.loading-all-coupons::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messaggi informativi - SPECIFICI */
.no-categories-selected,
.no-products-found {
    background: #fef3cd;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.no-categories-selected p,
.no-products-found p {
    margin: 0;
    color: #92400e;
    font-size: 14px;
}

.no-categories-selected a {
    color: #148d46;
    text-decoration: underline;
    font-weight: 600;
}

/* ===================================================== */
/* === RESPONSIVE DESIGN === */
/* ===================================================== */

/* Tablet */
@media (max-width: 921px) {
    #recommended-products-container ul.products.columns-5 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    #recommended-products-container ul.products.columns-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    #admin-coupon-creation-container .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    #admin-coupon-creation-container .form-actions {
        flex-direction: column;
        gap: 16px !important;
    }
    
    #admin-coupon-creation-container .button.primary,
    #admin-coupon-creation-container .button.secondary {
        width: 100%;
        text-align: center;
        padding: 16px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .coupons-table-container {
        font-size: 12px;
    }
    
    .admin-coupons-table th,
    .admin-coupons-table td {
        padding: 8px 12px;
    }
    
    .coupon-actions-cell {
        flex-direction: column;
        gap: 4px;
    }
    
    /* CODICI SCONTO - Layout verticale mobile */
    #discount-codes-container {
        padding: 16px;
    }
    
    .discount-code-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 12px !important;
        text-align: left;
    }
    
    .discount-info {
        width: 100% !important;
        order: 1;
    }
    
    .discount-info h4 {
        width: 100% !important;
        margin: 0 0 6px 0 !important;
        font-size: 15px !important;
    }
    
    .discount-info p {
        width: 100% !important;
        margin: 0 0 8px 0 !important;
        font-size: 13px !important;
    }
    
    .discount-info small {
        font-size: 11px !important;
    }
    
    .discount-code {
        width: 100% !important;
        text-align: center !important;
        font-size: 12px !important;
        padding: 10px 8px !important;
        order: 2;
        margin: 0 !important;
    }
    
    .discount-code-actions {
        width: 100% !important;
        justify-content: center !important;
        gap: 8px !important;
        order: 3;
        margin: 0 !important;
    }
    
    #discount-codes-container .button-small {
        padding: 10px 16px !important;
        font-size: 12px !important;
        min-width: auto !important;
    }
    
    .new-coupon-badge {
        top: -6px !important;
        right: -6px !important;
        padding: 3px 6px !important;
        font-size: 9px !important;
    }
    
    /* Altri container - padding generale */
    .categories-preference-section,
    #recommended-products-container,
    #admin-coupon-creation-container,
    #admin-manage-coupons-container {
        padding: 16px;
    }
}

/* Mobile piccolo */
@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .category-item {
        flex-direction: row;
        text-align: left;
        padding: 16px;
    }
    
    .category-thumb {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
        margin-right: 12px;
    }
    
    .category-info {
        align-items: flex-start;
        text-align: left;
    }
    
    /* CODICI SCONTO - Ulteriori ottimizzazioni mobile piccolo */
    #discount-codes-container {
        padding: 12px;
    }
    
    .discount-code-item {
        padding: 10px !important;
        gap: 10px !important;
    }
    
    .discount-info h4 {
        font-size: 14px !important;
    }
    
    .discount-info p {
        font-size: 12px !important;
    }
    
    .discount-info small {
        font-size: 10px !important;
    }
    
    .discount-code {
        font-size: 11px !important;
        padding: 8px 6px !important;
    }
    
    #discount-codes-container .button-small {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
    
    .new-coupon-badge {
        font-size: 8px !important;
        padding: 2px 4px !important;
    }
}
/**
 * Aggiungi questo CSS alla fine del file: assets/css/account-styles.css
 * Stili SPECIFICI per il campo telefono - NON interferiscono con altri form
 */

/* ===================================================== */
/* === CAMPO TELEFONO ACCOUNT - ULTRA SPECIFICO === */
/* ===================================================== */

/* IMPORTANTE: Selettori ultra-specifici per evitare conflitti */
.woocommerce-account .woocommerce-EditAccountForm .account-phone-field {
    margin-bottom: 1.5em;
}

.woocommerce-account .woocommerce-EditAccountForm .account-phone-field label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #333;
}

.woocommerce-account .woocommerce-EditAccountForm .account-phone-field input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
    box-sizing: border-box;
}

.woocommerce-account .woocommerce-EditAccountForm .account-phone-field input[type="tel"]:focus {
    outline: none;
    border-color: #148d46;
    box-shadow: 0 0 0 3px rgba(20, 141, 70, 0.1);
}

.woocommerce-account .woocommerce-EditAccountForm .account-phone-field input[type="tel"]:valid {
    border-color: #10b981;
}

.woocommerce-account .woocommerce-EditAccountForm .account-phone-field input[type="tel"]:invalid {
    border-color: #ef4444;
}

.woocommerce-account .woocommerce-EditAccountForm .account-phone-field .account-phone-note {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

/* Stato di errore specifico per telefono */
.woocommerce-account .woocommerce-EditAccountForm .account-phone-field.woocommerce-invalid input[type="tel"] {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Responsive per campo telefono */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce-EditAccountForm .account-phone-field input[type="tel"] {
        padding: 14px 16px;
        font-size: 16px; /* Previene zoom su iOS */
    }
    
    .woocommerce-account .woocommerce-EditAccountForm .account-phone-field .account-phone-note {
        font-size: 11px;
    }
}

/* Accessibilità */
.woocommerce-account .woocommerce-EditAccountForm .account-phone-field input[type="tel"]:focus {
    /* Contrasto migliorato per accessibilità */
    border-width: 2px;
}

/* Animazione smooth per transizioni */
.woocommerce-account .woocommerce-EditAccountForm .account-phone-field input[type="tel"] {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Indicatore visuale per campo obbligatorio */
.woocommerce-account .woocommerce-EditAccountForm .account-phone-field .required {
    color: #ef4444;
    font-weight: bold;
}

/* Stile coordinato con gli altri campi del form */
.woocommerce-account .woocommerce-EditAccountForm .account-phone-field {
    /* Assicura coerenza con gli altri campi del form WooCommerce */
    display: block;
    width: 100%;
}
/* ===================================================== */
/* === SEZIONI ADMIN: UTENTI REGISTRATI === */
/* ===================================================== */

#admin-users-container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#admin-users-container h2 {
    margin: 0 0 24px 0;
    color: #2d3748;
    font-size: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

/* Controlli ricerca utenti */
.users-filters-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.users-search-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto auto;
    gap: 16px;
    align-items: end;
}

.admin-search-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.admin-search-input:focus {
    outline: none;
    border-color: #148d46;
    box-shadow: 0 0 0 3px rgba(20, 141, 70, 0.1);
}

.admin-filter-select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.admin-filter-select:focus {
    outline: none;
    border-color: #148d46;
    box-shadow: 0 0 0 3px rgba(20, 141, 70, 0.1);
}

/* Statistiche utenti overview */
.users-stats-overview {
    margin-bottom: 24px;
}

.users-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.users-stats-grid .stat-card.recent {
    background: #ecfdf5;
    border-color: #10b981;
}

.users-stats-grid .stat-card.recent .stat-number {
    color: #059669;
}

.users-stats-grid .stat-card.customers {
    background: #eff6ff;
    border-color: #3b82f6;
}

.users-stats-grid .stat-card.customers .stat-number {
    color: #2563eb;
}

.users-stats-grid .stat-card.active {
    background: #fef3cd;
    border-color: #f59e0b;
}

.users-stats-grid .stat-card.active .stat-number {
    color: #d97706;
}

/* Tabella utenti */
.admin-table-container {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-users-table th {
    background: #f9fafb;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.admin-users-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.admin-users-table tr:hover {
    background: #f8fafc;
}

.admin-users-table .user-name {
    font-weight: 600;
    color: #1f2937;
}

.admin-users-table .user-email a {
    color: #148d46;
    text-decoration: none;
}

.admin-users-table .user-email a:hover {
    text-decoration: underline;
}

.admin-users-table .role-badge {
    background: #e5e7eb;
    color: #374151;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

/* Paginazione utenti */
#users-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    color: #6b7280;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.active) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.active {
    background: #148d46;
    border-color: #148d46;
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================================================== */
/* === SEZIONI ADMIN: STATISTICHE PRODOTTI === */
/* ===================================================== */

#admin-statistics-container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#admin-statistics-container h2 {
    margin: 0 0 24px 0;
    color: #2d3748;
    font-size: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

/* Overview statistiche */
.statistics-overview {
    margin-bottom: 32px;
}

.statistics-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.statistics-stats-grid .stat-card.products {
    background: #ecfdf5;
    border-color: #10b981;
}

.statistics-stats-grid .stat-card.products .stat-number {
    color: #059669;
}

.statistics-stats-grid .stat-card.today {
    background: #fef3cd;
    border-color: #f59e0b;
}

.statistics-stats-grid .stat-card.today .stat-number {
    color: #d97706;
}

.statistics-stats-grid .stat-card.week {
    background: #eff6ff;
    border-color: #3b82f6;
}

.statistics-stats-grid .stat-card.week .stat-number {
    color: #2563eb;
}

/* Controlli statistiche */
.statistics-controls-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.stats-controls-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: end;
}

.stats-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-control-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

/* Tabs statistiche */
.statistics-tabs {
    margin-top: 32px;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #148d46;
    background: #f0f9f4;
}

.tab-btn.active {
    color: #148d46;
    border-bottom-color: #148d46;
    background: #f0f9f4;
}

.tab-content {
    min-height: 400px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Tabella prodotti statistiche */
.admin-products-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-products-stats-table th {
    background: #f9fafb;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    border-bottom: 2px solid #e5e7eb;
}

.admin-products-stats-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.admin-products-stats-table tr:hover {
    background: #f8fafc;
}

.admin-products-stats-table .product-title a {
    color: #148d46;
    text-decoration: none;
    font-weight: 500;
}

.admin-products-stats-table .product-title a:hover {
    text-decoration: underline;
}

.admin-products-stats-table .product-title small {
    color: #6b7280;
    font-size: 12px;
}

.admin-products-stats-table .view-count {
    text-align: center;
    font-weight: 700;
    color: #148d46;
}

.admin-products-stats-table .unique-visitors {
    text-align: center;
    color: #6b7280;
}

.admin-products-stats-table .last-view {
    font-size: 13px;
    color: #6b7280;
}

.admin-products-stats-table .product-actions {
    text-align: center;
}

/* Controlli categorie */
.categories-stats-controls {
    display: flex;
    gap: 20px;
    align-items: end;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 6px;
}

.cat-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-control-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

/* Griglia statistiche categorie */
.categories-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.category-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.category-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 141, 70, 0.1);
    border-color: #148d46;
}

.category-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.category-stat-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.category-percentage {
    background: #148d46;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.category-stat-body {
    space-y: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-label {
    color: #6b7280;
    font-size: 13px;
}

.stat-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.category-progress {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #148d46, #10b981);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Container grafici */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 24px;
}

.chart-wrapper {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.chart-wrapper h3 {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 16px;
    text-align: center;
}

.chart-wrapper canvas {
    max-width: 100%;
    height: auto !important;
}

/* Stati di caricamento per nuove sezioni */
.loading-users,
.loading-users-stats,
.loading-stats-overview,
.loading-products-stats,
.loading-categories-stats {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 14px;
}

.loading-users::before,
.loading-users-stats::before,
.loading-stats-overview::before,
.loading-products-stats::before,
.loading-categories-stats::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #148d46;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

/* Messaggi no-data specifici per admin */
.no-users-found,
.no-products-found,
.no-categories-found {
    background: #f0f9f4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin: 24px 0;
    color: #059669;
    font-size: 14px;
}

/* Button variations per admin - SPECIFICI per container admin */
#admin-users-container .button.primary,
#admin-statistics-container .button.primary {
    background: #148d46;
    border: 2px solid #148d46;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

#admin-users-container .button.primary:hover,
#admin-statistics-container .button.primary:hover {
    background: #0f7b3c;
    border-color: #0f7b3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 141, 70, 0.3);
}

#admin-users-container .button.secondary,
#admin-statistics-container .button.secondary {
    background: transparent;
    border: 2px solid #d1d5db;
    color: #6b7280;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

#admin-users-container .button.secondary:hover,
#admin-statistics-container .button.secondary:hover {
    border-color: #9ca3af;
    color: #374151;
    transform: translateY(-1px);
}

/* Fix per tabelle responsive */
@media (max-width: 1200px) {
    .admin-users-table,
    .admin-products-stats-table {
        font-size: 13px;
    }
    
    .admin-users-table th,
    .admin-users-table td,
    .admin-products-stats-table th,
    .admin-products-stats-table td {
        padding: 10px 8px;
    }
    
    .users-search-controls {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stats-controls-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

/* Tablet responsiveness */
@media (max-width: 921px) {
    .users-stats-grid,
    .statistics-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .categories-stats-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .categories-stats-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .cat-control-group,
    .stats-control-group {
        width: 100%;
    }
    
    .tab-buttons {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .tab-btn {
        flex-shrink: 0;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #admin-users-container,
    #admin-statistics-container {
        padding: 16px;
    }
    
    .users-stats-grid,
    .statistics-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stats-controls-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .admin-table-container {
        font-size: 12px;
    }
    
    .admin-users-table th,
    .admin-users-table td,
    .admin-products-stats-table th,
    .admin-products-stats-table td {
        padding: 8px 6px;
    }
    
    /* Nascondi colonne meno importanti su mobile */
    .admin-users-table .user-phone,
    .admin-users-table .user-city,
    .admin-products-stats-table .unique-visitors,
    .admin-products-stats-table .last-view {
        display: none;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .chart-wrapper {
        padding: 16px;
    }
    
    .chart-wrapper h3 {
        font-size: 14px;
    }
    
    .category-stat-card {
        padding: 16px;
    }
    
    .category-stat-header h4 {
        font-size: 15px;
    }
}

/* Miglioramenti accessibilità */
.admin-search-input:focus,
.admin-filter-select:focus,
.pagination-btn:focus,
.tab-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 141, 70, 0.2);
}

/* Animazioni smooth per elementi interattivi */
.category-stat-card,
.pagination-btn,
.tab-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stati hover migliorati per accessibilità */
.admin-users-table tr:hover,
.admin-products-stats-table tr:hover,
.category-stat-card:hover {
    transform: translateY(-1px);
}

/* Indicatori di stato per elementi attivi */
.tab-btn.active::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #148d46;
}

.pagination-btn.active {
    position: relative;
}

.pagination-btn.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: rgba(20, 141, 70, 0.1);
    border-radius: 6px;
    z-index: -1;
}

/* Print styles per tabelle */
@media print {
    #admin-users-container,
    #admin-statistics-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .users-filters-section,
    .statistics-controls-section,
    .pagination-controls,
    .tab-buttons {
        display: none;
    }
    
    .admin-users-table,
    .admin-products-stats-table {
        border: 1px solid #000;
    }
    
    .admin-users-table th,
    .admin-users-table td,
    .admin-products-stats-table th,
    .admin-products-stats-table td {
        border: 1px solid #000;
        padding: 8px;
    }
}

/* Dark mode compatibility (per futuri utilizzi) */
@media (prefers-color-scheme: dark) {
    #admin-users-container,
    #admin-statistics-container {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .admin-search-input,
    .admin-filter-select {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .admin-users-table,
    .admin-products-stats-table {
        background: #374151;
        color: #f9fafb;
    }
}

/* Ottimizzazioni performance */
.admin-table-container {
    contain: layout style;
}

.categories-stats-container {
    contain: layout;
}

.charts-container canvas {
    will-change: transform;
}

/* Loading states migliorati */
.loading-users,
.loading-products-stats,
.loading-categories-stats {
    background: linear-gradient(90deg, transparent, rgba(20, 141, 70, 0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
/* ===================================================== */
/* === PAGINAZIONE PRODOTTI === */
/* ===================================================== */

.products-pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
}

.pagination-stats {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.products-pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.products-pagination-controls .pagination-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.products-pagination-controls .pagination-btn:hover:not(.active) {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.products-pagination-controls .pagination-btn.active {
    background: #148d46;
    border-color: #148d46;
    color: #fff;
    font-weight: 600;
}

.products-pagination-controls .pagination-dots {
    color: #9ca3af;
    padding: 0 8px;
    font-weight: bold;
}

/* ===================================================== */
/* === PAGINAZIONE CATEGORIE 2x2 === */
/* ===================================================== */

.categories-grid-2x2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 20px !important;
    max-width: 800px;
    margin: 0 auto;
    min-height: 400px; /* Altezza fissa per evitare salti */
}

.categories-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.categories-pagination-info {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.categories-pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.categories-pagination-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.categories-pagination-btn:hover:not(.active) {
    background: #f9fafb;
    border-color: #148d46;
    color: #148d46;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 141, 70, 0.15);
}

.categories-pagination-btn.active {
    background: #148d46;
    border-color: #148d46;
    color: #fff;
    box-shadow: 0 4px 12px rgba(20, 141, 70, 0.3);
    transform: translateY(-1px);
}

/* Frecce più grandi e visibili */
.categories-pagination-btn:first-child,
.categories-pagination-btn:last-child {
    font-size: 18px;
    font-weight: 800;
}

/* Animazione smooth per cambio pagina */
.categories-stats-container {
    transition: all 0.3s ease;
}

.categories-stats-container.changing {
    opacity: 0.5;
    transform: translateY(10px);
}

/* ===================================================== */
/* === RESPONSIVE PAGINAZIONE === */
/* ===================================================== */

@media (max-width: 921px) {
    .categories-grid-2x2 {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        gap: 16px !important;
        min-height: auto;
    }
    
    .products-pagination-info,
    .categories-pagination-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .products-pagination-controls,
    .categories-pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
}

@media (max-width: 768px) {
    .products-pagination-controls .pagination-btn,
    .categories-pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 36px;
        height: 36px;
    }
    
    .categories-pagination-info,
    .pagination-stats {
        font-size: 13px;
    }
    
    /* Nascondi alcuni numeri pagina su mobile per risparmiare spazio */
    .products-pagination-controls .pagination-btn:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none;
    }
}

@media (max-width: 480px) {
    .categories-grid-2x2 {
        gap: 12px !important;
        padding: 0 8px;
    }
    
    .categories-pagination-container {
        padding: 12px;
        margin-top: 16px;
    }
    
    .products-pagination-info {
        padding: 12px 0;
    }
}

/* ===================================================== */
/* === MIGLIORAMENTI UX PAGINAZIONE === */
/* ===================================================== */

/* Loading state durante cambio pagina */
.pagination-loading {
    position: relative;
    pointer-events: none;
}

.pagination-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.pagination-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #148d46;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

/* Focus states per accessibilità */
.products-pagination-controls .pagination-btn:focus,
.categories-pagination-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 141, 70, 0.2);
    z-index: 1;
}

/* Miglioramenti per screen reader */
.pagination-btn[aria-current="page"],
.categories-pagination-btn[aria-current="page"] {
    /* Gli screen reader riconosceranno la pagina corrente */
}

/* Smooth scroll per tabelle lunghe */
.admin-table-container {
    scroll-behavior: smooth;
}

/* Indicatori visivi per stato caricamento */
.loading-products-stats,
.loading-categories-stats {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ottimizzazioni performance per animazioni */
.categories-pagination-btn,
.products-pagination-controls .pagination-btn {
    will-change: transform, box-shadow;
}

/* Stili per numeri grandi (100+ pagine) */
.pagination-btn.large-number {
    min-width: 50px;
    padding: 8px 6px;
    font-size: 12px;
}

/* Indicatori di navigazione rapida */
.categories-pagination-controls::before {
    content: 'Navigazione:';
    font-size: 12px;
    color: #9ca3af;
    margin-right: 8px;
    font-weight: 500;
}

/* Stati disabilitati per estremi */
.pagination-btn:disabled,
.categories-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Miglioramenti contrasto per accessibilità */
@media (prefers-contrast: high) {
    .pagination-btn.active,
    .categories-pagination-btn.active {
        background: #000;
        border-color: #000;
    }
    
    .pagination-btn,
    .categories-pagination-btn {
        border-width: 2px;
    }
}

/* Preferenze movimento ridotto */
@media (prefers-reduced-motion: reduce) {
    .categories-stats-container,
    .pagination-btn,
    .categories-pagination-btn {
        transition: none;
    }
    
    .pagination-loading::after {
        animation: none;
    }
}