/* assets/css/style.css */

:root {
    --primary-color: #d32f2f;
    --secondary-color: #212121;
    --accent-color: #ff6f00;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --warning-color: #ff9800;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background: #fff;
}

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

/* Header */
header {
    background: var(--secondary-color);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.logo-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
}

.logo-image {
    padding: 0 0 0 9.5rem;
}

.logo-image img {
    width: 75px;
}

.search-bar {
    flex: 1;
    max-width: 500px;
}

.search-bar form {
    display: flex;
    background: white;
    border-radius: 25px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    font-size: 1rem;
}

.search-bar button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.5rem;
    cursor: pointer;
    font-size: 1.2rem;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 0.8;
}

.cart-link {
    position: relative;
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Products Section */
.products-section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
}

.products-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

/* Carousel */
.products-carousel {
    position: relative;
    overflow: hidden;
}

.products-wrapper {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    padding-bottom: 1rem;
    margin-top: 1rem;
}

.products-wrapper::-webkit-scrollbar {
    height: 6px;
}

.products-wrapper::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.products-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1;
    transition: background 0.3s;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0,0,0,0.9);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.products-grid
{
    display: inline-flex;
}
/* Product Card */
.product-card {
    flex: 0 0 280px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 25%;
    margin-right: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--light-gray);
}

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

.badge-new,
.badge-deal {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    z-index: 1;
}

.badge-new {
    background: var(--success-color);
    color: white;
}

.badge-deal {
    background: var(--accent-color);
    color: white;
}

.product-info {
    padding: 1rem;
}

.product-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* Proprietà standard */
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.shipping {
    font-size: 0.875rem;
    color: #666;
}

.add-to-cart-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart-btn:hover {
    background: #b71c1c;
}

/* Features */
.features {
    padding: 4rem 0;
    background: var(--light-gray);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.7;
}

/* Product Page */
.product-page {
    padding: 2rem 0;
    min-height: 500px;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.main-image {
    position: relative;
    background: var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnails {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    overflow-x: auto;
}

.thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.thumbnails img:hover,
.thumbnails img.active {
    border-color: var(--primary-color);
}

.product-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.price-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.price-section .price {
    font-size: 2rem;
}

.description {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag {
    height: 30px;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--light-gray);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.875rem;
    transition: background 0.3s;
}

.tag:hover {
    background: var(--border-color);
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.stock-info {
    font-weight: bold;
}

.in-stock {
    color: var(--success-color);
}

.out-stock {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
        margin: -1rem 0 1rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .product-card {
        flex: 0 0 250px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}