/* ========================================
   PACKAGE GRID & BADGES
   ======================================== */

/* Grid Layout */
.products-page-wrapper .packages-grid,
.products-page-wrapper .product-grid,
.related-products-container .products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: auto !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: stretch !important;
}

/* Fix for Bundle Card Alignment on Packages List Page */
/* Mirrors the working rules from welcome.css .packages-products-grid */
.product-card h5 {
    margin-top: 10px;
    margin-bottom: 8px;
    line-height: 1.4;
    min-height: 3.1em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-page-wrapper .product-grid .product-card .d-flex.flex-wrap.gap-1.mb-2 {
    min-height: 48px;
    margin-bottom: 12px !important;
    align-items: center;
}

.products-page-wrapper .product-grid .product-card .product-content p.price {
    margin-top: auto !important;
    margin-bottom: 15px !important;
}

/* Cancel Bootstrap mt-auto on button — price already handles the push */
.products-page-wrapper .product-grid .product-card .product-actions.mt-auto {
    margin-top: 0 !important;
}

@media (max-width: 1024px) {
    .products-page-wrapper .product-grid,
    .related-products-container .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 767px) {
    .products-page-wrapper .product-grid,
    .related-products-container .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* RTL Support */
[dir="rtl"] .badge-bundle,
[dir="rtl"] .badge-sale {
    right: auto;
    left: 15px;
}

[dir="rtl"] .badge-featured,
.product-card[dir="rtl"] .badge-featured {
    left: auto !important;
    right: 10px !important;
}

.product-card[dir="rtl"] .badge-sale {
    right: auto !important;
    left: 10px !important;
}
