/* Products Page Filter */

.productResults {
  margin-bottom: 2.5rem;
}

.productResultsFilter {
  margin-top: 5rem;
}

.medicineCategories {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background: var(--white);
  border-radius: 30px;
  gap: 10rem;
}

.medicineCategories .categoryRadio {
  margin: 0;
  cursor: pointer;
}

.medicineCategories .categoryRadio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.medicineCategories .categoryRadio .categoryLabel {
  display: flex;
  padding: 5px 14px;
  border-radius: 20px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--black);
  background: transparent;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.medicineCategories .categoryRadio .categoryLabel span {
  font-size: 20px;
  font-weight: 400;
}

.categoryLabel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
}

.categoryImage {
  display: block;
  width: 106px;
  max-width: 106px;
  height: 106px;
  object-fit: contain;
  margin: 0 auto 12px;
}
.medicineCategories .categoryRadio:hover .categoryLabel {
  color: var(--black);
}

@media (max-width: 900px) {
  .medicineCategories .categoryImage {
    display: flex;
    width: 68px;
    max-width: 68px;
    height: 68px;

    object-fit: contain;

    margin: 0 auto 9px;
  }

  .medicineCategories .categoryRadio .categoryLabel span {
    font-size: 20px;
    font-weight: 400;
  }
}
/******* MIGRATED PRODUCT CODE ******/

/* =========================================================
   Product cards
   Click opens a card (JS toggles .is-open).

   Hover version: open-state selectors have a commented
   :hover line under them. To switch back to hover,
   uncomment those and remove the JS.

   Open colours: each .productLoop sets --expand (card + tab
   background) and, on dark cards, --expandText (white text).
   ========================================================= */

/* ---------- Shared ---------- */

.productPage .product-result-loop {
  display: grid;
  width: 100%;
  margin: 0;
  padding: 0;
}

.productPage .productLoop {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
}

.productPage .productLoop .product {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  overflow: visible;
  background: #f6f6f6;
  border-radius: 16px;
  cursor: pointer;
}

.productPage .productLoop .product > h4 {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  color: #29234f;
  font-weight: 400;
  line-height: 1.2;
}

/* Plus / minus icon */
.productPage .productLoop .product::after {
  content: "+";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #29234f;
  font-weight: 300;
  line-height: 1;
}

/* Details stay in the DOM so they can animate */
.productPage .productLoop .product .information {
  display: block;
  position: static;
  width: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-8px);
}

.productPage .productLoop .product .information > .row {
  display: grid;
  width: 100%;
  margin: 0 0 5px;
  padding: 0;
}

.productPage .productLoop .product .information h5,
.productPage .productLoop .product .information span {
  margin: 0;
  padding: 0;
  font-weight: 400;
}

.productPage .productLoop .product .blob-wrap {
  display: none;
}

/* Open */

.productPage .productLoop .product.is-open


