/* Highland catalog 0.9.10: frameless 3:2 mockups + stable cart action. */
/* The general content rule limits direct <ul> elements to 880px. Product grids
   must be exempt, otherwise four columns only occupy part of the page. */
.hp-page-content > ul.products,
.hp-archive-page ul.products,
.hp-featured ul.products {
  box-sizing: border-box;
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  column-gap: clamp(16px, 2.2vw, 30px);
  row-gap: 39px;
  align-items: start;
}

/* Use landscape 3:2 slots for record/CD mockups. The image itself is NOT cropped:
   Woo's non-cropped "large" size is requested by content-product.php. */
.hp-product-card {
  min-width: 0;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.hp-product-card .hp-card-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
}
.hp-product-card .hp-card-cover img {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: contain !important;
  object-position: center center;
  padding: 0;
  margin: 0 !important;
  transform: scale(1);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.hp-product-card .hp-card-badge {
  z-index: 2;
}
.hp-product-card .hp-card-info {
  align-items: flex-end;
  gap: 8px;
}
.hp-product-card .hp-card-info h3 {
  overflow-wrap: anywhere;
}
.hp-product-card .hp-card-info h3 a {
  transition: color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .hp-product-card:hover {
    transform: translateY(-5px);
  }
  .hp-product-card:hover .hp-card-cover img {
    transform: scale(1.025);
  }
  .hp-product-card:hover .hp-card-info h3 a {
    color: var(--hp-violet);
  }
}
/* Keyboard focus stays accessible without a permanent image frame. */
.hp-product-card .hp-card-cover:focus-visible {
  outline: 2px solid var(--hp-violet);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .hp-page-content > ul.products,
  .hp-archive-page ul.products,
  .hp-featured ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 20px;
  }
}
@media (max-width: 760px) {
  .hp-page-content > ul.products,
  .hp-archive-page ul.products,
  .hp-featured ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 14px;
    row-gap: 28px;
  }
  .hp-product-card .hp-card-cover img { padding: 0; }
  .hp-product-card { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-product-card,
  .hp-product-card .hp-card-cover,
  .hp-product-card .hp-card-cover img,
  .hp-product-card .hp-card-info h3 a {
    transition: none !important;
  }
  .hp-product-card:hover { transform: none; }
  .hp-product-card:hover .hp-card-cover img { transform: none; }
}

/* Maintain the same 3:2 geometry in homepage, archives and related
   products, even when the WooCommerce image rules load after theme CSS. */
.woocommerce ul.products li.hp-product-card > a.hp-card-cover,
.hp-page-content ul.products li.hp-product-card > a.hp-card-cover,
.hp-archive-page ul.products li.hp-product-card > a.hp-card-cover,
.hp-featured ul.products li.hp-product-card > a.hp-card-cover,
.hp-single-bottom .related ul.products li.hp-product-card > a.hp-card-cover,
.hp-single-bottom .upsells ul.products li.hp-product-card > a.hp-card-cover {
  display: block !important;
  position: relative !important;
  box-sizing: border-box;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 2 !important;
  overflow: hidden;
}
/* Absolute positioning makes the image fill the definite aspect-ratio box;
   a percentage height alone could resolve to "auto" and leave a square image. */
.woocommerce ul.products li.hp-product-card a.hp-card-cover > img,
.hp-page-content ul.products li.hp-product-card a.hp-card-cover > img,
.hp-archive-page ul.products li.hp-product-card a.hp-card-cover > img,
.hp-featured ul.products li.hp-product-card a.hp-card-cover > img,
.hp-single-bottom .related ul.products li.hp-product-card a.hp-card-cover > img,
.hp-single-bottom .upsells ul.products li.hp-product-card a.hp-card-cover > img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
}
/* Related / upsell products live outside the archive containers. */
.hp-single-bottom .related ul.products,
.hp-single-bottom .upsells ul.products {
  box-sizing: border-box;
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 35px 24px;
}
.hp-single-bottom .related ul.products li.product,
.hp-single-bottom .upsells ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  min-width: 0;
}
/* Compatibility: Woo's standard product-loop template, if used by a plugin,
   displays a plain image without our hp-card-cover link. */
.hp-single-bottom .related ul.products li.product > a.woocommerce-LoopProduct-link > img,
.hp-single-bottom .upsells ul.products li.product > a.woocommerce-LoopProduct-link > img {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 2 !important;
  object-fit: contain !important;
  object-position: center !important;
  margin-bottom: 9px !important;
}
/* Cart: landscape mockups must stay fully visible instead of being squeezed
   into WooCommerce's default square thumb. Do not touch shipping tables. */
.woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail {
  width: 156px;
  min-width: 132px;
  text-align: center;
}
.woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail img,
.woocommerce-page.woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail img,
.woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail .hp-cart-thumb-image,
.woocommerce-page.woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail .hp-cart-thumb-image {
  display: block !important;
  box-sizing: border-box !important;
  width: 138px !important;
  height: auto !important;
  max-width: 100% !important;
  aspect-ratio: 3 / 2 !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 auto !important;
  padding: 0 !important;
}
@media (max-width: 1100px) {
  .hp-single-bottom .related ul.products,
  .hp-single-bottom .upsells ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 20px;
  }
}
@media (max-width: 760px) {
  .hp-single-bottom .related ul.products,
  .hp-single-bottom .upsells ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 28px 14px;
  }
  .woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail {
    width: auto;
    min-width: 0;
  }
  .woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail img,
  .woocommerce-page.woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail img,
  .woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail .hp-cart-thumb-image,
  .woocommerce-page.woocommerce-cart .woocommerce-cart-form table.shop_table td.product-thumbnail .hp-cart-thumb-image {
    width: 108px !important;
    height: auto !important;
  }
}
@media (max-width: 435px) {
  /* The legacy mobile rule in store.css forced a square frame. */
  .hp-featured ul.products li.hp-product-card > a.hp-card-cover,
  .hp-page-content ul.products li.hp-product-card > a.hp-card-cover,
  .hp-archive-page ul.products li.hp-product-card > a.hp-card-cover,
  .hp-single-bottom .related ul.products li.hp-product-card > a.hp-card-cover,
  .hp-single-bottom .upsells ul.products li.hp-product-card > a.hp-card-cover {
    aspect-ratio: 3 / 2 !important;
  }
}

/* 0.9.10: frameless mockups in catalog, homepage, related and upsells.
   No decorative border, background, padding or image-shadow, including hover.
   Keep the 3:2 geometry and "contain" from the previous release. */
.woocommerce ul.products li.product.hp-product-card > a.hp-card-cover,
.hp-featured ul.products li.product.hp-product-card > a.hp-card-cover,
.hp-archive-page ul.products li.product.hp-product-card > a.hp-card-cover,
.hp-page-content ul.products li.product.hp-product-card > a.hp-card-cover,
.hp-single-bottom .related ul.products li.product.hp-product-card > a.hp-card-cover,
.hp-single-bottom .upsells ul.products li.product.hp-product-card > a.hp-card-cover,
.woocommerce ul.products li.product.hp-product-card:hover > a.hp-card-cover,
.woocommerce ul.products li.product.hp-product-card:focus-within > a.hp-card-cover {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.woocommerce ul.products li.product.hp-product-card > a.hp-card-cover::after {
  content: none !important;
  display: none !important;
}
.woocommerce ul.products li.product.hp-product-card > a.hp-card-cover img,
.woocommerce ul.products li.product.hp-product-card:hover > a.hp-card-cover img {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Reliable cart icon. WooCommerce/TranslatePress may put nested markup inside
   the link, so an HTML text replacement alone is not a safe way to draw it.
   The native WooCommerce link and its AJAX/data attributes are kept intact. */
.woocommerce ul.products li.product.hp-product-card .hp-card-action > a.button,
.hp-product-card .hp-card-action > a.button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto;
  font-size: 0 !important;
  line-height: 1 !important;
}
.woocommerce ul.products li.product.hp-product-card .hp-card-action > a.button::before,
.hp-product-card .hp-card-action > a.button::before {
  content: "" !important;
  display: block !important;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIxLjc1IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxjaXJjbGUgY3g9IjkiIGN5PSIyMSIgcj0iMSIvPjxjaXJjbGUgY3g9IjIwIiBjeT0iMjEiIHI9IjEiLz48cGF0aCBkPSJNMSAxaDRsMi43IDEzLjJhMiAyIDAgMCAwIDIgMS42aDkuN2EyIDIgMCAwIDAgMi0xLjZMMjMgNkg2Ii8+PC9zdmc+");
  mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIxLjc1IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxjaXJjbGUgY3g9IjkiIGN5PSIyMSIgcj0iMSIvPjxjaXJjbGUgY3g9IjIwIiBjeT0iMjEiIHI9IjEiLz48cGF0aCBkPSJNMSAxaDRsMi43IDEzLjJhMiAyIDAgMCAwIDIgMS42aDkuN2EyIDIgMCAwIDAgMi0xLjZMMjMgNkg2Ii8+PC9zdmc+");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  opacity: 1;
}
/* The pseudo-icon is always visible: hide the redundant markup icon, not the
   accessible screen-reader label or native WooCommerce button state. */
.hp-product-card .hp-card-action > a.button > svg,
.hp-product-card .hp-card-action > a.button > .hp-cart-action-icon {
  display: none !important;
}
@media (max-width: 435px) {
  .woocommerce ul.products li.product.hp-product-card .hp-card-action > a.button::before,
  .hp-product-card .hp-card-action > a.button::before {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
}
