/* Responsive refinements for catalog cards. Loaded after the site's custom CSS. */

@media (max-width: 767px) {
  .s-products-list.s-products-view-thumbs .s-product-wrapper .card,
  .s-products-list.s-products-view-thumbs .s-product-wrapper .card-borders {
    height: auto !important;
  }

  .s-products-list.s-products-view-thumbs .s-product-wrapper .card-body {
    flex: none;
    height: auto !important;
  }

  .s-products-list.s-products-view-thumbs .s-product-wrapper .s-image-wrapper {
    width: 222px;
    max-width: 100%;
    height: auto !important;
    padding-top: 0 !important;
    aspect-ratio: 1 / 1;
    margin-right: auto;
    margin-left: auto;
  }

  .s-products-list.s-products-view-thumbs .s-product-header,
  .s-products-list.s-products-view-thumbs .s-pricing-wrapper {
    width: 100%;
    text-align: center;
  }

  .s-products-list.s-products-view-thumbs .s-buttons-wrapper.d-block.d-md-none {
    text-align: center;
  }

  .s-products-list.s-products-view-thumbs .s-buttons-wrapper.d-block.d-md-none .btn {
    width: 222px;
    max-width: 100%;
  }
}

/* Keep the homepage calculator CTA compact and consistent with theme buttons. */
.calculator-cta {
  box-sizing: border-box;
  flex-wrap: nowrap;
  width: auto;
  max-width: calc(100% - 2rem);
  padding: .75rem clamp(1rem, 3vw, 2rem);
  border-radius: .1875rem;
  font-size: clamp(.9375rem, .875rem + .5vw, 1.25rem);
  line-height: 1.5;
  white-space: nowrap;
}

.calculator-cta span {
  white-space: nowrap;
}

.calculator-cta svg {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
}

@media (min-width: 768px) and (max-width: 991px) {
  .s-products-list.s-products-view-thumbs > .s-product-wrapper {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .s-products-list.s-products-view-thumbs .s-product-wrapper > .card {
    width: 100%;
    height: 100%;
  }

  .s-products-list.s-products-view-thumbs .s-product-wrapper .card-body {
    height: auto !important;
  }

  .s-products-list.s-products-view-thumbs .s-product-wrapper .s-image-wrapper {
    width: 222px;
    max-width: 100%;
    height: auto !important;
    padding-top: 0 !important;
    aspect-ratio: 1 / 1;
    margin-right: auto;
    margin-left: auto;
  }

  .s-products-list.s-products-view-thumbs .s-product-header,
  .s-products-list.s-products-view-thumbs .s-pricing-wrapper {
    width: 100%;
    text-align: center;
  }

  .s-products-list.s-products-view-thumbs .s-buttons-wrapper {
    text-align: center;
  }

  .s-products-list.s-products-view-thumbs .s-buttons-wrapper .btn {
    width: 222px !important;
    max-width: 100%;
  }
}

@media (max-width: 991px) {
  .s-products-list.s-products-view-thumbs .s-product-card__price {
    justify-content: center;
    text-align: center;
  }

  .c-categories .c-categories__card-body {
    padding: 3.5rem 1.5rem 1.5rem;
  }

  .c-categories .c-categories__card-body > .d-flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .c-categories .c-categories__card-body > .d-flex > a.mr-5 {
    margin-right: 0 !important;
    margin-bottom: 1rem;
  }

  .c-categories .c-categories__image {
    display: block;
    flex: 0 0 auto;
    width: 150px;
    max-width: 100%;
  }

  .c-categories .c-categories__image img {
    display: block;
    width: 100%;
    max-width: 100% !important;
    height: auto;
  }

  .c-categories .c-categories__content {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .c-categories .c-categories__content > a,
  .c-categories .c-categories__content .h4 {
    display: block;
    width: 100%;
  }

  .c-categories .c-categories__content .h4 {
    line-height: 1.35;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
  }
}

@media (min-width: 992px) {
  .s-products-list.s-products-view-thumbs > .s-product-wrapper {
    flex: 0 0 25%;
    max-width: 25%;
  }

  .s-products-list.s-products-view-thumbs .s-product-wrapper > .card {
    width: 100%;
    height: 100%;
  }

  .c-categories .c-categories__card-body {
    padding: 1.5rem 3.5rem 1.5rem 1.5rem;
  }

  .c-categories .c-categories__card-body > .d-flex {
    align-items: center;
  }

  .c-categories .c-categories__card-body > .d-flex > a.mr-5 {
    flex: 0 0 72px;
    margin-right: 1rem !important;
  }

  .c-categories .c-categories__image {
    display: block;
    flex: 0 0 auto;
    width: 72px;
    max-width: 72px;
  }

  .c-categories .c-categories__image img {
    display: block;
    width: 100%;
    max-width: 100% !important;
    height: auto;
  }

  .c-categories .c-categories__content .h4 {
    line-height: 1.35;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
  }
}
