/* =========================================
   PQ SHOP LAYOUT SYSTEM (CONTAINED)
   Inner-scroll results panel + optional sticky filters

   Targets:
   - WooCommerce Shop (product archive)
   - Product tax archives (optional)

   Requires Elementor structure:
   - Root wrapper:       .pq-shop-root
   - Filters container:  .pq-shop-filters (optional)
   - Results wrapper:    .pq-results-panel
   - Loop Grid wrapper:  .pq-loop-grid
   ========================================= */

/* ---- Tuning variables ----------------------------------------------------- */
body.woocommerce-shop,
body.post-type-archive-product{
  /* Adjust this to match sticky header + filters height. */
  --pq-shop-offset: 220px;

  /* If you have a sticky site header, set this to that header height. */
  --pq-shop-sticky-top: 0px;

  /* Optional spacing between filters + grid when both live inside panel */
  --pq-shop-panel-gap: 0px;
}

/* ---- Sticky filters (optional) ------------------------------------------- */
body.woocommerce-shop .pq-shop-filters,
body.post-type-archive-product .pq-shop-filters{
  position: sticky;
  top: var(--pq-shop-sticky-top);
  z-index: 50;
}

/* ---- Root container constraints (IMPORTANT) -------------------------------
   Elementor containers often create flex contexts that prevent inner overflow
   scrolling unless parents have `min-height: 0`.
   Add `.pq-shop-root` to the OUTERMOST container that wraps filters + results.
*/
body.woocommerce-shop .pq-shop-root,
body.post-type-archive-product .pq-shop-root{
  height: 100%;
  min-height: 0;
}

/* Ensure intermediate Elementor containers inside the root do not block scroll */
body.woocommerce-shop .pq-shop-root .e-con,
body.post-type-archive-product .pq-shop-root .e-con,
body.woocommerce-shop .pq-shop-root .e-con-inner,
body.post-type-archive-product .pq-shop-root .e-con-inner{
  min-height: 0;
}

/* ---- Results inner scroll container -------------------------------------- */
body.woocommerce-shop .pq-results-panel,
body.post-type-archive-product .pq-results-panel{
  /* IMPORTANT: must be a definite height for overflow scrolling to engage */
  height: calc(100dvh - var(--pq-shop-offset));

  /* Make panel a column flex container so children stack cleanly */
  display: flex;
  flex-direction: column;
  gap: var(--pq-shop-panel-gap);

  overflow-y: auto;
  overflow-x: hidden;

  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;

  position: relative;

  /* Helps prevent odd paint/layout "escape" issues in some browsers */
  contain: none;

  /* Critical when parent containers are flex/grid */
  min-height: 0;

  /* Prevent overscroll chaining to the body */
  overscroll-behavior: contain;
}

/* If filters + grid live inside the scroll panel, make the grid section flexible */
body.woocommerce-shop .pq-results-panel .pq-loop-grid,
body.post-type-archive-product .pq-results-panel .pq-loop-grid{
  flex: 1 1 auto;
  min-height: 0;
}

/* If filters are inside the scroll panel, they should not stretch */
body.woocommerce-shop .pq-results-panel .pq-shop-filters,
body.post-type-archive-product .pq-results-panel .pq-shop-filters{
  flex: 0 0 auto;
}

/* Elementor containers sometimes need min-height:0 for scroll clipping */
body.woocommerce-shop .pq-results-panel .e-con,
body.post-type-archive-product .pq-results-panel .e-con,
body.woocommerce-shop .pq-results-panel .e-con-inner,
body.post-type-archive-product .pq-results-panel .e-con-inner{
  min-height: 0;
}

/* Keep Loop Grid from forcing height/overflow weirdness */
body.woocommerce-shop .pq-results-panel .elementor-widget-container,
body.post-type-archive-product .pq-results-panel .elementor-widget-container{
  height: auto;
}

/* ---- Optional: product tax archives too ----------------------------------
   If your shop template is used on category/tag archives, uncomment this.
*/
/*
body.tax-product_cat .pq-results-panel,
body.tax-product_tag .pq-results-panel{
  height: calc(100dvh - var(--pq-shop-offset));
  display: flex;
  flex-direction: column;
  gap: var(--pq-shop-panel-gap);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  position: relative;
  contain: layout paint;
  min-height: 0;
  overscroll-behavior: contain;
}

body.tax-product_cat .pq-results-panel .pq-loop-grid,
body.tax-product_tag .pq-results-panel .pq-loop-grid{
  flex: 1 1 auto;
  min-height: 0;
}
*/


