/* Dreminex desktop product cards and ShopBuilder Quick View. Keep the
   existing phone layout unchanged; use the same cool grey card ground as the
   homepage and current design tokens. */
@media (min-width: 768px) {
  body.dreminex-product-cards:not(.home) .woocommerce ul.products li.product,
  body.dreminex-product-cards:not(.home) .rtsb-products-container li.product,
  body.dreminex-product-cards:not(.home) .rtsb-products-container .rtsb-product-wrapper,
  body.dreminex-product-cards:not(.home) .rtsb-products-container .rtsb-product-inner {
    box-sizing: border-box;
    overflow: hidden;
    padding: var(--dreminex-product-card-padding, 14px);
    border: 1px solid var(--dreminex-product-card-bg, #DEE2E6);
    border-radius: var(--dreminex-product-card-radius, 16px);
    background: var(--dreminex-product-card-bg, #DEE2E6);
  }

  /* ShopBuilder's live archive template uses rtsb-grid-item rather than the
     older rtsb-products-container wrappers. Keep its image/content panels on
     the configurable card surface so they do not remain bright white. */
  body.dreminex-product-cards:not(.home) .rtsb-elementor-container.products .rtsb-product > .rtsb-grid-item {
    box-sizing: border-box;
    overflow: hidden;
    padding: var(--dreminex-product-card-padding, 14px);
    border: 1px solid var(--dreminex-product-card-bg, #DEE2E6) !important;
    border-radius: var(--dreminex-product-card-radius, 16px);
    background: var(--dreminex-product-card-bg, #DEE2E6) !important;
  }

  body.dreminex-product-cards:not(.home) .rtsb-elementor-container.products .rtsb-product-content {
    background: var(--dreminex-product-card-bg, #DEE2E6) !important;
  }

  body.dreminex-product-cards:not(.home) .rtsb-elementor-container.products .rtsb-product figure {
    border-radius: 12px;
    background: var(--dreminex-quick-view-image-bg, #F8F9FA) !important;
  }

  body.dreminex-product-cards:not(.home) .woocommerce ul.products li.product :is(img, .woocommerce-loop-product__link img),
  body.dreminex-product-cards:not(.home) .rtsb-products-container :is(.rtsb-product-wrapper, .rtsb-product-inner) img {
    border-radius: 12px;
  }

  body.dreminex-product-cards:not(.home) .woocommerce ul.products li.product:focus-within,
  body.dreminex-product-cards:not(.home) .rtsb-products-container :is(li.product, .rtsb-product-wrapper, .rtsb-product-inner):focus-within {
    outline: 2px solid var(--dreminex-design-accent, #00B4D7);
    outline-offset: 2px;
  }

  /* ShopBuilder can render the same card markup inside product recommendations. */
  body.single-product.dreminex-product-cards .related ul.products li.product,
  body.single-product.dreminex-product-cards .up-sells ul.products li.product {
    box-sizing: border-box;
    overflow: hidden;
    padding: var(--dreminex-product-card-padding, 14px);
    border: 1px solid var(--dreminex-product-card-bg, #DEE2E6);
    border-radius: var(--dreminex-product-card-radius, 16px);
    background: var(--dreminex-product-card-bg, #DEE2E6);
  }

  body.single-product.dreminex-product-cards .elementor-widget-rtsb-product-description .woocommerce_product_description {
    background: var(--dreminex-product-card-bg, #DEE2E6);
  }

  /* Keep Bengali and Latin content readable in the two-column desktop modal.
     The modal itself scrolls, so lower controls are still reachable. */
  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal {
    box-sizing: border-box;
    width: min(var(--dreminex-quick-view-width, 1200px), calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
    max-height: calc(100vh - 48px) !important;
    max-height: calc(100dvh - 48px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    border-radius: 16px;
    background: var(--dreminex-quick-view-image-bg, #F8F9FA);
    scrollbar-width: thin;
    scrollbar-color: var(--dreminex-design-accent, #00B4D7) var(--dreminex-design-bg, #F8F9FA);
  }

  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .product {
    box-sizing: border-box;
    display: grid !important;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) !important;
    align-items: start;
    gap: var(--dreminex-quick-view-gap, 24px);
    min-width: 0;
    width: 100% !important;
    max-width: none !important;
  }

  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .product > :is(.images, .woocommerce-product-gallery, .rtwpvg-images) {
    box-sizing: border-box;
    float: none !important;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    padding: 12px;
    border-radius: 16px;
    background: var(--dreminex-quick-view-image-bg, #F8F9FA);
    grid-column: 1 !important;
    justify-self: stretch !important;
  }

  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .product :is(.rtwpvg-wrapper, .rtwpvg-container, .rtwpvg-slider-wrapper, .rtwpvg-slider, .rtwpvg-gallery-image, .rtwpvg-single-image-container, .woocommerce-product-gallery__image, .woocommerce-product-gallery__wrapper) {
    box-sizing: border-box;
    float: none !important;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
  }

  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .product :is(.rtwpvg-images, .woocommerce-product-gallery) img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 112px);
    max-height: calc(100dvh - 112px);
    object-fit: contain;
    border-radius: 12px;
  }

  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .summary {
    box-sizing: border-box;
    float: none !important;
    width: auto !important;
    min-width: 0;
    max-width: none !important;
    display: block !important;
    grid-column: 2 !important;
    justify-self: stretch !important;
    flex: 1 1 auto !important;
    padding: 20px;
  }

  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .summary-content {
    box-sizing: border-box;
    display: block !important;
    width: auto !important;
    min-width: 0;
    max-width: none !important;
    flex: 1 1 auto !important;
  }

  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .summary-content > * {
    max-width: 100%;
  }

  body.dreminex-quick-view .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .summary :is(h1, h2, p, li, table, .woocommerce-product-details__short-description) {
    max-width: 100%;
    word-break: normal;
    overflow-wrap: break-word;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.dreminex-product-cards:not(.home) .woocommerce ul.products li.product,
  body.dreminex-product-cards:not(.home) .rtsb-products-container :is(.rtsb-product-wrapper, .rtsb-product-inner) {
    scroll-behavior: auto;
  }
  body.dreminex-product-cards:not(.home) .rtsb-elementor-container.products .rtsb-product > .rtsb-grid-item {
    scroll-behavior: auto;
  }
}

/* The same controls own homepage, Shop and related cards at every width. */
body.home.dreminex-product-cards .rtsb-elementor-container.products .rtsb-product > .rtsb-grid-item {
  padding:var(--dreminex-product-card-padding,12px)!important;
  border:1px solid var(--dreminex-product-card-bg,#DEE2E6)!important;
  border-radius:var(--dreminex-product-card-radius,16px)!important;
  background:var(--dreminex-product-card-bg,#DEE2E6)!important;
}
body.home.dreminex-product-cards .rtsb-elementor-container.products .rtsb-product-content {
  background:var(--dreminex-product-card-bg,#DEE2E6)!important;
}
body.home.dreminex-product-cards .rtsb-elementor-container.products .rtsb-product figure {
  background:var(--dreminex-product-card-image-bg,#DEE2E6)!important;
}
/* ShopBuilder paints the image wrapper #F8F9FA beneath a rounded photo.
   Match the wrapper to the photo ground so its four cut corners disappear. */
body.dreminex-product-cards .rtsb-elementor-container.products .rtsb-product .rtsb-product-img {
  overflow:hidden;
  border-radius:12px;
  background:var(--dreminex-product-card-image-bg,#DEE2E6)!important;
}

/* ShopBuilder archive uses the same grid item as the homepage. Its mobile
   template previously painted the content panel white over the card ground. */
body.dreminex-product-cards:not(.home) :is(.rtsb-elementor-container.products .rtsb-product > .rtsb-grid-item, .woocommerce ul.products li.product, .related ul.products li.product, .up-sells ul.products li.product) {
  box-sizing:border-box;
  overflow:hidden;
  padding:var(--dreminex-product-card-padding,12px)!important;
  border:1px solid var(--dreminex-product-card-bg,#DEE2E6)!important;
  border-radius:var(--dreminex-product-card-radius,16px)!important;
  background:var(--dreminex-product-card-bg,#DEE2E6)!important;
}
body.dreminex-product-cards:not(.home) .rtsb-elementor-container.products .rtsb-product-content {
  background:var(--dreminex-product-card-bg,#DEE2E6)!important;
}
body.dreminex-product-cards:not(.home) .rtsb-elementor-container.products .rtsb-product figure {
  overflow:hidden;
  border-radius:12px;
  background:var(--dreminex-product-card-image-bg,#DEE2E6)!important;
}
body.dreminex-product-cards:not(.home) .rtsb-elementor-container.products .rtsb-product figure img {
  border-radius:12px;
}
body.dreminex-product-cards:not(.home) .rtsb-elementor-container.products .rtsb-product > .rtsb-grid-item:focus-within {
  outline:2px solid var(--dreminex-design-accent,#00B4D7);
  outline-offset:2px;
}

body.dreminex-discount-badges .rtsb-product .rtsb-promotion-list-item .rtsb-tag-fill {
  position:relative;
  display:inline-block;
  overflow:hidden;
  isolation:isolate;
  padding:var(--dreminex-badge-pad-y,5px) var(--dreminex-badge-pad-x,10px);
  border-radius:var(--dreminex-badge-radius,8px);
  background:var(--dreminex-badge-bg,#CAF0F8)!important;
  color:var(--dreminex-badge-text,#007D96)!important;
  font-size:var(--dreminex-badge-font-size,15px);
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
}
body.dreminex-discount-badges .rtsb-product .rtsb-product-img > .rtsb-promotion {
  top:var(--dreminex-badge-y,5px)!important;
  left:var(--dreminex-badge-x,5px)!important;
  z-index:2;
}
body.dreminex-discount-badges.dreminex-badge-shine .rtsb-product .rtsb-tag-fill::after {
  content:"";
  position:absolute;
  inset:-60% auto -60% 0;
  width:50%;
  transform:translateX(-240%) skewX(-22deg);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.7),transparent);
  pointer-events:none;
  animation:dreminex-badge-sweep var(--dreminex-badge-period,6s) ease-in-out infinite;
}
@keyframes dreminex-badge-sweep {
  0%,64%{transform:translateX(-240%) skewX(-22deg)}
  86%,100%{transform:translateX(430%) skewX(-22deg)}
}
@media(prefers-reduced-motion:reduce){
  body.dreminex-discount-badges.dreminex-badge-shine .rtsb-product .rtsb-tag-fill::after{animation:none;display:none}
}
