/**
 * FTM Yotpo Loyalty — front-end styles.
 *
 * CUSTOM PROPERTY FALLBACKS (#64)
 *
 * This stylesheet consumes 17 custom properties and defines none of them; they
 * all come from the active theme. An undefined var() does not degrade gracefully
 * — the declaration becomes invalid at computed-value time and resolves to
 * `unset`, which for a non-inherited property means its INITIAL value. So
 * `background-color` goes transparent, `padding` goes to 0 and `max-width` goes
 * to `none`, rather than merely looking slightly off.
 *
 * Every colour and spacing var therefore carries a literal fallback, and the
 * values are taken from Annalee's own design system rather than invented. Per
 * ROADMAP Open Question 6 this plugin is Annalee-specific for now, so the right
 * fallback is the value the theme would have supplied, not a neutral stand-in:
 *
 *   --color-primary   #c81e11   theme --color-primary-500
 *   --red-dark        #6d1b25   theme --color-primary-800
 *   --blue-dark       #1b227a   theme --color-secondary-800  (see below)
 *   --color-black     #303133   theme --black
 *   --color-white     #fff      theme --white
 *   --gray-xlight     #f8f8f8   theme --color-neutral-100
 *   --space-xsmall    0.5rem    0.5  x theme --space-unit (1rem)
 *   --space-small     0.75rem   0.75 x --space-unit
 *   --space-normal    1rem      --space-unit
 *   --space-medium    1.25rem   1.25 x --space-unit
 *   --max-width-wide  1200px    theme literal
 *
 * NOT a no-op on annalee-dolls. Two of the seventeen are undefined on that site
 * TODAY: --blue-dark is defined nowhere at all, and --green only inside Yoast's
 * admin CSS, which never loads on the front end. So four declarations currently
 * resolve to `transparent` on the live rewards page:
 *
 *   .how-it-works-number.one    step 1 circle   (step 2 uses --color-primary and
 *   .how-it-works-number.three  step 3 circle    IS defined, so 1 and 3 render
 *   .dabblin-decorator header   VIP tier card    unstyled beside a styled step 2)
 *   .clever-collector header    VIP tier card
 *
 * These fallbacks therefore FIX a visible live defect rather than guarding a
 * hypothetical one. Two of the values are judgement calls of different strength,
 * and should be confirmed by whoever owns the rewards page design:
 *
 *   --blue-dark  Strong basis. The theme defines --red-dark as
 *                --color-primary-800, so --color-secondary-800 (#1b227a) is the
 *                symmetric choice from the same scale.
 *   --green      NO basis. Annalee's palette has red (primary), blue (secondary)
 *                and neutrals — there is no green scale at all, so this variable
 *                was always going to resolve to nothing. #1b7a4a is picked to sit
 *                alongside the other two at similar weight, and is the one value
 *                here that is genuinely invented. See #64.
 *
 * The three `font:` shorthand vars (--body-large, --label-large, --label-small)
 * are deliberately left BARE. `font` is an inherited property, so an undefined
 * var resolves to `inherit` — the element simply takes the parent's typography,
 * which is the correct degradation. A literal fallback would have to name a
 * font-family and would therefore OVERRIDE the host theme's fonts, which is
 * strictly worse than inheriting them.
 */

/***********************
 #Rewards Page
 **********************/


/* Welcome section */
.rewards-welcome {
	text-align: center;
}

.rewards-welcome-text {
	font-size: 1.3333em;
	font-weight: 700;
}

.rewards-welcome-text p {
	line-height: 1;
	margin: 1rem 0;
}