/* =========================================================
   PQ SHOP — JetPagination inside inner scroll panel
   ========================================================= */

.pq-results-panel .pq-jet-pagination {
  position: static !important;
  display: flex;
  justify-content: center;

  margin-top: 18px;
  margin-bottom: 8px;

  z-index: 1;
}

/* Make sure Jet's internal wrapper doesn't float */
.pq-results-panel .pq-jet-pagination .jet-pagination,
.pq-results-panel .pq-jet-pagination .jet-pagination__navigation {
  position: static !important;
  transform: none !important;
}

/* Prevent overlap caused by widget container behavior */
.pq-results-panel .pq-jet-pagination .elementor-widget-container {
  overflow: visible !important;
}

/* Ensure grid has space for pagination */
.pq-results-panel .pq-loop-grid{
  padding-bottom: 0;
}

/* =========================================================
   PQ PORTAL SHELL — Viewport-locked SaaS layout primitives
   Use these classes on ALL portal pages (Canvas template)

   Required structure:
   .pq-portal-shell
     .pq-portal-sidebar
     .pq-portal-main
       .pq-portal-topbar (optional)
       .pq-results-panel (scroll stage)
   ========================================================= */

/* Root sizing */
html,
body{
  height: 100%;
  margin: 0;
}

/* The shell becomes the "app viewport" */
.pq-portal-shell{
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: flex;
  width: 100%;
  overflow: hidden;      /* contain scrolling to inner panels */
}

/* Sidebar (fixed column) */
.pq-portal-shell .pq-portal-sidebar{
  flex: 0 0 auto;
  height: 100%;
  min-height: 0;
}

/* Main workspace (flex column) */
.pq-portal-shell .pq-portal-main{
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;         /* CRITICAL for inner scroll panels */
  display: flex;
  flex-direction: column;
  overflow: hidden;      /* prevent double scroll */
}

/* Optional topbar lives above the stage */
.pq-portal-shell .pq-portal-topbar{
  flex: 0 0 auto;
}

/* Stage panel grows and scrolls (portal mode = flex driven, NOT vh math) */
.pq-portal-shell .pq-results-panel{
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Elementor flex containers sometimes block shrinking unless min-height is reset */
.pq-portal-shell .e-con,
.pq-portal-shell .e-con-inner,
.pq-portal-shell .elementor-widget-container{
  min-height: 0;
}

/* =========================================================
   PORTAL MODE OVERRIDE (CRITICAL)
   If a portal page ALSO has Woo shop/archive body classes,
   the earlier shop rule:
     body.woocommerce-shop .pq-results-panel { height: ... !important; }
   will win unless we override with equal/higher specificity.
   ========================================================= */

body.woocommerce-shop .pq-portal-shell .pq-results-panel,
body.post-type-archive-product .pq-portal-shell .pq-results-panel{
  /* stage wrapper */
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;

  /* IMPORTANT: do not scroll the whole stage */
  overflow: hidden !important;
  contain: none !important;
}

body.woocommerce-shop .pq-portal-shell .pq-results-panel .pq-filterbar,
body.post-type-archive-product .pq-portal-shell .pq-results-panel .pq-filterbar{
  flex: 0 0 auto !important;
  min-height: 0 !important;
}

body.woocommerce-shop .pq-portal-shell .pq-results-panel .pq-loop-grid,
body.post-type-archive-product .pq-portal-shell .pq-results-panel .pq-loop-grid{
  flex: 1 1 auto !important;
  min-height: 0 !important;

  /* THE scroll surface */
  overflow-y: auto !important;
  overflow-x: hidden !important;

  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* =========================================================
   PQ MINI CART (PORTAL SIDEBAR)
   - bg #383838, radius 10px
   - white type
   - name + price 14px
   - inner scroll (thin scrollbar, scoped)
   - remove + footer buttons: darker grey pills + hover lift
   - FIX: prevent ajax wrappers from dimming the widget
   ========================================================= */

/* ---------------------------------------------------------
   1) STYLE
   --------------------------------------------------------- */

.pq-mini-cart{
  background: #383838;
  border-radius: 10px;
  padding: 12px;
  color: #ffffff;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pq-mini-cart,
.pq-mini-cart *{
  color: inherit;
  box-sizing: border-box;
}

/* Header */
.pq-mini-cart__header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pq-mini-cart__title{
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.pq-mini-cart__meta{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 13px;
  line-height: 1.1;
  opacity: 0.95;
}

.pq-mini-cart__count{ font-weight: 700; }
.pq-mini-cart__total{ font-weight: 800; }

/* Inner scroll list */
.pq-mini-cart__items{
  max-height: 420px;          /* default cap; sidebar overrides this to none */
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-right: 6px;

  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;

  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}

/* Chrome / Safari scrollbar — scoped only to mini cart */
.pq-mini-cart__items::-webkit-scrollbar{ width: 6px; }
.pq-mini-cart__items::-webkit-scrollbar-track{ background: transparent; }
.pq-mini-cart__items::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.25);
  border-radius: 10px;
}
.pq-mini-cart__items::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.40);
}

