/**
 * Related Products Premium Section
 * Version: 1.0.0
 * Premium Upselling & Cross-Selling Design
 */

/* Related Products Container */
.silvforlife-related-products {
    margin: 80px 0 120px;
    padding: 0 20px;
}

.related-products-inner {
    max-width: 1400px;
    margin: 0 auto;
}

/* Section Header */
.related-header {
    text-align: center;
    margin-bottom: 60px;
}

.related-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin: 0 0 16px;
    background: linear-gradient(135deg, #1e1e1e 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.related-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
}

/* Products Grid */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}

/* Product Card */
.related-product-card {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.related-product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 24px 48px -12px rgba(59, 130, 246, 0.2),
                0 12px 24px -6px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.1);
}

/* Image Container */
.related-product-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 aspect ratio */
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    overflow: hidden;
}

.related-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Quick View Badge */
.related-quick-view {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    z-index: 2;
}

.related-product-card:hover .related-quick-view {
    opacity: 1;
    transform: scale(1);
}

.related-quick-view:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    transform: scale(1.1) rotate(90deg);
}

.related-quick-view svg {
    width: 20px;
    height: 20px;
    stroke: #1f2937;
    transition: stroke 0.3s ease;
}

.related-quick-view:hover svg {
    stroke: #ffffff;
}

/* Sale Badge */
.related-sale-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    z-index: 2;
}

/* Product Info */
.related-product-info {
    padding: 24px;
}

.related-product-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.related-product-card:hover .related-product-title {
    color: #3b82f6;
}

/* Rating */
.related-product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.related-rating-stars {
    display: flex;
    gap: 2px;
}

.related-rating-stars svg {
    width: 14px;
    height: 14px;
}

.related-rating-count {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Price */
.related-product-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.related-price-current {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.related-price-original {
    font-size: 1.125rem;
    color: #9ca3af;
    text-decoration: line-through;
}

/* Add to Cart Button */
.related-add-to-cart {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.related-add-to-cart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.related-add-to-cart:hover::before {
    width: 300px;
    height: 300px;
}

.related-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.related-add-to-cart:active {
    transform: translateY(0);
}

.related-add-to-cart span {
    position: relative;
    z-index: 1;
}

/* View All Button */
.related-view-all {
    text-align: center;
    margin-top: 48px;
}

.related-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: #ffffff;
    color: #1f2937;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.related-view-all-btn:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2);
}

.related-view-all-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.related-view-all-btn:hover svg {
    transform: translateX(4px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .related-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .silvforlife-related-products {
        margin: 60px 0 80px;
    }
    
    .related-header {
        margin-bottom: 40px;
    }
    
    .related-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .related-product-info {
        padding: 16px;
    }
    
    .related-product-title {
        font-size: 1rem;
    }
    
    .related-price-current {
        font-size: 1.25rem;
    }
    
    .related-add-to-cart {
        padding: 12px 20px;
        font-size: 0.875rem;
    }
    
    .related-quick-view {
        width: 40px;
        height: 40px;
    }
    
    .related-quick-view svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .related-products-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .related-title {
        font-size: 1.75rem;
    }
    
    .related-subtitle {
        font-size: 1rem;
    }
}

/* Loading State */
.related-product-card.loading {
    pointer-events: none;
}

.related-product-card.loading .related-product-image {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Added to Cart State */
.related-add-to-cart.added {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    pointer-events: none;
}

.related-add-to-cart.added::after {
    content: '✓ Hinzugefügt';
}

.related-add-to-cart.added span {
    display: none;
}
