/* ===============================================================
   PLATVISION - SALD v1.0.0
   Endast enkla produkter dar admin-kryssrutan "Sald" ar markerad.
   =============================================================== */

/* Produktkort i WooCommerce och Elementor Products/Archive Products. */
.woocommerce ul.products li.product.pv-sold-product,
.elementor-widget-woocommerce-products ul.products li.product.pv-sold-product,
.elementor-widget-woocommerce-archive-products ul.products li.product.pv-sold-product {
  position: relative;
}

/* Rod, diskret rosett ovanpa produktbilden i produktarkivet. */
.pv-sold-product .pv-sold-rosette,
body.single-product.pv-sold-page .woocommerce-product-gallery::after {
  content: "Såld";
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 13px;
  right: 13px;
  width: 82px;
  height: 82px;
  box-sizing: border-box;
  padding: 8px;
  z-index: 8;
  pointer-events: none;
  background: radial-gradient(circle at center, #d94a55 0 52%, #b62536 53% 100%);
  color: #ffffff !important;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  letter-spacing: .03em;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 2px rgba(77, 0, 8, .25);
  transform: rotate(-8deg);
  clip-path: polygon(
    50% 0%, 60% 9%, 73% 2%, 78% 15%, 94% 12%, 91% 29%,
    100% 39%, 90% 50%, 100% 61%, 91% 71%, 94% 88%, 78% 85%,
    73% 98%, 60% 91%, 50% 100%, 40% 91%, 27% 98%, 22% 85%,
    6% 88%, 9% 71%, 0% 61%, 10% 50%, 0% 39%, 9% 29%,
    6% 12%, 22% 15%, 27% 2%, 40% 9%
  );
}

/* Pa singelsidan sitter rosetten pa bildgalleriet, inte i dess bildslider. */
body.single-product.pv-sold-page .woocommerce-product-gallery {
  position: relative;
}

/* Sald bredvid produktens benamning (inte i sparat produktnamn). */
.pv-sold-title-label {
  display: inline-block;
  margin-left: .42em;
  vertical-align: baseline;
  color: #df8792 !important;
  font-size: .72em;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: .01em;
  white-space: nowrap;
  text-transform: none;
}

/* Woo skapar normalt en blockrubrik. Bara salda produkter far inline-titel. */
.woocommerce ul.products li.product.pv-sold-product .woocommerce-loop-product__title,
.elementor-widget-woocommerce-products ul.products li.product.pv-sold-product .woocommerce-loop-product__title,
.elementor-widget-woocommerce-archive-products ul.products li.product.pv-sold-product .woocommerce-loop-product__title {
  display: inline;
}

/* Produktens stora titel och Elementors Product Title-widget. */
body.single-product.pv-sold-page .product_title .pv-sold-title-label,
body.single-product.pv-sold-page .elementor-widget-woocommerce-product-title .pv-sold-title-label {
  font-size: .56em;
}

/* Extra visuellt skydd om nagon kopwidget ignorerar WC is_purchasable().
   Den riktiga sparren ligger pa serversidan i PHP-modulen. */
body.single-product.pv-sold-page form.cart,
body.single-product.pv-sold-page .elementor-widget-woocommerce-product-add-to-cart form.cart {
  display: none !important;
}

@media (max-width: 767px) {
  .pv-sold-product .pv-sold-rosette,
  body.single-product.pv-sold-page .woocommerce-product-gallery::after {
    width: 68px;
    height: 68px;
    top: 8px;
    right: 8px;
    font-size: 12px;
  }
}
