/* Fast Checkout — offer badges.
   Everything is under .fc-offer-* so nothing here can reach a theme rule,
   and colours are never set in this file: they come from the merchant's
   choices as inline styles, validated before they are stored. */

/* The loop thumbnail, wrapped, so a corner means a corner of the photo. */
.fc-offer-wrap {
  position: relative;
  display: block;
}

/* A theme that draws the thumbnail elsewhere gets no wrapper to fill, so the
   badges hang off the card instead and the card must be a positioning box. */
.woocommerce ul.products li.product.fc-has-badges {
  position: relative;
}

.fc-offer-wrap--bare {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fc-offer-badges {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: calc(100% - 16px);
  pointer-events: none;
}

.fc-offer-badges--tl { top: 8px; left: 8px;  align-items: flex-start; }
.fc-offer-badges--tr { top: 8px; right: 8px; align-items: flex-end; }
.fc-offer-badges--bl { bottom: 8px; left: 8px;  align-items: flex-start; }
.fc-offer-badges--br { bottom: 8px; right: 8px; align-items: flex-end; }

/* Both corners of one edge in use: each keeps to its own half. */
.fc-offer-wrap--split-top > .fc-offer-badges--tl,
.fc-offer-wrap--split-top > .fc-offer-badges--tr,
.fc-offer-wrap--split-bottom > .fc-offer-badges--bl,
.fc-offer-wrap--split-bottom > .fc-offer-badges--br {
  max-width: calc(50% - 10px);
}

/* The theme's own sale label, where it carries one of ours. The PHP filter
   handles themes that build it through woocommerce_sale_flash; this catches
   the ones (Woodmart) that print .onsale themselves. On the product page
   only the main gallery's label goes -- related products keep theirs
   unless they have a badge of their own. */
.fc-hide-sale .fc-has-badges .onsale,
.fc-hide-sale.fc-single-badged .woocommerce-product-gallery .onsale,
.fc-hide-sale.fc-single-badged div.product > .onsale {
  display: none !important;
}

/* Product page: a row above the title, no corners. */
.fc-offer-badges--inline {
  position: static;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  max-width: none;
  margin: 0 0 10px;
  pointer-events: auto;
}

.fc-offer-badge {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  padding: 3px 9px;
  font-family: inherit;
  font-size: clamp(10px, 2.6vw, 13px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.fc-offer-badges--inline .fc-offer-badge {
  font-size: 13px;
}

.fc-offer-badge--rect    { border-radius: 0; }
.fc-offer-badge--rounded { border-radius: 4px; }
.fc-offer-badge--pill    { border-radius: 999px; padding-left: 11px; padding-right: 11px; }

/* Ribbon: a strip with a pointed end, pointing away from its corner. */
.fc-offer-badge--ribbon {
  border-radius: 0;
  box-shadow: none;
  padding-right: 15px;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 0 100%);
}

.fc-offer-badges--tr .fc-offer-badge--ribbon,
.fc-offer-badges--br .fc-offer-badge--ribbon {
  padding-right: 9px;
  padding-left: 15px;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 7px 100%, 0 50%);
}

/* Small screens: the photo is small too, so the badge tucks in tighter and
   never grows past it. */
@media (max-width: 480px) {
  .fc-offer-badges {
    gap: 3px;
    max-width: calc(100% - 10px);
  }
  .fc-offer-badges--tl,
  .fc-offer-badges--tr { top: 5px; }
  .fc-offer-badges--bl,
  .fc-offer-badges--br { bottom: 5px; }
  .fc-offer-badges--tl,
  .fc-offer-badges--bl { left: 5px; }
  .fc-offer-badges--tr,
  .fc-offer-badges--br { right: 5px; }

  .fc-offer-badge {
    padding: 2px 7px;
    letter-spacing: .01em;
  }
}
