/* SW Loyalty frontend: thank-you code block, outlet badges and outlet single product. BEM prefix: .sw-loyalty-… */

.sw-loyalty-coupon {
	box-sizing: border-box;
	max-width: 640px;
	margin: 24px auto;
	padding: 20px 24px;
	border: 2px dashed currentColor;
	border-radius: 8px;
	text-align: center;
}

.sw-loyalty-coupon__heading {
	margin: 0 0 12px;
	font-size: 1.25rem;
}

.sw-loyalty-coupon__code {
	margin: 0 0 12px;
	font-size: 1.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	word-break: break-all;
	user-select: all;
}

.sw-loyalty-coupon p:last-child {
	margin-bottom: 0;
}

/* Outlet badges: sold-out (badge mode only) and "Outlet" (every outlet product). */
.sw-loyalty-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 3px;
	background: #1d2327;
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.sw-loyalty-badge--loop {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
}

.sw-loyalty-badge--single {
	margin-bottom: 12px;
}

li.product:has(.sw-loyalty-badge--loop) {
	position: relative;
}

/* "Outlet" badge: yellow with a black frame, top left of the card. Sale flash is red and top right,
   the sold-out badge is black; when both outlet and sold-out show, sold-out moves below. */
.sw-loyalty-badge--outlet {
	border: 1px solid #000;
	background: #ffdd55;
	color: #000;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.sw-loyalty-badge--outlet.sw-loyalty-badge--loop ~ .sw-loyalty-badge--soldout.sw-loyalty-badge--loop {
	top: 44px;
}

.sw-loyalty-badge--outlet.sw-loyalty-badge--single {
	margin-right: 8px;
}

/* Outlet single product: fixed variant chips (same frame as the theme's variation block). */
.sw-loyalty-outlet-options {
	margin: 0;
	padding: 1rem 0;
	border-top: 2px solid rgba(255, 221, 85, 0.2);
	border-bottom: 2px solid rgba(255, 221, 85, 0.2);
}

.sw-loyalty-outlet-options__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sw-loyalty-outlet-options__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 38px;
	margin: 0;
	padding: 0 0.85rem;
	border: 1px solid #ffdd55;
	border-radius: 10px;
	background: #ffdd55;
	color: #000;
	font-size: 0.9rem;
	line-height: 1.2;
}

.sw-loyalty-outlet-options__label {
	font-weight: 600;
	opacity: 0.75;
}

