/*
 * KC WooCommerce refresh
 * Layout direction: product-first catalogue inspired by JCPSA.
 */

body.woocommerce-shop .site-main,
body.post-type-archive-product .site-main,
body.single-product .site-main {
  background: #f4f7fa;
}

.kc-shop-heading {
  margin: 0;
  padding: 22px 26px;
  background: transparent;
  border-left: 0;
  border-radius: 8px;
}

.kc-shop-heading h1 {
  margin: 0;
  color: #0c2d4d;
  font-size: clamp(28px, 2.4vw, 38px);
  line-height: 1.15;
}

body.woocommerce-shop .woocommerce-result-count,
body.woocommerce-shop .woocommerce-ordering {
  margin-bottom: 22px;
}

body.woocommerce-shop ul.products,
body.post-type-archive-product ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 28px 22px !important;
}

body.woocommerce-shop ul.products::before,
body.woocommerce-shop ul.products::after,
body.post-type-archive-product ul.products::before,
body.post-type-archive-product ul.products::after {
  display: none !important;
}

body.woocommerce ul.products li.product {
  position: relative;
  float: none !important;
  display: flex;
  flex-direction: column;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 0 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce5ed;
  border-radius: 10px;
  box-shadow: 0 7px 24px rgba(12, 45, 77, .07);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

body.woocommerce ul.products li.product:hover {
  transform: translateY(-4px);
  border-color: rgba(238, 115, 58, .65);
  box-shadow: 0 14px 34px rgba(12, 45, 77, .14);
}

body.woocommerce ul.products li.product > .woocommerce-LoopProduct-link {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  color: inherit;
}

body.woocommerce ul.products li.product figure {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0 0 18px !important;
  overflow: hidden;
  background: #eef2f6;
}

body.woocommerce ul.products li.product figure > .ct-media-container {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.woocommerce ul.products li.product img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  transition: transform .35s ease;
}

body.woocommerce ul.products li.product:hover img {
  transform: scale(1.035);
}

body.woocommerce ul.products li.product .woocommerce-loop-product__title {
  display: -webkit-box;
  min-height: 3.9em;
  margin: 0 18px 10px !important;
  overflow: hidden;
  color: #172b3d;
  font-size: 17px !important;
  font-weight: 700;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body.woocommerce ul.products li.product .price {
  margin: auto 18px 16px !important;
  color: #d95e28 !important;
  font-size: 18px !important;
  font-weight: 800;
}

body.woocommerce ul.products li.product .entry-meta,
body.woocommerce ul.products li.product .product-categories {
  display: none !important;
}

body.woocommerce ul.products li.product .kc-product-details,
body.woocommerce ul.products li.product .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0 18px 9px !important;
  padding: 8px 14px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

body.woocommerce ul.products li.product .kc-product-details {
  color: #16466f;
  background: #fff;
  border: 1px solid #16466f;
}

body.woocommerce ul.products li.product .kc-product-details:hover {
  color: #fff;
  background: #16466f;
}

body.woocommerce ul.products li.product .button {
  margin-bottom: 0 !important;
  align-self: stretch !important;
  width: calc(100% - 36px) !important;
  box-sizing: border-box;
  color: #fff !important;
  background: #2872fa;
  border: 1px solid #2872fa;
}

body.woocommerce ul.products li.product .button:hover {
  color: #fff !important;
  background: #1559ed;
  border-color: #1559ed;
}

body.woocommerce ul.products li.product .onsale,
body.woocommerce ul.products li.product [class*="ct-woo-badge"] {
  top: 12px;
  left: 12px;
  right: auto;
  z-index: 3;
  border-radius: 999px;
}

body.woocommerce-shop .woocommerce-pagination {
  margin: 42px 0 0;
}

.kc-shop-page-content--below {
  margin-top: clamp(52px, 6vw, 86px);
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: 0;
}

.kc-shop-page-content--below .panel-layout,
.kc-shop-page-content--below .panel-grid,
.kc-shop-page-content--below .panel-grid-cell {
  margin: 0 !important;
}

.kc-shop-page-content--below .panel-grid-cell > .so-panel {
  margin-bottom: 0 !important;
}

.kc-shop-page-content--below .panel-grid-cell > .so-panel:first-child {
  display: contents;
}

/* Single-product presentation */
body.single-product .ct-breadcrumbs {
  margin-top: clamp(28px, 3vw, 44px);
}

body.single-product .woocommerce-product-gallery .flexy-view {
  height: auto !important;
}

body.single-product .woocommerce-product-gallery .flexy-items {
  align-items: flex-start !important;
}

body.single-product .woocommerce-product-gallery .flexy-item {
  height: auto !important;
  min-height: 0 !important;
}

body.single-product .woocommerce-product-gallery .flexy-item > .ct-media-container,
body.single-product .woocommerce-product-gallery > .ct-product-gallery-container > .ct-media-container {
  display: block;
  width: 100%;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  overflow: hidden;
}

body.single-product .woocommerce-product-gallery .flexy-item > .ct-media-container img,
body.single-product .woocommerce-product-gallery > .ct-product-gallery-container > .ct-media-container img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

body.single-product .woocommerce-product-gallery .flexy-pills .ct-media-container {
  display: block;
  width: 100%;
  height: auto !important;
  aspect-ratio: 4 / 3 !important;
  overflow: hidden;
}

body.single-product .woocommerce-product-gallery .flexy-pills .ct-media-container img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

/* Woo Product Gallery Slider (WPGS) overrides the native Blocksy gallery. */
body.single-product .woo-product-gallery-slider .wpgs-for .slick-list,
body.single-product .woo-product-gallery-slider .wpgs-for .slick-track {
  height: auto !important;
}

body.single-product .woo-product-gallery-slider .wpgs-for .slick-slide {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

body.single-product .woo-product-gallery-slider .wpgs-for .wpgs-lightbox-icon {
  display: block;
  width: 100%;
  height: 100%;
}

body.single-product .woo-product-gallery-slider .wpgs-for .slick-slide img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
}

body.single-product .woo-product-gallery-slider .wpgs-nav .slick-list,
body.single-product .woo-product-gallery-slider .wpgs-nav .slick-track {
  height: auto !important;
}

body.single-product .woo-product-gallery-slider .wpgs-nav .slick-slide {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

body.single-product .woo-product-gallery-slider .wpgs-nav .slick-slide img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
}

body.single-product .product-entry-wrapper {
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

body.single-product .woocommerce-product-gallery,
body.single-product .entry-summary {
  padding: clamp(18px, 2.5vw, 30px);
  background: #fff;
  border: 1px solid #dce5ed;
  border-radius: 10px;
  box-shadow: 0 9px 28px rgba(12, 45, 77, .08);
}

body.single-product .woocommerce-product-gallery__image,
body.single-product .woocommerce-product-gallery__image img {
  overflow: hidden;
  border-radius: 7px;
}

body.single-product .entry-summary .product_title {
  margin-bottom: 16px;
  color: #172b3d;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
}

body.single-product .entry-summary .price {
  margin-bottom: 20px;
  color: #d95e28;
  font-size: clamp(24px, 2.3vw, 34px);
  font-weight: 800;
}

body.single-product .woocommerce-product-details__short-description {
  color: #3a4f66;
  font-size: 16px;
  line-height: 1.65;
}

body.single-product .woocommerce-product-details__short-description ul {
  margin-top: 14px;
  padding-left: 1.25em;
}

body.single-product form.cart {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

body.single-product form.cart .single_add_to_cart_button {
  min-height: 48px;
  padding: 11px 24px;
  color: #fff !important;
  background: #ee733a;
  border-radius: 3px;
  font-weight: 800;
}

body.single-product form.cart .single_add_to_cart_button:hover {
  color: #fff !important;
  background: #d95e28;
}

body.single-product .product_meta {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e3e9ef;
  color: #607284;
  font-size: 13px;
}

body.single-product .product_meta .tagged_as {
  display: none !important;
}

body.single-product .woocommerce-tabs {
  margin-top: clamp(38px, 5vw, 72px);
  padding: clamp(20px, 3vw, 40px);
  background: #fff;
  border: 1px solid #dce5ed;
  border-radius: 10px;
  box-shadow: 0 9px 28px rgba(12, 45, 77, .06);
}

body.single-product .related,
body.single-product .upsells {
  margin-top: clamp(42px, 6vw, 76px);
}

body.single-product .related.products,
body.single-product .upsells.products {
  margin-bottom: clamp(56px, 7vw, 96px);
}

/* Desktop editorial layout for the Premium Garden Rooms description. */
@media (min-width: 1000px) {
  body.single-product.postid-7879 .woocommerce-Tabs-panel--description {
    display: flow-root;
  }

  body.single-product.postid-7879 .woocommerce-Tabs-panel--description > .wp-caption {
    float: left;
    clear: both;
    width: clamp(300px, 32%, 380px) !important;
    margin: 0 38px 34px 0 !important;
    padding: 10px;
    background: #f4f7fa;
    border: 1px solid #dce5ed;
    border-radius: 9px;
  }

  body.single-product.postid-7879 .woocommerce-Tabs-panel--description > .wp-caption img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
  }

  body.single-product.postid-7879 .woocommerce-Tabs-panel--description > .wp-caption .wp-caption-text {
    margin: 10px 4px 2px;
    color: #607284;
    font-size: 13px;
    line-height: 1.45;
  }

  body.single-product.postid-7879 .woocommerce-Tabs-panel--description > .wp-caption + :is(h1, h2, h3) {
    margin-top: 0;
    padding-top: 4px;
  }
}

@media (max-width: 1279px) {
  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 999.98px) {
  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 689.98px) {
  .kc-shop-heading {
    margin-bottom: 0;
    padding: 14px 16px;
    border-left-width: 4px;
    border-radius: 6px;
  }

  .kc-shop-heading h1 {
    font-size: 23px;
    line-height: 1.15;
  }

  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
  }

  body.woocommerce ul.products li.product figure {
    aspect-ratio: 16 / 10;
  }

  body.woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 0;
    font-size: 18px !important;
    -webkit-line-clamp: 2;
  }

  .kc-shop-page-content--below {
    margin-top: 44px;
    border-radius: 0;
  }

  body.single-product .woocommerce-product-gallery,
  body.single-product .entry-summary,
  body.single-product .woocommerce-tabs {
    padding: 16px;
    border-radius: 8px;
  }

  body.single-product .entry-summary .product_title {
    font-size: 26px;
  }

  body.single-product .entry-summary .price {
    font-size: 25px;
  }

  body.single-product form.cart .single_add_to_cart_button {
    flex: 1 1 180px;
  }
}
