/* Reset e Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Mobile Header Styles */
.mobile-header {
    display: none;
    background: linear-gradient(135deg, #051f55 0%, #0a2d6b 100%);
    color: white;
    padding: 15px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: space-between;
}

.mobile-header h1 {
    font-size: 1.2rem;
    margin: 0;
    color: white;
    flex: 1;
    text-align: center;
}

.mobile-header h1 i {
    color: #17a2b8;
    margin-right: 8px;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-actions-mobile {
    display: flex;
    align-items: center;
}

.header-btn-mobile {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    position: relative;
    transition: background-color 0.3s ease;
}

.header-btn-mobile:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-btn-mobile span {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: flex;
    opacity: 1;
}

.mobile-menu {
    background: linear-gradient(135deg, #051f55 0%, #0a2d6b 100%);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.mobile-menu-header h2 i {
    color: #17a2b8;
    margin-right: 10px;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.close-menu:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav {
    flex: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
    position: relative;
}

.mobile-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav-item i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    color: #17a2b8;
}

.mobile-nav-item .badge {
    position: absolute;
    right: 30px;
    background: #dc3545;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    display: none;
}

.mobile-nav-item .badge.show {
    display: block;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .main-header {
        display: none;
    }
    
    .main-content {
        margin-top: 70px;
    }
    
    .container {
        padding-top: 0;
    }
    
    .products-section {
        padding-top: 20px;
    }
}

/* Header Styles */
.main-header {
    background: rgba(5, 31, 85, 0.98); /* Blu scuro con trasparenza */
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.header-btn i {
    font-size: 16px;
}

#dashboard-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#dashboard-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
}

@media (max-width: 768px) {
    .header-btn span {
        display: none;
    }
    
    .header-btn {
        padding: 10px;
        min-width: 40px;
        justify-content: center;
    }
}

.main-header h1 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
}

.main-header h1 i {
    color: #17a2b8;
    margin-right: 10px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cart-btn {
    position: relative;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.cart-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.logout-btn {
    /* Stili base del pulsante */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Stili specifici */
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: -8px;
    right: -8px;
}

/* Products Section */
.products-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
}

.section-header h2 i {
    color: #3498db;
    margin-right: 10px;
}

/* Aggiungi questi stili per i filtri e la ricerca */
.products-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #2196F3;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #2196F3;
}

.product-category {
    color: #666;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    grid-column: 1 / -1;
}

.no-products i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-products h3 {
    margin-bottom: 10px;
    font-size: 24px;
}

@media (max-width: 768px) {
    .products-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select,
    .search-box {
        max-width: none;
    }
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.product-card {
    background: #f8f9fa;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: block;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border: none;
    border-radius: 0;
}

.product-image .no-image {
    color: #bdc3c7;
    font-size: 3rem;
    opacity: 0.6;
}

.product-info {
    padding: 16px;
    //*background: #f8f9fa;*//
}

.product-category {
    color: #666;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-weight {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-weight i {
    color: #888;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: #27ae60;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin-top: 16px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 4px;
    border: 1px solid #e9ecef;
    width: fit-content;
}

/* Aggiungi questi stili per assicurare che i pulsanti siano sempre cliccabili */
.quantity-btn {
    background: #6c757d;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10; /* Assicura che i pulsanti siano sopra altri elementi */
    pointer-events: auto; /* Forza l'abilitazione dei click */
}

.quantity-btn.minus-btn {
    background: #dc3545;
}

.quantity-btn.minus-btn:hover {
    background: #c82333;
}

.quantity-btn.plus-btn {
    background: #17a2b8;
}

.quantity-btn.plus-btn:hover {
    background: #138496;
}

.quantity-btn:disabled {
    background: #bdc3c7 !important;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    padding: 0 12px;
    color: #2c3e50;
}

.add-to-cart-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-to-cart-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 14px;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.2rem;
    }
}

/* Cart Section */
.cart-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
}

.cart-section.hidden {
    display: none;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e8ed;
}

.cart-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.close-cart {
    background: #e74c3c;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.close-cart:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

/* Stili per avvisi peso con colori progressivi */
.weight-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border-left: 4px solid;
}

.weight-alert i {
    font-size: 1.2em;
}

/* Verde - Situazione normale (0-20kg) */
.weight-alert.normal {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    color: #2e7d32;
    border-left-color: #4caf50;
}

.weight-alert.normal i {
    color: #4caf50;
}

/* Giallo - Avvicinamento al limite (20-23kg) */
.weight-alert.warning {
    background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
    color: #f57f17;
    border-left-color: #ffb300;
    animation: pulse-warning 2s infinite;
}

