.ddhq-panel-open { overflow: hidden; }
.ddhq-panel { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; }
.ddhq-panel[aria-hidden="true"]{ display:none; }
.ddhq-panel__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.ddhq-panel__dialog{ position:relative; width:min(960px,95vw); max-height:90vh; overflow:auto; background:#fff; border-radius:var(--ddhq-radius,16px); box-shadow:0 30px 80px rgba(0,0,0,.25); padding:24px; }
.ddhq-panel__close{ position:absolute; right:12px; top:8px; border:0; background:transparent; font-size:28px; line-height:1; cursor:pointer; }
.ddhq-panel__head{text-align:center; margin-bottom:12px;}
.ddhq-panel__check{ width:48px; height:48px; border-radius:999px; margin:0 auto 8px; display:grid; place-items:center; background:#e8f7ed; color:#1e824c; font-weight:700; }
.ddhq-panel__h1{ font-size:20px; font-weight:700; }
.ddhq-panel__subtitle{ margin-top:6px; font-size:14px; color:#666; display:grid; grid-auto-flow:column; gap:10px; justify-content:center; align-items:center; }
.ddhq-panel__subtitle img{ width:40px; height:40px; border-radius:6px; object-fit:cover; }
.ddhq-name{ font-weight:600; }
.ddhq-panel__actions{ display:grid; grid-auto-flow:column; gap:12px; justify-content:center; margin:16px 0 6px; }
.ddhq-btn{ padding:10px 16px; border-radius:10px; text-decoration:none; font-weight:600; border:1px solid #c7c7c7; }
.ddhq-btn.js-ddhq-primary{ background:var(--mf-primary-color,#f4609c); color:#fff; border-color:var(--mf-primary-color,#f4609c); }
.ddhq-btn--ghost{ background:#fff; color:#333; }
.ddhq-panel__sections{ padding:10px 4px 6px; }
.ddhq-sec + .ddhq-sec{ margin-top:16px; }
.ddhq-sec header{ display:flex; justify-content:space-between; align-items:center; padding:6px 6px 8px; }
.ddhq-seeall{ font-size:13px; font-weight:600; color: var(--mf-primary-color,#cf2e5d); text-decoration:none; }
.ddhq-seeall:hover{ text-decoration: underline; }

/* Loading shimmer */
.ddhq-sec__content.is-loading{ min-height:120px; background: linear-gradient(90deg,#f4f4f4 25%, #ececec 37%, #f4f4f4 63%); background-size: 400% 100%; animation: dshimmer 1.2s ease-in-out infinite; border-radius:10px; }
@keyframes dshimmer{ 0%{background-position:100% 0} 100%{background-position:0 0} }

/* Theme-loop carousel */
.ddhq-carousel{ display: grid; gap: 12px; }
@media (min-width: 801px){
  .ddhq-carousel{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 800px){
  .ddhq-panel__dialog{
    width: 100vw; height: 88vh; max-height: 92vh; border-radius: 16px 16px 0 0; align-self: end; padding: 16px;
  }
  .ddhq-carousel{ display:flex; overflow-x:auto; -webkit-overflow-scrolling:touch; scroll-snap-type:x mandatory; gap:12px; padding:4px 8px 8px; }
  .ddhq-carousel > li.product{ flex:0 0 auto; min-width:50vw; scroll-snap-align:start; }
  .ddhq-carousel > li.product .product-wrapper,
  .ddhq-carousel > li.product .mf-product-inner,
  .ddhq-carousel > li.product .mf-product{ margin:0 !important; }
}

/* Presets */
.ddhq-preset-light .ddhq-panel__dialog{ background:#fff; }
.ddhq-preset-brand .ddhq-btn.js-ddhq-primary{ background:var(--mf-primary-color,#cf2e5d); border-color:var(--mf-primary-color,#cf2e5d); }
.ddhq-preset-elevated .ddhq-panel__dialog{ background:rgba(255,255,255,0.9); backdrop-filter:saturate(1.2) blur(6px); box-shadow: 0 40px 80px rgba(0,0,0,.28); }


/* Desktop: use auto-fit grid so we don't get a "missing 4th slot" when only 3 products return */
@media (min-width: 801px){
  .ddhq-panel .ddhq-sec__content > ul.products{
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
    gap: 14px !important;
    padding: 4px 6px 8px !important;
    margin: 0 !important;
  }
  .ddhq-panel .ddhq-sec__content > ul.products > li.product{
    width: auto !important;
    float: none !important;
    margin: 0 !important;
  }
}
/* === v1.1.5: Stronger mobile carousel override === */
@media (max-width: 800px){
    
    .woocommerce ul.products:not(.slick-slider) {
    display: flex;
    flex-wrap: nowrap !important;
}
  /* Force UL.products to be a horizontal scroller inside the panel */
  .ddhq-panel .ddhq-sec__content > ul.products,
  .ddhq-panel .ddhq-sec__content > .products.ddhq-carousel,
  .ddhq-panel .ddhq-sec__content > ul.products.ddhq-is-carousel{
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 12px !important;
    padding: 4px 8px 8px !important;
  }
  .ddhq-panel .ddhq-sec__content > ul.products > li.product{
    flex: 0 0 auto !important;
    min-width: 50vw !important;        /* ~1.3 cards visible; tweak if you like */
    scroll-snap-align: start;
    margin: 0 !important;
  }
  /* common wrappers in Martfury product card — remove extra margins so cards don't clip */
  .ddhq-panel .ddhq-sec__content > ul.products > li.product .product-wrapper,
  .ddhq-panel .ddhq-sec__content > ul.products > li.product .mf-product-inner,
  .ddhq-panel .ddhq-sec__content > ul.products > li.product .mf-product{
    margin: 0 !important;
  }
}
/* Optional: thinner horizontal scrollbar */
.ddhq-panel .ddhq-sec__content > ul.products { scrollbar-width: thin; }
.ddhq-panel .ddhq-sec__content > ul.products::-webkit-scrollbar { height: 6px; }