/* , .productPage .productLoop .product:hover */ {
  --new-gray: #dde08d33;
  display: block;
  height: auto;
  overflow: visible;
  background: var(--expand, #e3e58b);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.productPage .productLoop .product.is-open > h4
/* , .productPage .productLoop .product:hover > h4 */ {
  max-width: none;
  padding: 0;
}

.productPage .productLoop .product.is-open > h4,
.productPage .productLoop .product.is-open::after,
.productPage .productLoop .product.is-open .information h5,
.productPage .productLoop .product.is-open .information span
/* , .productPage .productLoop .product:hover > h4,
   .productPage .productLoop .product:hover::after,
   .productPage .productLoop .product:hover .information h5,
   .productPage .productLoop .product:hover .information span */ {
  color:  #29234f;
}

.productPage .productLoop .product.is-open .information
/* , .productPage .productLoop .product:hover .information */ {
  opacity: 1;
  visibility: visible;
  max-height: 180px;
  overflow: visible;
  transform: translateY(0);
}

/* Tab hanging off the bottom right */
.productPage .productLoop .product.is-open::before
/* , .productPage .productLoop .product:hover::before */ {
  content: "";
  display: block;
  position: absolute;
  right: 0;
  z-index: 1;
  width: 60%;
  background: var(--expand, #e3e58b);
  border-radius: 0 0 16px 16px;
}

/* Minus sits on the tab */
.productPage .productLoop .product.is-open::after
/* , .productPage .productLoop .product:hover::after */ {
  content: "−";
  top: auto;
  transform: none;
  z-index: 30;
}

/* ---------- Mobile ---------- */

@media (max-width: 900px) {
  .productPage .productResults {
    width: calc(100% - 30px);
    max-width: none;
    margin: 0 auto 50px;
    padding: 0;
  }

  .productPage .product-result-loop {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .productPage .productLoop {
    min-height: 88px;
    padding: 0 0 24px;
  }

  .productPage .productLoop .product {
    height: 88px;
    min-height: 88px;
    padding: 18px 54px 18px 18px;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.14);
    transition:
      min-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
      padding 0.4s cubic-bezier(0.22, 1, 0.36, 1),
      background-color 0.3s ease,
      box-shadow 0.3s ease;
  }

  .productPage .productLoop .product > h4 {
    max-width: calc(100% - 35px);
    font-size: 18px;
  }

  .productPage .productLoop .product::after {
    right: 17px;
    z-index: 20;
    font-size: 30px;
  }

  .productPage .productLoop .product .information {
    transition:
      opacity 0.25s ease,
      transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
      max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    padding-top: 20px;
  }

  .productPage .productLoop .product .information > .row {
    grid-template-columns: 108px 1fr;
    align-items: center;
  }

  .productPage .productLoop .product .information h5,
  .productPage .productLoop .product .information span {
    font-size: 16px;
    line-height: 1.3;
  }

  .productPage .productLoop .medicineIcon {
    opacity: 1;
    filter: brightness(0) saturate(100%);
    padding-left: 12px;
    margin-left: 12px;
  }

  /* Open */

  .productPage .productLoop .product.is-open
	/* , .productPage .productLoop .product:hover */ {
    position: relative;
    z-index: 20;
    min-height: 210px;
    padding: 22px 18px 28px;
    border-radius: 16px 16px 0 16px;
  }

  .productPage .productLoop .product.is-open > h4
	/* , .productPage .productLoop .product:hover > h4 */ {
    margin-bottom: 14px;
  }

  .productPage .productLoop .product.is-open::before
	/* , .productPage .productLoop .product:hover::before */ {
    bottom: -24px;
    height: 24px;
    box-shadow: 0 6px 7px rgba(0, 0, 0, 0.14);
  }

  .productPage .productLoop .product.is-open::after
	/* , .productPage .productLoop .product:hover::after */ {
    right: 16px;
    bottom: -17px;
    font-size: 27px;
  }

  /* Open colours: repeat left / centre / right */

  .productPage .product-result-loop > .productLoop:nth-child(3n + 1) {
    --expand: var(--leftExpand);
  }

  .productPage .product-result-loop > .productLoop:nth-child(3n + 2) {
    --expand: #a8a9a8;
    --expandText: var(--white);
  }

  .productPage .product-result-loop > .productLoop:nth-child(3n) {
    --expand: var(--rightExpand);
    --expandText: var(--white);
  }

  .productPage .product-result-loop > .productLoop:nth-child(3n+2) .product.is-open
	/* , .productPage .product-result-loop > .productLoop:nth-child(3n+2) .product:hover */ {
    color: #fff;
  }

  .productPage .product-result-loop > .productLoop:is(:nth-child(3n+2), :nth-child(3n)) .product.is-open .medicineIcon
	/* , .productPage .product-result-loop > .productLoop:is(:nth-child(3n+2), :nth-child(3n)) .product:hover .medicineIcon */ {
    filter: brightness(0) invert(1);
  }
}

/* ---------- Desktop ---------- */

@media (min-width: 901px) {
  .productPage .productResults {
    width: calc(100% - 80px);
    max-width: 1225px;
    margin: 0 auto 80px;
    padding: 0;
  }

  /* 3 columns, filling top to bottom */
  .productPage .product-result-loop {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(5, 98px);
    grid-auto-flow: column;
    column-gap: 18px;
    row-gap: 22px;
  }

  /* 16+ products: 7 rows keeps it at 3 columns */
  .productPage .product-result-loop:has(> .productLoop:nth-child(16)) {
    grid-template-rows: repeat(7, 98px);
  }

  /* 3 products or fewer: one row across */
  .productPage .product-result-loop:not(:has(> .productLoop:nth-child(4))) {
    grid-template-rows: 98px;
    grid-auto-flow: row;
  }

  .productPage .productLoop {
    min-height: 98px;
    padding: 0;
  }

  .productPage .productLoop .product {
    height: 98px;
    min-height: 98px;
    padding: 20px 58px 20px 24px;
    box-shadow: 0 3px 3px rgba(0, 0, 0, 0.15);
    transition:
      height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      min-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      padding 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      background-color 0.3s ease,
      box-shadow 0.3s ease,
      transform 0.3s ease;
  }

  .productPage .productLoop .product > h4 {
    max-width: calc(100% - 45px);
    font-size: 20px;
  }

  .productPage .productLoop .product::after {
    right: 20px;
    z-index: 10;
    font-size: 34px;
    transition:
      top 0.4s cubic-bezier(0.22, 1, 0.36, 1),
      bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1),
      right 0.4s ease,
      transform 0.4s ease;
  }

  .productPage .productLoop .product .information {
    transition:
      opacity 0.28s ease,
      transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
      max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.35s;
  }

  .productPage .productLoop .product .information > .row {
    grid-template-columns: 125px 1fr;
    align-items: start;
  }

  .productPage .productLoop .product .information h5,
  .productPage .productLoop .product .information span {
    font-size: 18px;
    line-height: 1.35;
  }

  /* Open */

  .productPage .productLoop .product.is-open
	/* , .productPage .productLoop .product:hover */ {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    height: 220px;
    min-height: 220px;
    padding: 28px 24px 30px;
    animation: productCardOpen 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .productPage .productLoop .product.is-open > h4
	/* , .productPage .productLoop .product:hover > h4 */ {
    margin-bottom: 16px;
  }

  .productPage .productLoop .product.is-open .information
	/* , .productPage .productLoop .product:hover .information */ {
    margin-top: 12px;
    color: var(--expandText);
    transition-delay: 0.08s, 0.08s, 0.02s, 0s;
  }

  .productPage .productLoop .product.is-open > h4,
	.productPage .productLoop .product.is-open .information,
	.productPage .productLoop .product.is-open .information h5,
	.productPage .productLoop .product.is-open .information span
	/* , .productPage .productLoop .product:hover > h4,
	   .productPage .productLoop .product:hover .information,
	   .productPage .productLoop .product:hover .information h5,
	   .productPage .productLoop .product:hover .information span */ {
    -webkit-text-fill-color: #29234f);
  }

  .productPage .productLoop .product.is-open::before
	/* , .productPage .productLoop .product:hover::before */ {
    bottom: -30px;
    height: 30px;
    box-shadow: 0 7px 8px rgba(0, 0, 0, 0.15);
    animation: productTabIn 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .productPage .productLoop .product.is-open::after
	/* , .productPage .productLoop .product:hover::after */ {
    right: 18px;
    bottom: -19px;
    font-size: 30px;
  }

  /* Open colours: 5 per column */

  .productPage .product-result-loop > .productLoop {
    --expand: var(--leftExpand);
  }

  .productPage .product-result-loop > .productLoop:nth-child(n + 6) {
    --expand: #a8a9a8;
    --expandText: #fff;
  }

  .productPage .product-result-loop > .productLoop:nth-child(n + 11) {
    --expand: var(--rightExpand);
  }

  /* 16+ products: 7 per column */

  .productPage
    .product-result-loop:has(> .productLoop:nth-child(16))
    > .productLoop:nth-child(-n + 7) {
    --expand: var(--leftExpand);
  }

  .productPage
    .product-result-loop:has(> .productLoop:nth-child(16))
    > .productLoop:nth-child(n + 8) {
    --expand: #a8a9a8;
  }

  .productPage
    .product-result-loop:has(> .productLoop:nth-child(16))
    > .productLoop:nth-child(n + 15) {
    --expand: var(--rightExpand);
  }

  /* 3 or fewer: one per column */

  .productPage
    .product-result-loop:not(:has(> .productLoop:nth-child(4)))
    > .productLoop:nth-child(2) {
    --expand: #a8a9a8;
    --expandText: #fff;
  }

  .productPage
    .product-result-loop:not(:has(> .productLoop:nth-child(4)))
    > .productLoop:nth-child(3) {
    --expand: var(--rightExpand);
    --expandText: #29234f;
  }

}

/* ---------- Animations ---------- */

@keyframes productCardOpen {
  from {
    opacity: 0.94;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes productTabIn {
  from {
    opacity: 0;
    transform: translateY(-22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#productResults .product.is-open {
  border-radius: 16px 16px 0 16px !important;
}

#productResults .product.is-open::before {
  border-radius: 0 0 16px 16px !important;
}
/******** END OF MIGRATED CODE ******?
/* Medicine Categories */

.medicineIcon {
  width: 40px;
  height: 40px;
  margin-left: 12px;
}

.medicineCategories li {
  display: inline-block;
}

.medicineCategories li a:hover {
  cursor: pointer;
}

.categoryImage--active {
  display: none;
}

.categoryRadio input:checked ~ .categoryLabel .categoryImage--default {
  display: none;
}

.categoryRadio input:checked ~ .categoryLabel .categoryImage--active {
  display: inline-block;
}

/* Product Hero */

.hero {
  position: relative;
  top: 0;
  z-index: 10;
  border-top: 15px solid var(--bodyBackground);
  background-color: var(--bodyBackground);
  height: clamp(430px, 30vw, 500px);
  overflow: hidden;
  color: var(--headingText);
  padding: 0px 75px 55px 75px;
}

.hero .productContent {
  position: relative;
  z-index: 5;
  max-width: 40%;
}

.hero .headerContent {
  padding-left: 28px;
}

.hero .heroBackground {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 98%;
  height: 100%;
  margin: 0 auto;
  max-height: 920px;
  background-size: cover;
  background-position: bottom;
  z-index: 0;
  background-repeat: no-repeat;
  border-top-left-radius: var(--headerRadius);
  border-top-right-radius: var(--headerRadius);
}

.hero .heroLeftContent {
  position: absolute;
  z-index: 1;
  top: 3rem;
  left: 5rem;
}

.hero .heroLeftContent p {
  font-size: clamp(36px, 1.2vw, 56px);
  line-height: clamp(46px, 1.2vw, 66px);
}

.hero .heroRightContent {
  position: absolute;
  z-index: 1;
  bottom: 1rem;
  right: 5rem;
}

.hero .heroRightContent p {
  font-size: clamp(24px, 1.2vw, 34px);
  line-height: clamp(34px, 1.2vw, 44px);
  color: var(--headingText);
}

.hero video {
  height: 50vh;
  width: 98vw;
  display: block;
  object-fit: cover;
  border-bottom-left-radius: var(--headerRadius);
  border-bottom-right-radius: var(--headerRadius);
  margin: 0 auto;
}

.hero .accentImage {
  background: url("../images/videoBanner.svg");
  height: 100px;
  background-position: bottom right;
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 45%;
  background-repeat: no-repeat;
  background-size: cover;
}
.hero .headerContent p {
  line-height: 1.4;
}

/* Tablet / Mobile Hero */

@media (max-width: 992px) {
  .hero .heroLeftContent {
    left: 0;
    padding-left: 1rem;
  }

  .hero {
    padding: 40px 0px;
    align-items: flex-start !important;
  }

  .hero .headerContent {
    padding-left: 48px;
  }
}

@media (max-width: 768px) {
  .hero .productContent {
    max-width: 270px;
  }
  .productContent .headerContent {
    max-width: 215px;
  }

  .hero .headerContent {
    padding-left: 12px;
  }

  .hero .heroRightContent {
    bottom: 4rem;
    right: auto;
    left: 0;
    padding-left: 1rem;
  }

  .medicineCategories {
    gap: 0;
  }
}

/* Smaller Screens */

@media (max-width: 900px) {
  .hero {
    padding: 40px 28px;
    align-items: flex-start !important;
    font-weight: 400;
    line-height: 1.4;
  }

  .productContent .headerContent {
    max-width: 320px;
  }

  .productPage
    .horizontalExpandingBlocks
    .horizontalPanels
    .panel:nth-child(2)
    h3 {
    color: white !important;
  }
}
