/* Drugestan Health Magazine v1.29.0
   Content integrity + clean lower desktop grid + hard mobile product restoration. */
:root{
  --d29-navy:#123a63;
  --d29-teal:#168c89;
  --d29-teal-soft:#eef9f7;
  --d29-blue:#3979c7;
  --d29-violet:#7042b8;
  --d29-orange:#d97822;
  --d29-line:#d7e3eb;
  --d29-card:#f8fbfd;
  --d29-text:#334b60;
}

/* ---------- HERO / ONE INTRO ONLY ---------- */
body[class*="single-dhms_"] .dhm-v22-refine .dhm-v29-hero-quick{
  background:linear-gradient(180deg,#f2fbfa 0%,#ffffff 100%)!important;
  border:1px solid #cfe7e4!important;
  border-top:4px solid var(--d29-teal)!important;
  border-radius:16px!important;
}
body[class*="single-dhms_"] .dhm-v22-refine .dhm-v29-hero-quick>strong{
  color:var(--d29-teal)!important;
}
body[class*="single-dhms_"] .dhm-v22-refine .dhm-v29-science-jump{
  cursor:pointer!important;
  pointer-events:auto!important;
  position:relative!important;
  z-index:8!important;
  text-decoration:none!important;
}
body[class*="single-dhms_"] .dhm-v22-refine #dhm-main-text{
  scroll-margin-top:100px!important;
}

/* ---------- DESKTOP LOWER GRID ---------- */
@media (min-width:1180px){
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules{
    display:grid!important;
    grid-template-columns:repeat(12,minmax(0,1fr))!important;
    gap:18px!important;
    align-items:stretch!important;
  }

  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-v13-main{
    grid-column:1/-1!important;order:10!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-table-section{
    grid-column:span 6!important;order:20!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-faq-section{
    grid-column:span 6!important;order:20!important;
  }

  /* Four equal support cards in one row. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-action,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-pharmacist-section,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-professional{
    grid-column:span 3!important;
    order:30!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    display:flex!important;
    flex-direction:column!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-action>h2,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning>h2,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-pharmacist-section>h2,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-professional>h2{
    min-height:34px!important;
    margin:0 0 8px!important;
    font-size:17px!important;
    line-height:1.5!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-action>.dhm-section-card,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning>.dhm-section-card,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-pharmacist-section>.dhm-section-card,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-professional>.dhm-section-card{
    flex:1 1 auto!important;
    min-height:220px!important;
    max-height:270px!important;
    overflow:hidden!important;
  }

  /* Scientific follow-up cards: no orphan/narrow columns. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-text.dhm-heading-outside,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-sources{
    grid-column:span 4!important;
    order:40!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    display:flex!important;
    flex-direction:column!important;
    align-self:stretch!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-text.dhm-heading-outside>h2,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-sources>h2{
    min-height:36px!important;
    margin:0 0 8px!important;
    font-size:18px!important;
    line-height:1.5!important;
    color:var(--d29-navy)!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-text.dhm-heading-outside>.dhm-section-card,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-sources{
    flex:1 1 auto!important;
    min-height:190px!important;
    max-height:250px!important;
    overflow:hidden!important;
  }

  /* Any title-less text block becomes full width instead of a 1-column sliver. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-text:not(.dhm-heading-outside){
    grid-column:1/-1!important;
    order:41!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:16px 18px!important;
    border:1px solid var(--d29-line)!important;
    border-right:4px solid var(--d29-teal)!important;
    border-radius:14px!important;
    background:#f7fbfc!important;
  }

  /* Products are a major full-width section with five equal cards visible. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > #dhm-products,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-products{
    grid-column:1/-1!important;
    order:50!important;
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products>.dhm-section-card{
    background:#f1faf9!important;
    border:1px solid #cce7e4!important;
    border-right:4px solid var(--d29-teal)!important;
    border-radius:16px!important;
    padding:14px!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products .dhm-sync-products-grid,
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products .dhm-related-products{
    display:flex!important;
    flex-flow:row nowrap!important;
    gap:12px!important;
    width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity!important;
    padding:2px 1px 8px!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products .dhm-sync-product,
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products .dhm-related-product{
    flex:0 0 calc((100% - 48px)/5)!important;
    width:calc((100% - 48px)/5)!important;
    min-width:calc((100% - 48px)/5)!important;
    max-width:calc((100% - 48px)/5)!important;
    box-sizing:border-box!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-v13-related{
    grid-column:1/-1!important;order:60!important;
  }
}

/* ---------- MOBILE: PRODUCTS ARE NEVER REMOVED ---------- */
@media (max-width:899px){
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products,
  body[class*="single-dhms_"] .dhm-v22-refine section#dhm-products.dhm-sync-products,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules #dhm-products{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    position:relative!important;
    inset:auto!important;
    float:none!important;
    clear:both!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    margin:22px 0 112px!important;
    padding:0!important;
    transform:none!important;
    scroll-margin-top:88px!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products>h2{
    display:block!important;
    visibility:visible!important;
    font-size:24px!important;
    line-height:1.45!important;
    margin:0 0 10px!important;
    color:var(--d29-navy)!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products>.dhm-section-card{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    padding:12px!important;
    background:#eef9f7!important;
    border:1px solid #cce6e2!important;
    border-right:4px solid var(--d29-teal)!important;
    border-radius:16px!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products .dhm-sync-products-grid,
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products .dhm-related-products{
    display:flex!important;
    flex-flow:row nowrap!important;
    gap:10px!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scroll-snap-type:x mandatory!important;
    padding:2px 1px 8px!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products .dhm-sync-product,
  body[class*="single-dhms_"] .dhm-v22-refine #dhm-products .dhm-related-product{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    flex:0 0 78vw!important;
    width:78vw!important;
    min-width:78vw!important;
    max-width:78vw!important;
    height:auto!important;
    max-height:none!important;
    scroll-snap-align:center!important;
    background:#fff!important;
    border:1px solid #d8e5eb!important;
    border-radius:16px!important;
    padding:12px!important;
  }

  /* fixed CTA always sits above the Woodmart mobile navigation */
  body[class*="single-dhms_"] .dhm-v25-products-only.dhm-v19-mobile-actions{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    position:fixed!important;
    left:14px!important;
    right:14px!important;
    bottom:96px!important;
    width:auto!important;
    z-index:2147483000!important;
    pointer-events:none!important;
  }
  body[class*="single-dhms_"] .dhm-v25-products-only .dhm-v19-products{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    width:100%!important;
    min-height:54px!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:18px!important;
    background:linear-gradient(90deg,#6621d8,#8126e4)!important;
    color:#fff!important;
    font-size:17px!important;
    font-weight:900!important;
    text-decoration:none!important;
  }

  /* lower scientific cards never collapse into narrow desktop columns on phones */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-text,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-sources,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-action,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-pharmacist-section,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-professional{
    display:block!important;
    float:none!important;
    clear:both!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:auto!important;
    max-height:none!important;
    margin:18px 0!important;
  }
}