.weight-alert.warning i {
    color: #ffb300;
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Arancione - Secondo pacco (23-46kg) */
.weight-alert.caution {
    background: linear-gradient(135deg, #fff3e0 0%, #fbe9d7 100%);
    color: #e65100;
    border-left-color: #ff9800;
}

.weight-alert.caution i {
    color: #ff9800;
}

/* Rosso - Peso elevato, molti pacchi (>46kg) */
.weight-alert.danger {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    color: #c62828;
    border-left-color: #f44336;
    animation: pulse-danger 1.5s infinite;
}

.weight-alert.danger i {
    color: #f44336;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Stili per le notifiche toast - Posizionamento Centrale */
.toast-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px 24px;
    z-index: 10000;
    max-width: 90vw;
    width: 400px;
    opacity: 0;
    transition: all 0.4s ease;
    border-left: 4px solid;
    animation: fadeInCenter 0.4s ease-out;
}

.toast-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast-notification.success {
    border-left-color: #4caf50;
}

.toast-notification.warning {
    border-left-color: #ff9800;
}

.toast-notification.error {
    border-left-color: #f44336;
}

.toast-notification.info {
    border-left-color: #2196f3;
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-weight: 600;
}

.toast-header i {
    font-size: 1.1em;
}

.toast-notification.success .toast-header i {
    color: #4caf50;
}

.toast-notification.warning .toast-header i {
    color: #ff9800;
}

.toast-notification.error .toast-header i {
    color: #f44336;
}

.toast-notification.info .toast-header i {
    color: #2196f3;
}

.toast-body {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.2em;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Stili per indicatori peso nel carrello */
.cart-weight-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    margin: 8px 0;
}

.cart-weight-indicator.normal {
    background: #e8f5e8;
    color: #2e7d32;
}

.cart-weight-indicator.warning {
    background: #fff8e1;
    color: #f57f17;
}

.cart-weight-indicator.caution {
    background: #fff3e0;
    color: #e65100;
}

.cart-weight-indicator.danger {
    background: #ffebee;
    color: #c62828;
}

.cart-weight-indicator i {
    font-size: 1em;
}

@keyframes fadeInCenter {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes fadeOutCenter {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .toast-notification {
        width: 90vw;
        max-width: 350px;
        font-size: 14px;
        padding: 18px 20px;
        border-radius: 10px;
    }
    
    .toast-notification .toast-message {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .weight-alert {
        padding: 10px 12px;
        font-size: 0.9em;
    }
    
    .cart-weight-indicator {
        font-size: 0.85em;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .toast-notification {
        width: 95vw;
        max-width: 320px;
        font-size: 13px;
        padding: 16px 18px;
        gap: 10px;
    }
    
    .toast-notification .toast-icon {
        font-size: 16px;
        min-width: 16px;
    }
    
    .toast-notification .toast-close {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.cart-item-details {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-item-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-item-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.cart-summary {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.total-price {
    font-size: 1.5rem;
    color: #27ae60;
}

/* Cart Page Styles */
.cart-page-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.cart-items-container,
.cart-summary-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cart Page Styles - VERSIONE DESKTOP MIGLIORATA */
.cart-page-item {
    display: grid;
    grid-template-columns: 100px 2fr auto auto auto;
    grid-template-areas: 
        "image details quantity total actions";
    gap: 20px;
    align-items: center;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    min-height: 140px;
    border: 1px solid #f0f0f0;
}

.cart-page-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
}

.item-image {
    grid-area: image;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.item-details {
    grid-area: details;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding-right: 15px;
}

.item-details h4 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    word-wrap: break-word;
}

.item-details p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
}

.item-price {
    font-weight: 600;
    color: #27ae60;
    font-size: 1.1rem;
}

.item-quantity {
    grid-area: quantity;
    display: flex;
    justify-content: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 15;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.quantity-btn {
    background: #6c757d;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    position: relative;
    z-index: 20;
    pointer-events: auto;
    flex-shrink: 0;
}

.quantity-btn.minus-btn {
    background: #dc3545;
}

.quantity-btn.minus-btn:hover:not(:disabled) {
    background: #c82333;
    transform: scale(1.1);
}

.quantity-btn.plus-btn {
    background: #17a2b8;
}

.quantity-btn.plus-btn:hover:not(:disabled) {
    background: #138496;
    transform: scale(1.1);
}

.quantity-btn:disabled {
    background: #bdc3c7 !important;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    color: #2c3e50;
    background: white;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.item-total {
    grid-area: total;
    font-size: 1.4rem;
    font-weight: 800;
    color: #2c3e50;
    text-align: center;
    min-width: 100px;
}

.item-actions {
    grid-area: actions;
    display: flex;
    justify-content: center;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 20;
    pointer-events: auto;
    font-size: 18px;
}

.remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* MANTIENI IL LAYOUT ATTUALE SOLO PER MOBILE */
@media (max-width: 768px) {
    .cart-page-item {
        grid-template-columns: 60px 1fr;
        grid-template-areas: 
            "image details"
            "quantity quantity"
            "total actions";
        gap: 15px;
        padding: 15px;
        min-height: auto;
        background: #f8f9fa; /* Mantieni il colore originale per mobile */
    }
    
    .item-image img {
        width: 60px;
        height: 60px;
    }
    
    .item-details h4 {
        font-size: 1rem;
    }
    
    .item-details p {
        font-size: 0.85rem;
    }
    
    .item-quantity {
        justify-content: center;
        margin: 10px 0;
    }
    
    .quantity-controls {
        justify-content: center;
        padding: 8px 12px;
        background: white; /* Mantieni il background bianco per mobile */
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .quantity-display {
        min-width: 35px;
        font-size: 16px;
        padding: 4px 8px;
    }
    
    .item-total {
        justify-self: start;
        font-size: 1.1rem;
    }
    
    .item-actions {
        justify-self: end;
    }
    
    .remove-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Correzione per schermi molto piccoli - MANTIENI LAYOUT ORIGINALE */
@media (max-width: 480px) {
    .cart-page-item {
        grid-template-areas: 
            "image details"
            "quantity total"
            "actions actions";
    }
    
    .item-actions {
        justify-self: center;
        margin-top: 10px;
    }
}

.cart-summary-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e8ed;
}

.total-row {
    font-size: 1.2rem;
    border-bottom: none;
    color: #27ae60;
}

.checkout-page-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e8ed;
}

.checkout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #bdc3c7;
}

.empty-cart h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.empty-cart p {
    margin-bottom: 30px;
}

/* Media query migliorata per mobile */
@media (max-width: 768px) {
    .cart-page-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cart-page-item {
        grid-template-columns: 60px 1fr;
        grid-template-areas: 
            "image details"
            "quantity quantity"
            "total actions";
        gap: 15px;
        padding: 15px;
        min-height: auto;
    }
    
    .item-image img {
        width: 60px;
        height: 60px;
    }
    
    .item-details h4 {
        font-size: 1rem;
    }
    
    .item-details p {
        font-size: 0.85rem;
    }
    
    .item-quantity {
        justify-content: center;
        margin: 10px 0;
    }
    
    .quantity-controls {
        justify-content: center;
        padding: 10px;
    }
    
    .item-total {
        justify-self: start;
        font-size: 1.1rem;
    }
    
    .item-actions {
        justify-self: end;
    }
    
    .checkout-actions {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Correzione per schermi molto piccoli */
@media (max-width: 480px) {
    .cart-page-item {
        grid-template-areas: 
            "image details"
            "quantity total"
            "actions actions";
    }
    
    .item-actions {
        justify-self: center;
        margin-top: 10px;
    }
}

/* Order Form */
.checkout-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
    width: 100%;
}

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(52, 152, 219, 0.95);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.install-banner.hidden {
    display: none;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.install-content button {
    background: white;
    color: #3498db;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.install-content button:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-header h1 {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .search-box input:focus {
        width: 220px;
    }
    
    .cart-section {
        width: 95%;
        padding: 20px;
    }
    
    .products-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .quantity-selector {
        align-self: center;
    }
    
    .install-content {
        flex-direction: column;
        text-align: center;
    }
}

/* MODAL OVERLAY CENTRATA */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.active,
.modal[style*="display: flex"] {
    display: flex !important;
}

/* MODAL CONTENT MODERNO */
.modal {
    display: none;
    position: fixed !important;
    inset: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center !important;
    align-items: center !important;
    overflow-y: auto;
}
.modal.active,
.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content,
.product-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 520px;
    width: 96%;
    margin: 0 auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    padding: 32px 24px 24px 24px;
    position: relative;
    animation: modal-appear 0.25s cubic-bezier(.2,.8,.2,1);
    max-height: 96vh;
    overflow-y: auto;
}
@keyframes modal-appear {
    0% { transform: scale(0.95) translateY(30px); opacity: 0;}
    100% { transform: scale(1) translateY(0); opacity: 1;}
}