:root {
    --primary-color: #6fcee6;
    --primary-hover: #5cb2c9;
    --success-color: #2ecc71;
    --danger-color: #e53935;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --dark-bg: #1e1f26;
    --accent-color: #03dac6;
    --accent-hover: #ff0266;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto", sans-serif;
    background-color: var(--dark-bg);
    color: #faebd7;
    min-height: 100vh;
}

/* Aggiungi questa regola per uniformare i font nei contenuti testuali */
.main-content-text {
    font-family: "Roboto", sans-serif;
}
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Cart Icon */
.cart-icon-container {
    position: relative;
    cursor: pointer;
}

.cart-icon {
    color: #faebd7;
    font-size: 1.5rem;
    transition: all 0.3s;
}

.cart-icon:hover {
    color: var(--accent-color);
}

.cart-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--accent-hover);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    display: none;
}

.cart-badge.show {
    display: flex;
}

/* Main Content */
.main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 60px;
}

/* Products Grid */
#productsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.product-card {
    background-color: rgba(30, 31, 38, 0.8);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 13px -2px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    border: 1px solid rgba(3, 218, 198, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(3, 218, 198, 0.3);
}

.product-img-container {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1e1f26;
}

.product-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-family: "Roboto", sans-serif;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Stili aggiornati per i prezzi */
.product-price-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0.8rem 0;
    flex-wrap: wrap;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #faebd7;
}

.product-price.original {
    text-decoration: line-through;
    color: #888;
    font-size: 1rem;
    opacity: 0.8;
}

.product-price.discounted {
    color: var(--accent-color);
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(3, 218, 198, 0.3);
    animation: pulseDiscount 1.5s ease-in-out infinite;
}

.price-savings {
    background-color: var(--danger-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.add-to-cart:hover {
    background-color: var(--primary-hover);
}

.add-to-cart.adding::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    animation: ripple 0.6s linear;
}

.add-to-cart.added {
    background-color: var(--success-color) !important;
}

/* Badges */
.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.badge-new {
    background-color: var(--accent-color);
    color: var(--dark-bg);
}

.badge-sale {
    background: linear-gradient(135deg, var(--danger-color) 0%, #ff6b6b 100%);
    color: white;
}

.badge-best {
    background-color: #ff9800;
    color: white;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background-color: var(--dark-bg);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    transition: right 0.3s;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    padding: 1.5rem;
    background-color: rgba(30, 31, 38, 0.9);
    border-bottom: 1px solid rgba(3, 218, 198, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-family: "Roboto", sans-serif;
    color: var(--accent-color);
    margin: 0;
    font-weight: 500;
}

.close-cart {
    background: none;
    border: none;
    color: #faebd7;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.close-cart:hover {
    color: var(--accent-hover);
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: rgba(30, 31, 38, 0.7);
}

.cart-item {
    display: flex;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: rgba(30, 31, 38, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(3, 218, 198, 0.1);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 1rem;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.cart-item-price {
    font-size: 0.9rem;
    color: #faebd7;
    margin-bottom: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    border: 1px solid rgba(3, 218, 198, 0.3);
    background: rgba(30, 31, 38, 0.5);
    color: #faebd7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: rgba(3, 218, 198, 0.2);
}

.delete-btn {
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.1rem;
    background: none;
    border: none;
    margin-left: auto;
    transition: all 0.2s;
    background: rgba(229, 57, 53, 0.1);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
}

.delete-btn:hover {
    background: rgba(229, 57, 53, 0.2);
}

.cart-footer {
    padding: 1.5rem;
    background-color: rgba(30, 31, 38, 0.9);
    border-top: 1px solid rgba(3, 218, 198, 0.1);
}

.cart-totals {
    margin-bottom: 1.5rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #faebd7;
}

.cart-total-row.grand-total {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-color);
    padding-top: 1rem;
    border-top: 1px solid rgba(3, 218, 198, 0.3);
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.checkout-btn:hover:not(:disabled) {
    background-color: #28a745;
}

.checkout-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.clear-cart-btn {
    width: 100%;
    padding: 0.8rem;
    background: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(229, 57, 53, 0.4);
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.3s;
}

.clear-cart-btn:hover {
    background: rgba(229, 57, 53, 0.3);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes pulseDiscount {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Product Filters */
.product-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(30, 31, 38, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(3, 218, 198, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    background: rgba(30, 31, 38, 0.9);
    border: 1px solid rgba(3, 218, 198, 0.3);
    border-radius: 6px;
    color: #faebd7;
    font-family: "Roboto", sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(3, 218, 198, 0.2);
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    font-size: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
}

.filter-buttons::-webkit-scrollbar {
    height: 5px;
}

.filter-buttons::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

.filter-btn, #showAll {
    padding: 0.7rem 1.2rem;
    background: rgba(30, 31, 38, 0.9);
    border: 1px solid rgba(3, 218, 198, 0.3);
    color: #faebd7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Roboto", sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    font-weight: 400;
}

.filter-btn:hover, #showAll:hover {
    background: rgba(3, 218, 198, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.filter-btn.active, #showAll.active {
    background: var(--accent-color);
    color: #1e1f26;
    font-weight: 500;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(3, 218, 198, 0.3);
}

/* Loading and error states */
.loading-indicator {
    text-align: center;
    padding: 3rem;
    font-size: 1.3rem;
    color: var(--accent-color);
    grid-column: 1 / -1;
}

.loading-indicator i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

.error-message {
    text-align: center;
    padding: 2rem;
    background: rgba(229, 57, 53, 0.1);
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: 8px;
    margin: 1rem 0;
    color: var(--danger-color);
}

/* Shipping Info Banner */
.shipping-banner {
    background: rgba(30, 31, 38, 0.9);
    border: 1px solid rgba(3, 218, 198, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.shipping-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
}

.shipping-content h3 {
    font-family: "Roboto", sans-serif;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
}

.shipping-content h3 i {
    font-size: 1.2rem;
}

.shipping-flags {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.flag-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
    position: relative;
}

.flag-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(3, 218, 198, 0.3);
}

.flag-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shipping-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.shipping-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 31, 38, 0.7);
    padding: 0.7rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(3, 218, 198, 0.2);
    transition: all 0.3s;
}

.shipping-feature:hover {
    background: rgba(3, 218, 198, 0.1);
    transform: translateY(-3px);
}

.shipping-feature i {
    color: var(--accent-color);
    font-size: 1rem;
}

.shipping-feature span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Animazione bandiere */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.flag-item:nth-child(1) { animation: float 3s ease-in-out infinite; }
.flag-item:nth-child(2) { animation: float 3s ease-in-out infinite 0.5s; }
.flag-item:nth-child(3) { animation: float 3s ease-in-out infinite 1s; }
.flag-item:nth-child(4) { animation: float 3s ease-in-out infinite 1.5s; }

/* Responsive */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 90%;
        right: -90%;
    }
    
    .header {
        padding: 1rem;
    }
    
    .main {
        padding: 1rem;
        padding-bottom: 80px;
    }
    
    .shipping-features {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .shipping-feature {
        width: 100%;
        justify-content: center;
    }
    
    .product-price-container {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    #productsContainer {
        grid-template-columns: 1fr;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .product-price.original {
        font-size: 0.9rem;
    }
    
    .product-price.discounted {
        font-size: 1.2rem;
    }
}

/* Checkout Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: linear-gradient(135deg, #1e1f26 0%, #2a2b33 100%);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

/* Assicurati che la modale sia sopra il carrello */
.cart-sidebar {
    z-index: 1000;
}

.modal-overlay {
    z-index: 2000;
}