.sw-loyalty-outlet-options__value {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Outlet add-to-cart row: the wrapper carries the theme's variable-product classes, so quantity above the button,
   gap and button styling come from the theme. The chips block replaces the variations table, so its bottom
   margin is dropped (the wrapper's own 2rem top margin then matches variable products). */
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart.variations_button.sw-loyalty-outlet-cart {
	margin-top: 2rem;
}

/* One piece in stock: no quantity control (the hidden-by-CSS input still submits 1). */
.sw-loyalty-outlet-cart.sw-loyalty-outlet-cart--single .quantity,
.sw-loyalty-outlet-cart.sw-loyalty-outlet-cart--single .quantity.buttons-added {
	display: none;
}

/* Outlet price (OutletPresentation::strikethrough_price): old price above, outlet price below. Used on the single
   product, loop cards and quick view. The theme colours and sizes prices with high-specificity (and a few !important)
   rules per surface, so the properties that must win here are !important; the selectors are scoped to our own
   wrapper class, nothing else is affected. */
/* Flex column so the two prices stack even where the theme makes del/ins inline-flex or the price a flex row. */
.sw-loyalty-outlet-price {
	display: inline-flex !important;
	flex-direction: column !important;
	align-items: flex-start;
	gap: 2px;
	white-space: normal !important;
	line-height: 1.15;
}

.sw-loyalty-outlet-price del,
.sw-loyalty-outlet-price ins {
	display: block !important;
	margin: 0 !important;
}

.sw-loyalty-outlet-price del {
	font-size: max(12px, 0.7em) !important;
	font-weight: 400 !important;
	color: #9e9e9e !important;
	opacity: 1 !important;
	text-decoration: line-through;
	text-decoration-color: #9e9e9e !important;
}

.sw-loyalty-outlet-price ins {
	font-size: 1.1em !important;
	font-weight: 700 !important;
	color: #ff3c38 !important;
	text-decoration: none;
}

.sw-loyalty-outlet-price del .woocommerce-Price-amount,
.sw-loyalty-outlet-price del .woocommerce-Price-amount bdi {
	color: #9e9e9e !important;
	font-weight: 400 !important;
}

.sw-loyalty-outlet-price ins .woocommerce-Price-amount,
.sw-loyalty-outlet-price ins .woocommerce-Price-amount bdi {
	color: #ff3c38 !important;
	font-weight: 700 !important;
}

/* The single product page frames the currency symbol as a yellow badge; in a two-line price it reads as noise. */
.sw-loyalty-outlet-price .woocommerce-Price-currencySymbol,
.sw-loyalty-outlet-panel .woocommerce-Price-currencySymbol {
	top: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

/* Single product price panel (OutletPresentation::price_panel): eyebrow, big outlet price, saving pill, regular price. */
.sw-loyalty-outlet-panel {
	display: flex !important;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	box-sizing: border-box;
	max-width: 100%;
	margin: 4px 0 8px;
	padding: 10px 14px 11px;
	border-left: 3px solid #ff3c38;
	border-radius: 0 4px 4px 0;
	background: rgba(255, 255, 255, 0.04);
	line-height: 1.2;
	white-space: normal !important;
}

.sw-loyalty-outlet-panel__eyebrow {
	color: rgba(255, 255, 255, 0.65);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.sw-loyalty-outlet-panel__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
}

.sw-loyalty-outlet-panel .sw-loyalty-outlet-panel__now {
	margin: 0 !important;
	color: #ff3c38 !important;
	font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem) !important;
	font-weight: 800 !important;
	text-decoration: none;
}

.sw-loyalty-outlet-panel .sw-loyalty-outlet-panel__now .woocommerce-Price-amount,
.sw-loyalty-outlet-panel .sw-loyalty-outlet-panel__now .woocommerce-Price-amount bdi {
	color: #ff3c38 !important;
	font-size: inherit !important;
	font-weight: 800 !important;
}

.sw-loyalty-outlet-panel__save {
	padding: 3px 8px;
	border-radius: 4px;
	background: #ffdd55;
	color: #000;
	font-size: 0.8rem;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
}

.sw-loyalty-outlet-panel .sw-loyalty-outlet-panel__was {
	color: #9e9e9e;
	font-size: 0.85rem;
	font-weight: 400;
}

.sw-loyalty-outlet-panel .sw-loyalty-outlet-panel__was del,
.sw-loyalty-outlet-panel .sw-loyalty-outlet-panel__was del .woocommerce-Price-amount,
.sw-loyalty-outlet-panel .sw-loyalty-outlet-panel__was del .woocommerce-Price-amount bdi {
	margin: 0 !important;
	color: #9e9e9e !important;
	font-size: inherit !important;
	font-weight: 400 !important;
	opacity: 1 !important;
	text-decoration: line-through;
	text-decoration-color: #9e9e9e !important;
}

.sw-loyalty-outlet-panel .woocommerce-Price-currencySymbol {
	margin-left: 0.25em !important;
	font-size: 0.6em !important;
	opacity: 1 !important;
}

/* Cart: applied coupons block under the cart table (CartAppliedCoupons, templates/cart-applied-coupons.php). */
.sw-loyalty-applied-coupons {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin: 1rem 0;
}

.sw-loyalty-applied-coupon {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.75rem;
	box-sizing: border-box;
	max-width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px dashed rgba(255, 221, 85, 0.75);
	border-radius: 4px;
	background: rgba(255, 221, 85, 0.06);
	color: #ffdd55;
	line-height: 1.25;
}

.sw-loyalty-applied-coupon__icon {
	flex: 0 0 1.25rem;
	width: 1.25rem;
	height: 1.25rem;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9a2 2 0 0 0 0 6v3a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-3a2 2 0 0 1 0-6V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1z'/%3E%3Cpath d='M14 5v2M14 11v2M14 17v2'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9a2 2 0 0 0 0 6v3a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-3a2 2 0 0 1 0-6V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1z'/%3E%3Cpath d='M14 5v2M14 11v2M14 17v2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sw-loyalty-applied-coupon__body {
	display: flex;
	flex: 1 1 8rem;
	flex-direction: column;
	min-width: 0;
}

.sw-loyalty-applied-coupon__label {
	color: #bdbdbd;
	font-size: 0.75rem;
}

.sw-loyalty-applied-coupon__code {
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.sw-loyalty-applied-coupon__amount,
.sw-loyalty-applied-coupon__amount .woocommerce-Price-amount {
	color: #ffdd55;
	font-weight: 800;
}

/* Info note: tooltip on hover, keyboard focus and tap (the span is focusable, so a tap focuses it). */
.sw-loyalty-applied-coupon__note {
	display: inline-block;
	flex: 0 0 auto;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 50%;
	color: #fff;
	cursor: help;
	opacity: 0.75;
}

.sw-loyalty-applied-coupon__note::before {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v6'/%3E%3Cpath d='M12 7.5h.01'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v6'/%3E%3Cpath d='M12 7.5h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Positioned against the chip (the note itself is static), so it never leaves the chip's width plus 260px cap. */
.sw-loyalty-applied-coupon__note::after {
	content: attr(data-note);
	position: absolute;
	right: 0;
	bottom: calc(100% + 8px);
	left: auto;
	z-index: 20;
	box-sizing: border-box;
	width: max-content;
	max-width: min(260px, 100%);
	padding: 6px 10px;
	border: 1px solid rgba(255, 221, 85, 0.5);
	border-radius: 4px;
	background: #000;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.35;
	text-align: left;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.sw-loyalty-applied-coupon__note:hover,
.sw-loyalty-applied-coupon__note:focus {
	opacity: 1;
}

.sw-loyalty-applied-coupon__note:hover::after,
.sw-loyalty-applied-coupon__note:focus::after {
	opacity: 1;
	visibility: visible;
}

.sw-loyalty-applied-coupon__note:focus-visible,
.sw-loyalty-applied-coupon__remove:focus-visible {
	outline: 2px solid #ffdd55;
	outline-offset: 2px;
}

.sw-loyalty-applied-coupon__remove {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 4px;
	color: #fff;
	font-size: 1.1rem;
	line-height: 1;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.sw-loyalty-applied-coupon__remove:hover,
.sw-loyalty-applied-coupon__remove:focus-visible {
	border-color: #ff3c38;
	color: #ff3c38;
}
