/* ===================
   Categories Section
=================== */

.categories {
    background-color: #ffffff;
    padding: 70px 20px;
}

.categories-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.categories-header {
    text-align: center;
    margin-bottom: 50px;
}

.categories-header h2 {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.categories-header p {
    color: #555;
    font-size: 1rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.category-card {
    background-color: #f8f8f8;
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

/* Marketplace accents */
.category-card.amazon:hover { background-color: #FF9900; color: #111; }
.category-card.ebay:hover { background-color: #e53238; color: #fff; }
.category-card.etsy:hover { background-color: #f1641e; color: #fff; }
.category-card.aliexpress:hover { background-color: #ff4747; color: #fff; }

/* ===================
   Products Container (Category Page)
=================== */
.products-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
}

/* Responsiva breakpoints för kategori-produkter */
@media (min-width: 769px) and (max-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

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

.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dölj trasiga bilder och visa snygg placeholder */
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Dölj broken image icon */
.product-image img[src=""],
.product-image img:not([src]),
.product-image img[src="undefined"] {
    visibility: hidden;
}

/* Visa placeholder-ikon om bilden inte laddas */
.product-image::before {
    content: "🛒";
    position: absolute;
    font-size: 3rem;
    opacity: 0.3;
    z-index: 0;
}


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

.trending-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(255, 71, 87, 0.4);
}

.product-info {
    padding: 12px;
}

.product-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1a1a2e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.product-category {
    display: none; /* Dölj kategori för att undvika dubbla namn */
}

.product-price .price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .categories {
        padding: 40px 15px;
    }
    
    .categories-header {
        margin-bottom: 30px;
    }
    
    .categories-header h2 {
        font-size: 1.8rem;
    }
    
    .categories-header p {
        font-size: 0.9rem;
    }
    
    /* 3 kategorier per rad på mobil */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px;
    }
    
    .category-card {
        padding: 20px 10px;
        font-size: 0.75rem;
        border-radius: 10px;
    }
    
    /* Mindre ikoner i kategorierna */
    .category-card i,
    .category-card svg {
        font-size: 1.5rem !important;
        margin-bottom: 5px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-title {
        font-size: 0.95rem;
    }
    
    .product-price .price {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card {
        border-radius: 10px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 0.8rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }
    
    .product-price .price {
        font-size: 1rem;
    }
}
