/* Klassisen WooCommerce-tuotekortin (content-product.php) tyylit. Käytössä
   kaikkialla missä tämä template renderöityy natiivien lohkojen ulkopuolella:
   etusivun tuotekarusellit, korin cross-sells-modaali, tuotesivun
   "muut brändituotteet" -lohko. WooCommerce ei tarjoa tälle valmista ulkoasua
   lohkoteemoissa (vain tyhjä woocommerce-blocktheme.css).

   Elementtijärjestys ylhäältä alas: kuva (neliö) → tuotemerkki → tuotenimi →
   hinta (+ alennushinta) → arvostelutähdet → Osta-painike. Tuotemerkki ja
   järjestys on toteutettu cosmetsky-woo-core/includes/product-loop.php:ssä. */

li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	overflow: hidden;
	list-style: none;
}

li.product .woocommerce-loop-product__link {
	display: flex;
	flex-direction: column;
	flex: 1;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	padding-bottom: 14px;
}

li.product img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: var(--wp--preset--color--background);
}

li.product .cosmetsky-loop-product-brand {
	margin: 12px 14px 0;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--contrast);
	opacity: 0.8;
}

li.product .woocommerce-loop-product__title {
	margin: 4px 14px 6px;
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

li.product .price {
	margin: 0 14px 6px;
	font-weight: 600;
}

li.product .price del {
	font-weight: 400;
	opacity: 0.55;
	margin-right: 6px;
	text-decoration: line-through;
	font-size: 0.9em;
}

li.product .price ins {
	text-decoration: none;
	color: var(--wp--preset--color--accent);
}

li.product .rrp-price {
	display: block;
	font-size: 0.75rem;
	font-weight: 400;
	opacity: 0.6;
}

li.product .star-rating {
	margin: 0 14px 10px;
	overflow: hidden;
	position: relative;
	height: 1em;
	line-height: 1;
	font-size: 0.85rem;
	width: 5.4em;
	font-family: WooCommerce;
}

li.product .star-rating::before {
	content: "sssss";
	color: var(--wp--preset--color--border);
	float: left;
	top: 0;
	left: 0;
	position: absolute;
}

li.product .star-rating span {
	overflow: hidden;
	float: left;
	top: 0;
	left: 0;
	position: absolute;
	padding-top: 1.5em;
}

li.product .star-rating span::before {
	content: "SSSSS";
	top: 0;
	position: absolute;
	left: 0;
	color: var(--wp--preset--color--accent);
}

li.product .button {
	margin: auto 14px 0;
	display: block;
	text-align: center;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border-radius: 999px;
	padding: 0.55em 1em;
	text-decoration: none;
	font-size: 0.9rem;
}

/* Alennusbadge (WooCommercen oma .onsale) */
/* WooCommercen omassa woocommerce.css:ssä .onsale on iso pyöreä badge
   (min-height/min-width/line-height ~3.236em, oikealle sijoitettu). Jokainen
   sen asettama ominaisuus pitää ohittaa erikseen — CSS-spesifisyys ratkeaa
   ominaisuuskohtaisesti, ei koko säännön tasolla, joten pelkkä tausta/koko
   ei riitä jos esim. right/margin/line-height jäävät asettamatta.
   .onsale.onsale (luokka toistettuna) nostaa spesifisyyden WooCommercen omaa
   .onsale-sääntöä korkeammaksi, jotta voitamme varmasti riippumatta siitä
   missä järjestyksessä woocommerce.css ja tämä tiedosto latautuvat. */
li.product .onsale,
.onsale.onsale {
	position: absolute;
	top: 15px;
	left: 15px;
	right: auto;
	margin: 0;
	min-height: 0;
	min-width: 0;
	line-height: 1;
	text-align: left;
	border: none;
	background: #e00;
	color: #fff;
	padding: 5px 6px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 3px;
	z-index: 10;
}

/* Uutuus-badge */
.custom-new-badge {
	position: absolute;
	top: 15px;
	right: 15px;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 3px;
	z-index: 10;
}

/* Trending-badge: samassa kohdassa kuin .onsale, ellei tuote ole alennuksessa
   — jolloin se väistyy alemmas (ks. cosmetsky_trending_badge_class() blocks.php:ssä) */
.custom-trending-badge {
	position: absolute;
	top: 45px;
	left: 15px;
	background: linear-gradient(135deg, #ff3d00, #ff9800);
	color: #fff;
	padding: 5px 6px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 3px;
	line-height: 1;
	z-index: 10;
}

.custom-trending-badge--top {
	top: 15px;
}