.pq-mini-cart__empty{
  font-size: 13px;
  padding: 6px 0;
  opacity: 0.85;
}

/* Rows: 3 columns (left | price | remove) */
.pq-mini-cart__row{
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.pq-mini-cart__left{
  flex: 1 1 auto;
  min-width: 0;
}

.pq-mini-cart__name{
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.pq-mini-cart__qty{
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

/* Price column */
.pq-mini-cart__right{
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0.98;
}

/* Remove button column */
.pq-mini-cart__remove{
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #2f2f2f;
  border: 1px solid rgba(255,255,255,0.12);

  font-size: 16px;
  line-height: 1;
  text-decoration: none;

  opacity: 0.92;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}

.pq-mini-cart__remove:hover{
  opacity: 1;
  transform: translateY(-1px);
  background: #262626;
  border-color: rgba(255,255,255,0.18);
}

.pq-mini-cart__remove:active{
  transform: translateY(0);
}

/* Footer buttons */
.pq-mini-cart__footer{
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.pq-mini-cart__btn{
  flex: 1 1 0;
  text-align: center;

  background: #2f2f2f;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;

  padding: 10px 12px;

  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;

  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.pq-mini-cart__btn:hover{
  transform: translateY(-1px);
  background: #262626;
  border-color: rgba(255,255,255,0.18);
}

.pq-mini-cart__btn:active{
  transform: translateY(0);
}


/* ---------------------------------------------------------
   2) FIX: STOP PARENT “DIM ON LOAD” (opacity can’t be overridden by children)
   We target common Elementor/Woo/Jet ajax wrappers and force them back to 1
   ONLY when they contain .pq-mini-cart.
   --------------------------------------------------------- */

/* Elementor / general “loading” wrappers sometimes dim children */
.elementor-loading:has(.pq-mini-cart),
.e-loading:has(.pq-mini-cart),
.is-loading:has(.pq-mini-cart),
.loading:has(.pq-mini-cart){
  opacity: 1 !important;
  filter: none !important;
}

/* Jet / Woo ajax loading wrappers (common class patterns) */
.jet-filters-loading:has(.pq-mini-cart),
.jet-smart-filters-loading:has(.pq-mini-cart),
.jet-ajax-loading:has(.pq-mini-cart),
.woocommerce-loading:has(.pq-mini-cart),
.blockUI:has(.pq-mini-cart){
  opacity: 1 !important;
  filter: none !important;
}

/* If the sidebar/container itself is being dimmed, un-dim it when it contains the cart */
.pq-portal-sidebar:has(.pq-mini-cart),
.pq-portal-shell:has(.pq-mini-cart){
  opacity: 1 !important;
  filter: none !important;
}

/* Safety: remove “disabled” visual treatments that sometimes apply with opacity */
.pq-mini-cart{
  pointer-events: auto !important;
}

/* Force full visibility inside portal sidebar */
.pq-mini-cart,
.pq-mini-cart *,
.pq-mini-cart__btn,
.pq-mini-cart__remove{
  opacity: 1 !important;
}

/* Force white text explicitly */
.pq-mini-cart{
  color: #ffffff !important;
}

/* Ensure buttons render with proper fill */
.pq-mini-cart__btn{
  background: #2f2f2f !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: #ffffff !important;
}

.pq-mini-cart__btn:hover{
  background: #262626 !important;
}

/* Ensure remove button visible */
.pq-mini-cart__remove{
  background: #2f2f2f !important;
  color: #ffffff !important;
}

/* =========================================================
   PQ MINI CART — Stable reveal (max-height)
   Add `.pq-mini-cart-wrap` to the Elementor container that
   wraps the mini cart shortcode/widget.

   Why:
   - Woo/Flourish often re-renders the cart markup via AJAX.
   - The previous `grid-template-rows: 0fr -> 1fr` technique can
     leave the cart “squished” if the DOM swaps mid-transition.
   - This approach stays robust during markup replacement.
   ========================================================= */

/* NOTE: Elementor outputs BOTH a container and the shortcode widget.
   They were both using `.pq-mini-cart-wrap`, which caused height/overflow
   rules to apply twice. Scope transitions to the *container* only. */

/* Container (Elementor container / e-con) */
.pq-mini-cart-wrap.elementor-element{
  position: relative;
  overflow: hidden;
  min-height: 0;

  /* default open */
  max-height: 2000px;

  transition: max-height 420ms cubic-bezier(.2,.8,.2,1);
}

/* The shortcode widget inside should NOT be max-height/overflow clipped */
.pq-mini-cart-wrap.elementor-widget{
  max-height: none !important;
  overflow: visible !important;
  min-height: 0 !important;
}

/* Collapse ONLY when the cart is empty */
.pq-mini-cart-wrap.elementor-element:has(.pq-mini-cart__empty){
  max-height: 0;
}

/* Animate the cart itself (works regardless of AJAX wrapper structure) */
.pq-mini-cart-wrap.elementor-element .pq-mini-cart{
  min-height: 0;

  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top center;

  will-change: transform, opacity;

  transition:
    opacity 180ms ease,
    transform 420ms cubic-bezier(.2,.8,.2,1);
}

/* Hidden state visuals + click protection */
.pq-mini-cart-wrap.elementor-element:has(.pq-mini-cart__empty) .pq-mini-cart{
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  pointer-events: none;
}

.pq-product-card{
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.pq-product-card:hover{
  transform: translateY(-2px);
}



/* =========================================================
   PQ FILTERBAR — In-bar expanding filters (NO inner scroll)
   - Drawer stays IN FLOW under the top row
   - .pq-results-panel remains the ONLY scroll surface
   - Smooth open/close (no display:none jank)
   ========================================================= */

/* Nothing should clip the expanding drawer */
.pq-filterbar,
.pq-filterbar .e-con,
.pq-filterbar .e-con-inner,
.pq-filterbar .elementor-widget-container{
  overflow: visible !important;
}

/* Force the filterbar container into a simple column flow */
.pq-filterbar.elementor-element.e-con,
.pq-filterbar.elementor-element.e-con.e-flex{
  --height: auto !important;
  --min-height: 0 !important;

  height: auto !important;
  min-height: 0 !important;

  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;

  overflow: visible !important;
}

.pq-filterbar > .e-con-inner{
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Drawer: collapsed by max-height (animatable), not display:none */
.pq-filter-drawer{
  width: 100% !important;
  align-self: stretch !important;
  box-sizing: border-box !important;

  max-height: 0 !important;
  overflow: hidden !important;

  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;

  will-change: max-height, opacity, transform;

  transition:
    /* CLOSE sequencing: fade/translate first, then collapse height */
    max-height 520ms cubic-bezier(.2,.8,.2,1) 180ms,
    opacity 180ms ease 0ms,
    transform 180ms cubic-bezier(.2,.8,.2,1) 0ms;
}

/* If Elementor padded the drawer container, remove padding while closed */
body:not(.pq-filters-open) .pq-filter-drawer{
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* OPEN */
body.pq-filters-open .pq-filter-drawer{
  max-height: 2200px !important;   /* safe ceiling */

  /* keep clipped even when open (prevents lingering inner frames) */
  overflow: hidden !important;

  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;

  transition:
    /* OPEN sequencing: expand immediately */
    max-height 580ms cubic-bezier(.2,.8,.2,1) 0ms,
    opacity 180ms ease 40ms,
    transform 580ms cubic-bezier(.2,.8,.2,1) 0ms;
}

/* Keep inner widget content natural; do NOT blanket-force overflow on all descendants */
body.pq-filters-open .pq-filter-drawer .e-con,
body.pq-filters-open .pq-filter-drawer .e-con-inner,
body.pq-filters-open .pq-filter-drawer .elementor-widget-container{
  overflow: visible !important;
}



/* =========================================================
   PORTAL SHELL: filters expand, grid shrinks + remains scrollable
   - Filterbar takes natural height
   - Grid gets remaining height and scrolls
   ========================================================= */

body.woocommerce-shop .pq-portal-shell .pq-results-panel,
body.post-type-archive-product .pq-portal-shell .pq-results-panel{
  /* results panel is the stage wrapper */
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;

  /* IMPORTANT: don't make the whole stage scroll */
  overflow: hidden !important;

  /* (optional) kill contain if it causes weird clipping in your browser */
  contain: none !important;
}

/* Your filterbar sits above the grid and can grow */
body.woocommerce-shop .pq-portal-shell .pq-results-panel .pq-filterbar,
body.post-type-archive-product .pq-portal-shell .pq-results-panel .pq-filterbar{
  flex: 0 0 auto !important;
  min-height: 0 !important;
}

/* The loop grid wrapper becomes the scroll region and shrinks when filters open */
body.woocommerce-shop .pq-portal-shell .pq-results-panel .pq-loop-grid,
body.post-type-archive-product .pq-portal-shell .pq-results-panel .pq-loop-grid{
  flex: 1 1 auto !important;
  min-height: 0 !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}



/* =========================================================
   POLISH — Contained scroll + inertial feel
   - Prevent scroll chaining / rubber-band bleed
   - Add inertial scroll where supported
   ========================================================= */

/* 1) Prevent scroll chaining (trackpad "fling" doesn't move the page) */
.pq-portal-shell,
.pq-portal-sidebar,
.pq-portal-main,
.pq-results-panel,
.pq-loop-grid,
.pq-sidebar-content,
.pq-mini-cart__items{
  overscroll-behavior: contain;
}

/* 2) Inertial scroll polish (mainly iOS Safari; harmless elsewhere) */
.pq-loop-grid,
.pq-sidebar-content,
.pq-mini-cart__items{
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
}


/* =========================================================
   PQ LOOP GRID — Scroll padding only (no shadows)
   Scroll surface (per DOM): <div id="loop" class="pq-loop-grid" ...>
   ========================================================= */

body.woocommerce-shop .pq-portal-shell .pq-results-panel #loop.pq-loop-grid,
body.post-type-archive-product .pq-portal-shell .pq-results-panel #loop.pq-loop-grid,
body.woocommerce-shop .pq-portal-shell .pq-results-panel .pq-loop-grid#loop,
body.post-type-archive-product .pq-portal-shell .pq-results-panel .pq-loop-grid#loop{
  /* User requested gap between scrollbar + cards */
  padding: 12px 9px 24px 0 !important;
}





/* =========================================================
   PQ SIDEBAR — Pinned profile card + NO overlap

   Current DOM (per your inspector):
     .pq-portal-sidebar
       .pq-profile-card
       .pq-sidebar-content (contains logo/nav + mini-cart)

   Goals:
   - Sidebar is a fixed-height flex column (portal shell owns the viewport)
   - `.pq-sidebar-content` scrolls (so logo/nav/cart never overlap)
   - Profile card stays pinned to bottom (not inside the scroll area)
   - Do NOT stomp Elementor padding on the profile card
   ========================================================= */

/* Sidebar container: fixed-height column */
.pq-portal-shell .pq-portal-sidebar{
  display: flex !important;
  flex-direction: column !important;

  height: 100% !important;
  min-height: 0 !important;

  /* keep scrolling inside the sidebar-content only */
  overflow: hidden !important;
}

/* Elementor inner wrapper must also be a full-height flex column */
.pq-portal-shell .pq-portal-sidebar > .e-con-inner{
  display: flex !important;
  flex-direction: column !important;

  height: 100% !important;
  min-height: 0 !important;

  /* IMPORTANT: preserve Elementor padding */
  box-sizing: border-box;
}

/* Scroll area: logo/nav/cart live here */
.pq-portal-shell .pq-portal-sidebar .pq-sidebar-content{
  /* if profile card is earlier in DOM, this ensures scroll area stays above it */
  order: 1 !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 16px;

  flex: 1 1 auto !important;
  min-height: 0 !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  background-clip: padding-box;

  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;

  /* breathing room above the pinned profile card */
  padding-bottom: 16px;
}

/* Ensure common sidebar blocks don’t flex-shrink into each other */
.pq-portal-shell .pq-portal-sidebar .pq-sidebar-content > *{
  flex: 0 0 auto;
  min-height: 0;
}

/* Profile card: pinned to bottom */
.pq-portal-shell .pq-portal-sidebar .pq-profile-card{
  order: 2 !important;

  flex: 0 0 auto !important;
  margin-top: auto !important;

  /* do NOT force width/padding; let Elementor handle it */
  overflow: visible;
}

/* Mini cart wrapper: let it participate as a normal block inside scroll area */
.pq-portal-shell .pq-portal-sidebar .pq-mini-cart-wrap.elementor-element{
  flex: 0 0 auto !important;
  max-height: none !important;
}

/* Make ONLY the cart item list scroll if it gets tall */
.pq-portal-shell .pq-portal-sidebar .pq-mini-cart{
  max-height: clamp(220px, 38vh, 420px);
  min-height: 0;
  overflow: hidden;
}

.pq-portal-shell .pq-portal-sidebar .pq-mini-cart__items{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
