/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

/* Filtri Dropdown */
.filters {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.dropdown {
    position: relative;
    display: inline-block;
    min-width: 200px;
}

.dropdown-btn {
    background: #fff;
    border: 2px solid #ddd;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.dropdown-btn:hover {
    border-color: #4ECDC4;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.2);
}

.dropdown.active .dropdown-btn {
    border-color: #4ECDC4;
    background: #f0fffe;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    margin-top: 5px;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1000;
    border: 1px solid #eee;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-radius: 8px;
    transition: background 0.2s ease;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

.dropdown.active .dropdown-content {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 120px);
}

/* Griglia prodotti */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(78, 205, 196, 0.3);
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    margin-bottom: 8px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.brand {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 500;
}

.premium-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
}

.close:hover {
    color: #333;
    background: rgba(255,255,255,1);
    transform: scale(1.1);
}

/* Product Detail Modal */
.product-detail {
    padding: 30px;
}

.product-header {
    margin-bottom: 25px;
    text-align: center;
}

.product-detail-image {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-header h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
}

.product-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.company-badge {
    background: #f8f9fa;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-right: 10px;
    display: inline-block;
}

.detail-badge {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

.pricing-section {
    margin: 30px 0;
}

.pricing-section h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.price-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 12px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.price-button:hover {
    border-color: #4ECDC4;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.2);
}

.price-button.selected {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    border-color: #4ECDC4;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.3);
}

.weight {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.price {
    color: #4ECDC4;
    font-weight: bold;
    font-size: 18px;
}

.price-button.selected .price {
    color: white;
}

.action-buttons {
    margin-top: 30px;
}

.order-button {
    width: 100%;
    background: linear-gradient(135deg, #1DA1F2, #0d8bd9);
    border: none;
    color: white;
    padding: 18px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.3);
}

.order-button:hover {
    background: linear-gradient(135deg, #0d8bd9, #0c7cd5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.4);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: slideInUp 0.5s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .dropdown {
        min-width: auto;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .product-detail {
        padding: 20px;
    }
    
    .price-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .price-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        gap: 8px;
    }
    
    .dropdown-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Loading states */
.product-card.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Focus states per accessibilità */
.dropdown-btn:focus,
.price-button:focus,
.order-button:focus {
    outline: 2px solid #4ECDC4;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
