/* ProductListingModern container, pagination & empty-state styles.
 * Extracted from ProductListingModernWidget::render_styles_product_listing_modern().
 * Dynamic parts (wiz_get_similar_drawer_css) remain inline in that method.
 * Enqueued via render_product_listing_modern_css() / wiz_enqueue_product_card_styles(). */

 .product-listing-modern-container {
    position: relative;
    display: grid;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
} /* display comes from Elementor total_product_count_display; avoid base display:flex so WRAPPER rule wins without !important */
 .product-listing-modern-total-count-container {
     font-size: 14px;
     color: #333;
     width: 100%;
     font-weight: 500;
 }

 .product-listing-modern-total-count-container-text {
     display: flex;
     justify-content: flex-start;
 }

 /* Pagination styles */
 .product-pagination {
     display: flex;
     flex-wrap: nowrap;
     width: 100%;
     justify-content: center;
     align-items: center;
     gap: 4px;
 }

 .pagination-desktop {
     display: flex;
     flex-wrap: nowrap;
     align-items: center;
     gap: 15px;
 }

 .pagination-mobile {
     display: none;
     flex-wrap: nowrap;
     align-items: center;
     gap: 2px;
 }

 .pagination-item {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     text-decoration: none;
     transition: all 0.2s ease;
     flex-shrink: 0;
     white-space: nowrap;
     color: #000;
 }

 .pagination-active {
     pointer-events: none;
 }

 .pagination-ellipsis {
     padding: 0 5px;
     flex-shrink: 0;
     white-space: nowrap;
 }

 .pagination-prev,
 .pagination-next {
     padding: 0 15px;
 }

 .product-listing-container {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: flex-start;
     gap: 20px;
     min-height: 80vh;
 }

 /* Mobile responsive - show simplified pagination */
 @media (max-width: 767px) {
     .product-pagination {
         gap: 2px;
         padding: 0 4px;
     }

     .pagination-desktop {
         display: none;
     }

     .pagination-mobile {
         display: flex;
         gap: 2px;
         width: 100%;
         justify-content: center;
         flex-wrap: nowrap;
     }

     .pagination-item {
         min-width: 32px;
         height: 32px;
         font-size: 14px;
         padding: 0 6px;
     }

     .pagination-first,
     .pagination-last,
     .pagination-prev,
     .pagination-next {
         padding: 0 6px;
         min-width: 32px;
     }
 }

 /* Tablet responsive */
 @media (min-width: 768px) and (max-width: 1024px) {
     .product-pagination {
         gap: 3px;
     }

     .pagination-item {
         min-width: 36px;
         height: 36px;
         font-size: 15px;
     }
 }

 .dummy-product-listing-modern-container {
     height: 0;
     width: 0;
     position: absolute;
 }

 .dummy-product-listing-modern-container .product-listing-card-wrapper,
 .dummy-product-listing-modern-container .product-listing-card,
 .dummy-product-listing-modern-container .product-stack-layer,
 .dummy-product-listing-modern-container .product-listing-card {
     border: none !important;
 }

 /* Removed-but-kept-in-DOM state: the first product card hosts the
   teleported quick-view modal, so on removal we hide it (zero-size,
   invisible) instead of detaching it — mirroring the dummy container.

   FUTURE-PROOFING: this class marks a card as gone. Today a wishlist
   add requires a full page reload, so removed cards are never
   re-shown client-side. If a future flow re-injects or re-displays a
   previously-removed card without a reload, it MUST strip
   .product-listing-card-removed first (e.g. .removeClass(...)),
   otherwise the re-added card inherits this hidden/zero-size state and
   silently disappears. See PRESENT_CARDS handling in
   ProductListingModernJs.js. */
 .product-listing-card-wrapper.product-listing-card-removed {
     height: 0;
     width: 0;
     position: absolute;
     overflow: visible;
     visibility: hidden;
     pointer-events: none;
 }

 .product-listing-card-wrapper.product-listing-card-removed .product-listing-card,
 .product-listing-card-wrapper.product-listing-card-removed .product-stack-layer {
     border: none !important;
     visibility: hidden;
     position: absolute;
 }

 .infinite-scroll-sentinel {
     height: 1px;
     width: 100%;
 }

 .is-loading-placeholder {
     pointer-events: none;
 }

 /* Empty state — overridable via CSS variables */
 .plm-empty-state {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     gap: var(--wiz-plm-empty-gap, 15px);
 }

 .plm-empty-state .plm-empty-state__img {
     max-width: var(--wiz-plm-empty-img-max-width, 300px);
     width: 100%;
 }

 .plm-empty-state__title {
     font-size: var(--wiz-plm-empty-title-font-size, 18px);
     font-weight: bold;
     text-align: center;
 }

 .plm-empty-state__description {
     font-size: var(--wiz-plm-empty-desc-font-size, 16px);
 }

 .plm-empty-state .plm-empty-state__button {
     font-weight: 600;
     padding: var(--wiz-plm-empty-btn-padding, 10px 24px);
     background: var(--wiz-plm-empty-btn-background, var(--primary));
     color: var(--wiz-plm-empty-btn-color, #fff);
     text-decoration: none;
     text-transform: capitalize;
 }