/* Product Cards Section Styles */
.products-section {
    padding: 80px 0;
    background-color: var(--bg);
    /* Match site background */
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    /* For links */
    color: inherit;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
    border-color: var(--accent);
}

.product-image {
    position: relative;
    width: 100%;
    height: 160px;
    /* Fixed height for uniformity */
    overflow: hidden;
    background: #f7f9fa;
    /* Light placeholder bg */
}

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

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

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    /* RTL check: right side by default or left? */
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* RTL Specific: If dir="rtl", badges might need to be on the left or just stay right depending on design.
   Usually badges follow text direction or are pinned to corner. Let's assume standard positioning. */

.product-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: right;
    /* RTL alignment */
}

.product-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.4;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    /* Push to bottom */
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.product-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
}

.product-action {
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s;
}

.product-card:hover .product-action {
    background: var(--accent-hover, #128a72);
    /* Fallback */
}

/* Coming Soon State */
.product-card.coming-soon {
    opacity: 0.8;
    pointer-events: none;
    /* Disable click */
}

.product-card.coming-soon .product-action {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Icons */
.icon-bag {
    width: 16px;
    height: 16px;
    color: inherit;
}
/* New: Course Stats & Rating */
.product-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.rating-stars {
    color: #f1c40f; /* Star yellow */
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 700;
}

.rating-count {
    color: var(--text-muted);
    font-weight: 400;
    margin-right: 4px;
    font-size: 0.8rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr; /* Stack on mobile */
        gap: 20px;
        max-width: 360px; /* Limit width */
        margin: 40px auto 0; /* Center it */
    }

    .product-card {
        border-radius: 12px;
    }

    .product-image {
        height: 140px; /* Smaller image height */
    }

    .product-content {
        padding: 16px; /* Reduced padding */
    }

    .product-title {
        font-size: 1.05rem; /* Smaller title */
        margin-bottom: 8px;
    }

    .product-stats {
        font-size: 0.8rem;
        margin-bottom: 12px;
        gap: 10px;
    }
    
    .product-meta {
        padding-top: 15px;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .product-action {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
}
