/**
 * Products Section Styles
 *
 * @package Strongbody_Theme
 */

/* Products Section Base Styles */
.products-section {
    padding: 80px 0;
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.product-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 420px;
    max-height: 550px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-green);
}

.product-image {
    height: 200px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.product-thumbnail,
.product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.placeholder-icon {
    font-size: 48px;
    color: white;
    opacity: 0.8;
}

.price-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(40, 167, 69, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 193, 7, 0.95);
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.product-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    flex-shrink: 0;
    min-height: 28px;
}

.meta-category {
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-rating,
.product-brand {
    background: #f8f9fa;
    color: #333;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    height: 50px; /* Fixed height for 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.product-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: var(--accent-green);
}

.product-excerpt {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
}

.product-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
    min-height: 24px;
}

.product-stats span {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.product-supplier {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    flex-shrink: 0;
}

.supplier-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}

.supplier-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.supplier-role {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Products CTA Styles */
.products-cta {
    text-align: center;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.3);
}

.cta-arrow {
    transition: transform 0.3s ease;
}

.cta-button:hover .cta-arrow {
    transform: translateX(5px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-section {
        padding: 60px 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card {
        min-height: 400px;
        max-height: 420px;
    }

    .product-card-body {
        padding: 16px;
    }

    .product-title {
        font-size: 1.1rem;
        height: 45px;
        -webkit-line-clamp: 2;
    }

    .product-excerpt {
        min-height: 35px;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .products-section {
        padding: 40px 0;
    }

    .product-image {
        height: 150px;
    }

    .product-card {
        min-height: 380px;
        max-height: 400px;
    }

    .product-meta {
        justify-content: center;
    }

    .product-stats {
        justify-content: center;
    }

    .product-title {
        height: 40px;
        font-size: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .products-section {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    .product-card {
        background: var(--bg-primary);
        border-color: var(--border-color-dark);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .product-card:hover {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    }

    .product-title a {
        color: var(--text-primary);
    }

    .product-title a:hover {
        color: var(--accent-green);
    }

    .product-excerpt {
        color: var(--text-muted);
    }

    .product-stats {
        color: var(--text-muted);
    }

    .product-supplier {
        border-top-color: var(--border-color-dark);
    }

    .supplier-name {
        color: var(--text-primary);
    }

    .supplier-role {
        color: var(--text-muted);
    }

    .product-stats span {
        background: var(--bg-primary);
        color: var(--text-muted);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .product-card {
        border-width: 2px;
        border-color: var(--text-primary);
    }

    .meta-category {
        border: 2px solid var(--text-primary);
    }

    .price-badge {
        border: 2px solid var(--accent-green);
    }

    .featured-badge {
        border: 2px solid var(--secondary-color);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-thumbnail img,
    .cta-button,
    .cta-arrow {
        transition: none;
    }

    .product-card:hover {
        transform: none;
    }

    .product-card:hover .product-thumbnail img {
        transform: none;
    }
}
