/* A5 Custom Product Badges v2.0.0 */

/* Base badge container */
.a5-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--a5-badge-w, 76px);
  height: var(--a5-badge-h, 76px);
  pointer-events: none;
  z-index: 9;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  box-sizing: border-box;
}

.a5-badge .a5-badge-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.a5-badge .a5-badge-text {
  position: relative;
  font-weight: 800;
  text-transform: uppercase;
  font-size: var(--a5-badge-fs, 11px);
  line-height: 1.1;
  text-align: center;
  padding: 0 6px;
  max-width: 75%;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 2;
  box-sizing: border-box;
}

/* Shape-specific styling */
.a5-badge.a5-shape-starburst .a5-badge-text {
  max-width: 68%;
}

.a5-badge.a5-shape-circle .a5-badge-text {
  max-width: 78%;
}

.a5-badge.a5-shape-square .a5-badge-text {
  max-width: 82%;
}

.a5-badge.a5-shape-rectangle {
  width: var(--a5-badge-w, 104px);
  height: var(--a5-badge-h, 52px);
}

.a5-badge.a5-shape-rectangle .a5-badge-text {
  max-width: 88%;
  padding: 0 8px;
}

.a5-badge.a5-shape-heart .a5-badge-text {
  max-width: 68%;
  padding-bottom: 8px;
}

.a5-badge.a5-shape-shield .a5-badge-text {
  max-width: 74%;
  padding-bottom: 6px;
}

.a5-badge.a5-shape-hexagon .a5-badge-text {
  max-width: 78%;
}

.a5-badge.a5-shape-ribbon {
  height: var(--a5-badge-h, 88px);
}

.a5-badge.a5-shape-ribbon .a5-badge-text {
  max-width: 78%;
  padding-bottom: 14px;
}

/* Corner positioning */
ul.products li.product,
.woocommerce ul.products li.product,
.woocommerce div.product .images,
.woocommerce div.product div.images {
  position: relative;
}

.a5-pos-top-left {
  top: 8px;
  left: 8px;
  transform-origin: top left;
}

.a5-pos-top-right {
  top: 8px;
  right: 8px;
  transform-origin: top right;
}

.a5-pos-bottom-left {
  bottom: 8px;
  left: 8px;
  transform-origin: bottom left;
}

.a5-pos-bottom-right {
  bottom: 8px;
  right: 8px;
  transform-origin: bottom right;
}

/* Scale badge on single product page */
.woocommerce div.product .images .a5-badge,
.woocommerce div.product div.images .a5-badge {
  transform: scale(1.25);
}

/* ── Buy X for RX badge ── */
.a5-buy-x-rx {
  background: #e10600;
  border-radius: 8px;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  filter: none;
}

.a5-buy-x-rx-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
}

.a5-buy-x-rx-qty {
  font-size: 20px;
}

.a5-buy-x-rx-label {
  font-size: 9px;
  letter-spacing: 1px;
  opacity: 0.9;
}

.a5-buy-x-rx-price {
  font-size: 14px;
}

/* Scale Buy X badge on larger archive tiles */
@media (min-width: 480px) {
  ul.products li.product .a5-buy-x-rx .a5-buy-x-rx-qty {
    font-size: 22px;
  }

  ul.products li.product .a5-buy-x-rx .a5-buy-x-rx-label {
    font-size: 9px;
  }

  ul.products li.product .a5-buy-x-rx .a5-buy-x-rx-price {
    font-size: 15px;
  }
}

@media (min-width: 768px) {
  ul.products li.product .a5-buy-x-rx .a5-buy-x-rx-qty {
    font-size: 24px;
  }

  ul.products li.product .a5-buy-x-rx .a5-buy-x-rx-label {
    font-size: 10px;
  }

  ul.products li.product .a5-buy-x-rx .a5-buy-x-rx-price {
    font-size: 17px;
  }
}

/* Single product page: larger Buy X badge text */
.woocommerce div.product .images .a5-buy-x-rx .a5-buy-x-rx-qty,
.woocommerce div.product div.images .a5-buy-x-rx .a5-buy-x-rx-qty {
  font-size: 26px;
}

.woocommerce div.product .images .a5-buy-x-rx .a5-buy-x-rx-label,
.woocommerce div.product div.images .a5-buy-x-rx .a5-buy-x-rx-label {
  font-size: 10px;
}

.woocommerce div.product .images .a5-buy-x-rx .a5-buy-x-rx-price,
.woocommerce div.product div.images .a5-buy-x-rx .a5-buy-x-rx-price {
  font-size: 18px;
}

@media (min-width: 768px) {
  .woocommerce div.product .images .a5-buy-x-rx .a5-buy-x-rx-qty,
  .woocommerce div.product div.images .a5-buy-x-rx .a5-buy-x-rx-qty {
    font-size: 30px;
  }

  .woocommerce div.product .images .a5-buy-x-rx .a5-buy-x-rx-label,
  .woocommerce div.product div.images .a5-buy-x-rx .a5-buy-x-rx-label {
    font-size: 11px;
  }

  .woocommerce div.product .images .a5-buy-x-rx .a5-buy-x-rx-price,
  .woocommerce div.product div.images .a5-buy-x-rx .a5-buy-x-rx-price {
    font-size: 21px;
  }
}

/* ── Admin Live Preview Styling ── */
.a5-admin-preview-container {
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.a5-admin-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #50575e;
  letter-spacing: 0.5px;
}

.a5-admin-preview-stage {
  background: #ffffff;
  border: 1px dashed #c3c4c7;
  border-radius: 6px;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.a5-admin-preview-stage::before {
  content: "PRODUCT PREVIEW";
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  color: #dcdcde;
  letter-spacing: 1px;
  pointer-events: none;
}

.a5-admin-field-row {
  margin-bottom: 12px;
}

.a5-admin-field-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 12px;
}

.a5-admin-inline-group {
  display: flex;
  gap: 8px;
}

.a5-admin-inline-group > div {
  flex: 1;
}

.a5-admin-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1d2327;
  padding-bottom: 6px;
  margin-top: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid #dcdcde;
}