/* The colour swatches under each product card: the vendor's stylesheet, rule for rule. */

.cgls-swatches { margin: 15px 0 2px; line-height: 1; user-select: none; }
.cgls-list {
  display: inline-grid;
  grid-template-columns: repeat(5, 25px);
  gap: 8px 9px;
  padding-left: 10px;
  align-items: center;
  justify-items: center;
  max-width: 100%;
}
.archive .cgls-list { padding-left: 0; }

.cgls-swatch {
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 0 solid transparent;
  outline: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  margin: 2px;
  overflow: visible;
  background-clip: padding-box;
  transition: transform 0.12s ease, outline-color 0.12s ease, border-color 0.12s ease;
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
}
.cgls-swatch:hover { transform: scale(1.15); outline-color: rgba(0, 0, 0, 0.45); z-index: 100; }
.cgls-swatch.cgls-active { border-color: #111; outline-color: #111; transform: scale(1.20); z-index: 100; }
.cgls-swatch[style*="#ffffff"],
.cgls-swatch[style*="#fff"],
.cgls-swatch[style*="rgb(255, 255, 255)"] { outline-color: rgba(0, 0, 0, 0.3); }
.cgls-swatch.cgls-hidden { display: none; }

/* The colour's name as a tooltip, from data-tooltip */
.cgls-swatch[data-tooltip] { position: relative; }
.cgls-swatch[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.cgls-swatch[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.cgls-swatch[data-tooltip]:hover::after,
.cgls-swatch[data-tooltip]:hover::before { opacity: 1; visibility: visible; }
.cgls-swatch[data-tooltip]::after,
.cgls-swatch[data-tooltip]::before { transition-delay: 0.1s; }

.cgls-swatch.cgls-type-image { background: #f5f5f5; outline-color: rgba(0, 0, 0, 0.15); }
.cgls-swatch.cgls-type-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50% !important;
  pointer-events: none;
}

.cgls-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 25px;
  white-space: nowrap;
  padding: 0;
  background: transparent;
  color: #333;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  border: 0;
}

/* A chosen colour, or a pointer over the strip, keeps the card's own picture and hides the second one the theme fades in. */
.product.cgls-has-active .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail { opacity: 1 !important; }
.product.cgls-has-active .woocommerce-loop-product__image img.secondary-image { opacity: 0 !important; }
.products.columns-2 .product.cgls-has-active .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-3 .product.cgls-has-active .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-4 .product.cgls-has-active .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-5 .product.cgls-has-active .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-6 .product.cgls-has-active .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-100 .product.cgls-has-active .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail { opacity: 1 !important; }
.products.columns-2 .product.cgls-has-active .woocommerce-loop-product__image img.secondary-image,
.products.columns-3 .product.cgls-has-active .woocommerce-loop-product__image img.secondary-image,
.products.columns-4 .product.cgls-has-active .woocommerce-loop-product__image img.secondary-image,
.products.columns-5 .product.cgls-has-active .woocommerce-loop-product__image img.secondary-image,
.products.columns-6 .product.cgls-has-active .woocommerce-loop-product__image img.secondary-image,
.products.columns-100 .product.cgls-has-active .woocommerce-loop-product__image img.secondary-image { opacity: 0 !important; }
.product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail { opacity: 1 !important; }
.product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.secondary-image { opacity: 0 !important; }
.products.columns-2 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-3 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-4 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-5 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-6 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail,
.products.columns-100 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.attachment-woocommerce_thumbnail { opacity: 1 !important; }
.products.columns-2 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.secondary-image,
.products.columns-3 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.secondary-image,
.products.columns-4 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.secondary-image,
.products.columns-5 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.secondary-image,
.products.columns-6 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.secondary-image,
.products.columns-100 .product:has(.cgls-swatches:hover) .woocommerce-loop-product__image img.secondary-image { opacity: 0 !important; }

/* Every card of a grid row as tall as the row, the strip at its foot. */
ul.products:not(.strapsco-2025-product-slider *) { align-items: stretch !important; }
ul.products:not(.strapsco-2025-product-slider *) > li.product {
  display: flex !important;
  flex-direction: column;
  align-self: stretch !important;
  height: auto;
}
ul.products:not(.strapsco-2025-product-slider *) > li.product > a.woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
ul.products:not(.strapsco-2025-product-slider *) > li.product .cgls-swatches { margin-top: auto; padding-top: 12px; }

/* Where any strip in a grid has two rows, every strip keeps two rows' height, swatches at the top, so rows line up. */
ul.products:not(.strapsco-2025-product-slider *):has(.cgls-list--multi) .cgls-list {
  min-height: 66px;
  align-content: start;
  align-items: start;
}

@media only screen and (max-width: 767px) {
  .cgls-swatches { width: 100%; }
  .cgls-list,
  .archive .cgls-list {
    display: grid;
    grid-template-columns: repeat(5, 22px);
    justify-content: center;
    gap: 8px 8px;
    width: 100%;
    padding-left: 0;
    box-sizing: border-box;
  }
  .cgls-swatch { width: 22px; height: 22px; margin: 0; }
  .cgls-more { margin: 0; height: 22px; font-size: 15px; white-space: nowrap; }
  ul.products:not(.strapsco-2025-product-slider *):has(.cgls-list--multi) .cgls-list { min-height: 52px; }
}

@media only screen and (max-width: 360px) {
  .cgls-list,
  .archive .cgls-list { grid-template-columns: repeat(5, 20px); gap: 6px; }
  .cgls-swatch { width: 20px; height: 20px; }
  ul.products:not(.strapsco-2025-product-slider *):has(.cgls-list--multi) .cgls-list { min-height: 46px; }
  .cgls-more { font-size: 14px; }
}