.ftm-yotpo-point-balance {
	color: var(--color-primary, #c81e11);
}

/* How It Works section (only shows if not logged in) */

.column-text {
	text-align: center;
}

.how-it-works-number {
	align-items: center;
	border-radius: 50%;
	color: var(--color-white, #fff);
	display: flex;
	font-size: 1.3333em;
	height: 4rem;
	justify-content: center;
	margin: 0 auto;
	width: 4rem;
}

.how-it-works-number.one {
	background-color: var(--blue-dark, #1b227a);
}

.how-it-works-number.two {
	background-color: var(--color-primary, #c81e11);
}

.how-it-works-number.three {
	background-color: var(--green, #1b7a4a);
}

.ftm-yotpo-tier {
	background-color: var(--gray-xlight, #f8f8f8);
	height: 100%;
	min-height: 100%;
}

.ftm-yotpo-tier-header {
	color: var(--color-white, #fff);
	padding: var(--space-xsmall, 0.5rem) var(--space-normal, 1rem);
	text-align: center;
}

/* Different colors on tier headers */
.dabblin-decorator header {
	background-color: var(--blue-dark, #1b227a);
}

.memory-maker header {
	background-color: var(--color-primary, #c81e11);
}

.clever-collector header {
	background-color: var(--green, #1b7a4a);
}

.serious-smiler header {
	background-color: var(--red-dark, #6d1b25);
}

/* Match the height of the text */
.ftm-yotpo-tier-current {
	font-weight: 700;
	min-height: 1.6em;
}

.ftm-yotpo-tier-name {
	color: inherit;
	font: var(--body-large);
	margin-top: 0;
}

.ftm-yotpo-tier-benefits {
	list-style: none;
	margin: 0;
	padding: var(--space-normal, 1rem);
}

.ftm-yotpo-tier-benefits li:nth-child(1),
.ftm-yotpo-tier-benefits li:nth-child(2) {
	color: var(--color-black, #303133);
	text-align: center;
}

.ftm-yotpo-tier-benefits li:first-child {
	font-size: 1.7777em;
}

.ftm-yotpo-tier-benefits li:nth-child(3) {
	margin-top: var(--space-normal, 1rem);
}

/* Campaign List section */
.ftm-yotpo-campaign-list {
	display: grid;
	grid-gap: var(--space-normal, 1rem);
	grid-template-columns: repeat(2, 1fr);
	list-style: none;
	padding: 0;
}

.campaign-item div {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	min-height: 100%;
}

.campaign-background {
	background-position: center center;
	background-size: cover;
	color: var(--color-white, #fff);

	padding: 0 var(--space-small, 0.75rem);
	text-align: center;
}


/* Campaign icons */
.campaign-item .campaign-icon-wrap {
	display: inline-block;
	width: 60px;
}

.campaign-item[class*="facebook"] .campaign-icon-wrap span::before {
	content: url(../images/fb.svg);
}

.campaign-item[class*="instagram"] .campaign-icon-wrap span::before {
	content: url(../images/instagram.svg);
}

.campaign-item[class*="make-a-purchase"] .campaign-icon-wrap span::before {
	content: url(../images/per-spend-one-dollar.svg);
}

.campaign-item[class*="create-an-account"] .campaign-icon-wrap span::before {
	content: url(../images/create-an-account.svg);
}

.campaign-item[class*="happy-birthday"] .campaign-icon-wrap span::before {
	content: url(../images/birthday.svg);
}

.campaign-item[class*="every-5-orders"] .campaign-icon-wrap span::before {
	content: url(../images/card-purchases.svg);
}

.campaign-item[class*="leave-a-review"] .campaign-icon-wrap span::before {
	content: url(../images/review-a-product.svg);
}

/* Special case for referral campaign */
.campaign-item[class*="give-your-friends"] .campaign-background {
	position: relative;
}

.campaign-item[class*="give-your-friends"] .campaign-background::after {
	background-color: rgba(0, 0, 0, 0.5);
	bottom: 0;
	content: "";
	display: block;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
	z-index: 0;
}

.campaign-item[class*="give-your-friends"] .campaign-content {
	position: relative;
	z-index: 1;
}

.campaign-item[class*="give-your-friends"] .campaign-icon-wrap {
	width: auto;
}

.campaign-item[class*="give-your-friends"] .campaign-icon-wrap span::before {
	content: "Give $15 Get $15";
	font-size: 1.3333em;
	font-weight: 700;
}

@media (min-width: 48em) {

	.ftm-yotpo-campaign-list {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Special case for referral campaign */
	.campaign-item[class*="give-your-friends"] {
		grid-column: 2 / span 2;
	}

	.campaign-item[class*="give-your-friends"] .campaign-background {
		text-align: inherit;
	}

	.campaign-item[class*="give-your-friends"] .campaign-icon-wrap span::before {
		font-size: 1.6666em;
	}

}

body.ftm-yotpo-rewards-page .site-breadcrumbs,
body.ftm-yotpo-rewards-page #main .entry-header {
	display: none;
}

body.ftm-yotpo-rewards-page .entry-content-wrapper {
	max-width: var(--max-width-wide, 1200px);
	padding-top: 1px;
}

body.logged-in .yotpo-customer-logged-out-buttons {
	height: 0 !important;
	overflow: hidden !important;
	padding: 0 !important;
}

/* Swell Apply Points UI on the cart & checkout pages */
.ftm-yotpo-redemption.woocommerce-info {
	align-items: center;
	/* Preserve the rewards color against generic checkout notice styles. */
	background-color: var(--red-dark, #6d1b25) !important;
	border: 0;
	color: var(--color-white, #fff);
	display: grid;
	gap: 0.75rem;
	grid-template-columns: 1fr;
	padding: var(--space-medium, 1.25rem);
}

.ftm-yotpo-redemption.woocommerce-info.loading,
.ftm-yotpo-checkout-redemption-block.loading .ftm-yotpo-redemption.woocommerce-info {
	opacity: 0.5;
	pointer-events: none;
}

.ftm-yotpo-redemption.woocommerce-info h2 {
	color: inherit;
	font-size: 1.5rem;
	font-weight: 400;
	margin-top: 0;
}

.ftm-yotpo-redemption.woocommerce-info h2 > * {
	vertical-align: baseline;
}

.ftm-yotpo-redemption.woocommerce-info h2::before {
	aspect-ratio: 1 / 1;
	background-image: url(../images/logos/mobile-headonly.png);
	background-repeat: no-repeat;
	background-size: contain;
	content: "";
	display: inline-block;
	vertical-align: bottom;
	width: 3rem;
}

.ftm-yotpo-redemption.woocommerce-info h2 .program-name {
	font: var(--label-large);
}

.ftm-yotpo-redemption.woocommerce-info .ftm-yotpo-point-balance {
	color: inherit;
	font: var(--label-large);
}

@media (min-width: 64em) {

	.ftm-yotpo-redemption.woocommerce-info h2::before {
		display: none;
	}

	.ftm-yotpo-redemption.woocommerce-info .section-left {
		padding-left: 3.5rem;
		position: relative;
	}

	.ftm-yotpo-redemption.woocommerce-info .section-left::before {
		aspect-ratio: 1 / 1;
		background-image: url(../images/logos/mobile-headonly.png);
		background-repeat: no-repeat;
		background-size: contain;
		content: "";
		display: block;
		left: 0;
		position: absolute;
		top: 0;
		width: 3rem;
	}
}

@media (min-width: 75em) {

	.ftm-yotpo-redemption.woocommerce-info .section-left {
		padding-left: 5rem;
	}

	.ftm-yotpo-redemption.woocommerce-info .section-left::before {
		width: 4rem;
	}
}

tr#ftm-yotpo-earning .promo {
	color: var(--color-primary-500, var(--primary-color, #c81e11));
	font-weight: 500;
	margin: 0 0 0.5rem 0;
}

tr#ftm-yotpo-earning .vip-tier {
	color: var(--color-primary-500, var(--primary-color, #c81e11));
	font: var(--label-large);
}

tr#ftm-yotpo-earning strike {
	font: var(--label-small);
	opacity: 0.7;
}

tr#ftm-yotpo-earning:last-child {
	border-bottom: 0;
}

tr#ftm-yotpo-earning td {
	padding: 0.8rem 0 0 0;
}

/* Block checkout points earning — mirrors the classic <tr> styles in a <div> context */
#ftm-yotpo-checkout-earning {
	padding: 0.8rem 0 0 0;
}

/* Owned here since the theme's rule targeted the old .swell-checkout-earning class. */
#ftm-yotpo-checkout-earning .earning-text {
	font: var(--label-small);
	font-style: italic;
	margin: 0;
	padding: 0 16px 16px;
}

#ftm-yotpo-checkout-earning .promo {
	color: var(--color-primary-500, var(--primary-color, #c81e11));
	font-weight: 500;
	margin: 0 0 0.5rem 0;
}

#ftm-yotpo-checkout-earning .vip-tier {
	color: var(--color-primary-500, var(--primary-color, #c81e11));
	font: var(--label-large);
}

#ftm-yotpo-checkout-earning strike {
	font: var(--label-small);
	opacity: 0.7;
}

@media (min-width: 48em) {

	.ftm-yotpo-redemption.woocommerce-info {
		grid-template-columns: 1fr 1fr;
	}
}
