/*
 * TA Sale Frames: frames on product tiles. Rules apply only to tiles that carry
 * .ta-sf-on, so a page with nothing live is untouched. Each rule has two selectors:
 * the WooCommerce li.product (its old weight, which beats theme card rules) and a
 * generic .ta-sf-tile root for theme cards (div, article). Colours come from
 * three custom properties (--ta-sf-main / --ta-sf-ink / --ta-sf-accent).
 */

.ta-sf-data {
	display: none;
}

/* The theme clips tiles (overflow hidden); the pill and coupon notches sit on the edge. */
.woocommerce ul.products li.product.ta-sf-on,
.ta-sf-tile.ta-sf-on {
	position: relative;
	overflow: visible;
	box-sizing: border-box;
	border-style: solid;
	border-color: var(--ta-sf-main);
	border-width: 3px;
	border-radius: 12px;
	--ta-sf-pad: 15px;
	padding-left: var(--ta-sf-pad) !important;
	padding-right: var(--ta-sf-pad) !important;
}

/* Defaults per style. */
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-red-pill,
.ta-sf-tile.ta-sf-on.ta-sf-style-red-pill { --ta-sf-main: #cc0000; --ta-sf-ink: #fff; }
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-dark-bar,
.ta-sf-tile.ta-sf-on.ta-sf-style-dark-bar { --ta-sf-main: #161616; --ta-sf-ink: #fff; }
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-coupon,
.ta-sf-tile.ta-sf-on.ta-sf-style-coupon { --ta-sf-main: #cc0000; --ta-sf-ink: #161616; }
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-green-gold,
.ta-sf-tile.ta-sf-on.ta-sf-style-green-gold { --ta-sf-main: #0f5132; --ta-sf-ink: #f3e3b0; --ta-sf-accent: #b8912a; }
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-flag,
.ta-sf-tile.ta-sf-on.ta-sf-style-flag { --ta-sf-main: #01411c; --ta-sf-ink: #fff; }
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-countdown,
.ta-sf-tile.ta-sf-on.ta-sf-style-countdown { --ta-sf-main: #161616; --ta-sf-ink: #fff; }

/* Label elements share a base. */
.ta-sf-pill,
.ta-sf-bar,
.ta-sf-ticket,
.ta-sf-strip {
	display: block;
	box-sizing: border-box;
	font-family: inherit;
	font-style: normal;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	position: relative;
	z-index: 2;
}

/* 1. red-pill: pill on the top edge, end date strip at the bottom */
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-red-pill,
.ta-sf-tile.ta-sf-on.ta-sf-style-red-pill {
	margin-top: 16px;
	padding-top: 14px !important;
}
.ta-sf-pill {
	position: absolute;
	top: -15px;
	left: 50%;
	transform: translateX(-50%);
	width: auto;
	background: var(--ta-sf-main);
	color: var(--ta-sf-ink);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 1px;
	padding: 6px 16px;
	border-radius: 999px;
	white-space: nowrap;
	z-index: 3;
}
.ta-sf-style-red-pill .ta-sf-strip {
	background: var(--ta-sf-main);
	color: var(--ta-sf-ink);
	font-size: 12px;
	font-weight: 600;
	padding: 7px 0;
	margin: 8px calc(-3px - var(--ta-sf-pad)) calc(-3px - 15px);
	border-radius: 0 0 9px 9px;
}

/* 2 / 4 / 5. title bar above the photo, merged into the frame */
.ta-sf-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: -3px calc(-3px - var(--ta-sf-pad)) 10px;
	padding: 10px 6px;
	background: var(--ta-sf-main);
	color: var(--ta-sf-ink);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 3px;
	border-radius: 9px 9px 0 0;
}
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-dark-bar,
.ta-sf-tile.ta-sf-on.ta-sf-style-dark-bar {
	border-width: 6px;
	padding-bottom: 0;
}
.ta-sf-style-dark-bar .ta-sf-bar {
	margin: -6px calc(-6px - var(--ta-sf-pad)) 10px;
}
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-green-gold,
.ta-sf-tile.ta-sf-on.ta-sf-style-green-gold {
	overflow: hidden;
	box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--ta-sf-accent);
}
.ta-sf-style-green-gold .ta-sf-bar,
.ta-sf-style-flag .ta-sf-bar {
	letter-spacing: 1.5px;
}
.ta-sf-style-green-gold .ta-sf-bar {
	font-weight: 700;
	padding: 9px 6px;
	border-radius: 0;
}
.ta-sf-crescent {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
}
.ta-sf-bar-text {
	min-width: 0;
}

/* 3. coupon: dashed edge, big label left / sublabel right, four cut corners */
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-coupon,
.ta-sf-tile.ta-sf-on.ta-sf-style-coupon {
	border-style: dashed;
	border-width: 2px;
	border-radius: 6px;
	padding: 6px 14px 14px !important;
}
.ta-sf-ticket {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 6px 10px 2px;
	text-align: left;
}
.ta-sf-ticket-label {
	font-size: 22px;
	font-weight: 800;
	color: var(--ta-sf-main);
	letter-spacing: -0.5px;
}
.ta-sf-ticket-sub {
	font-size: 11px;
	font-weight: 700;
	color: var(--ta-sf-ink);
	letter-spacing: 1.5px;
	text-align: right;
}
.ta-sf-notch {
	position: absolute;
	box-sizing: border-box;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #f5f5f5;
	border: 2px solid var(--ta-sf-main);
	z-index: 3;
}
.ta-sf-notch-tl { top: -11px; left: -11px; }
.ta-sf-notch-tr { top: -11px; right: -11px; }
.ta-sf-notch-bl { bottom: -11px; left: -11px; }
.ta-sf-notch-br { bottom: -11px; right: -11px; }

/* 5. flag: white band on the left, green frame */
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-flag,
.ta-sf-tile.ta-sf-on.ta-sf-style-flag {
	overflow: hidden;
	padding-left: 22px !important;
	background-image: linear-gradient(90deg, #fff 0, #fff 19px, var(--ta-sf-main) 19px, var(--ta-sf-main) 22px, transparent 22px);
	background-repeat: no-repeat;
}
.ta-sf-style-flag .ta-sf-bar {
	margin: -3px calc(-3px - var(--ta-sf-pad)) 10px 0;
	border-radius: 0;
}

/* 6. countdown strip */
.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-countdown,
.ta-sf-tile.ta-sf-on.ta-sf-style-countdown {
	border-width: 2px;
	overflow: hidden;
}
.ta-sf-strip-count {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 8px calc(-2px - var(--ta-sf-pad)) calc(-2px - 15px);
	padding: 9px 0;
	background: var(--ta-sf-main);
	color: var(--ta-sf-ink);
}
.ta-sf-strip-text {
	font-size: 12px;
	font-weight: 600;
	opacity: 0.87;
}
.ta-sf-count {
	font-size: 15px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: 1px;
}

/* Countdown strip on the styles that have no bottom strip of their own (last 48 hours only). */
.ta-sf-style-dark-bar .ta-sf-strip-count {
	margin: 8px calc(-6px - var(--ta-sf-pad)) calc(-6px - 15px);
	border-radius: 0 0 6px 6px;
}
.ta-sf-style-coupon .ta-sf-strip-count {
	margin: 8px -16px -16px;
	border-radius: 0 0 4px 4px;
	color: #fff;
}
.ta-sf-style-green-gold .ta-sf-strip-count,
.ta-sf-style-flag .ta-sf-strip-count {
	margin: 8px calc(-3px - var(--ta-sf-pad)) calc(-3px - 15px) 0;
}
.ta-sf-style-green-gold .ta-sf-strip-count {
	margin-left: calc(-3px - var(--ta-sf-pad));
}

/* Phones: two-column grid. */
@media (max-width: 480px) {
	.woocommerce ul.products li.product.ta-sf-on,
	.ta-sf-tile.ta-sf-on {
		border-radius: 10px;
	}
	.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-coupon,
	.ta-sf-tile.ta-sf-on.ta-sf-style-coupon {
		border-radius: 6px;
	}
	.ta-sf-pill {
		top: -12px;
		font-size: 10px;
		letter-spacing: 0.5px;
		padding: 4px 10px;
		max-width: 96%;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-red-pill,
	.ta-sf-tile.ta-sf-on.ta-sf-style-red-pill {
		margin-top: 12px;
		padding-top: 10px !important;
	}
	.ta-sf-style-red-pill .ta-sf-strip {
		font-size: 11px;
		padding: 5px 0;
	}
	.ta-sf-bar {
		font-size: 10px;
		letter-spacing: 2px;
		padding: 7px 4px;
		margin-bottom: 6px;
	}
	.ta-sf-style-green-gold .ta-sf-bar,
	.ta-sf-style-flag .ta-sf-bar {
		letter-spacing: 1px;
	}
	.ta-sf-crescent {
		width: 14px;
		height: 14px;
	}
	.ta-sf-ticket {
		padding: 4px 6px 0;
	}
	.ta-sf-ticket-label {
		font-size: 16px;
	}
	.ta-sf-ticket-sub {
		font-size: 9px;
		letter-spacing: 0.5px;
	}
	.woocommerce ul.products li.product.ta-sf-on.ta-sf-style-flag,
	.ta-sf-tile.ta-sf-on.ta-sf-style-flag {
		padding-left: 14px !important;
		background-image: linear-gradient(90deg, #fff 0, #fff 11px, var(--ta-sf-main) 11px, var(--ta-sf-main) 14px, transparent 14px);
	}
	.ta-sf-strip-count {
		flex-direction: column;
		gap: 2px;
		padding: 6px 4px;
	}
	.ta-sf-strip-text {
		font-size: 10px;
	}
	.ta-sf-count {
		font-size: 12px;
		letter-spacing: 0.5px;
	}
}
