/* 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;
 }


/* ================================================================
   Empty State — KNOWN DUPLICATE of v2 WizProductGrid/style.css
   (tracked as TD-CSS-006 in Tech-debt.md).

   This v1 widget (ProductListingModern) is frozen and slated for
   deprecation — it will be removed from the codebase once the v2
   WizProductGrid rollout completes. No dedupe/refactor work will be
   done on v1; the duplication resolves itself when this file is
   deleted. Do NOT add new rules here — make changes in
   v2/WizProductGrid/style.css only.

   The .plm-empty-state__* rules above are likewise dead (markup now
   emits .wiz-grid__empty-* classes) and are left untouched for the
   same reason.
   ================================================================ */
.wiz-grid--empty {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    padding: 40px 20px;
    grid-column: 1 / -1;
    font-family: var(--wiz-font-family, inherit);
}

.wiz-grid__empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    max-width: 480px;
    width: 100%;
}

.wiz-grid__empty-image {
    max-width: 300px;
    width: 200px;
    height: auto;
    display: block;
    margin-bottom: 4px;
}

.wiz-grid__empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
}

.wiz-grid__empty-desc {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.wiz-grid__empty-btn {
    display: inline-block;
    padding: 10px 24px;
    margin-top: 8px;
    background: var(--primary, #000);
    color: var(--primary-text, #fff);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    text-transform: capitalize;
    transition: opacity 0.15s ease;
}

/* Legacy — kept in case any cached markup still uses it */
.wiz-grid__empty-text {
    color: #6b7280;
    font-family: var(--wiz-font-family);
    font-size: 16px;
    text-align: center;
}
