/* ============================================================================================================================
   FOR YOUR HOME > PROMOTIONS & DISCOUNTS overview - Figma redesign - NOV10. STANDALONE file (no @import, no global selectors).
   Every selector starts with ".cp-promotions-overview" or "body:has(.cp-promotions-overview)", so it only does anything on a page
   that contains the wrapper below. Fonts are NOT loaded here: add this <link> to that page (Lato 900, Source Sans 3 500/700):
     <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lato:wght@900&family=Source+Sans+3:wght@500;700&display=swap">

   Markup (CMS content block):
     <div class="cp-promotions-overview">
       <div class="cp-promotions-top">
         <div class="cp-promotions-intro"><h1>TITLE</h1><p>Text</p></div>
         <div class="cp-promotions-caa">
           <img class="cp-promotions-caa-logo" src="..." alt="CAA">
           <a class="cp-promotions-button" href="...">Button text</a>
         </div>
       </div>
       <div class="cp-promotions-cards">
         <div class="cp-promotions-card"><img class="cp-promotions-image" src="..." alt=""><a class="cp-promotions-button" href="...">Text</a></div>
         (x3)
       </div>
     </div>

   Layout facts (internal overview template): #content is 100% of .section-inner (1180px from 1220px up) on .template-overview, so the
   1086px wrapper centres inside it without touching the header, footer, sub-nav or any shared rule. Sizes follow the WRAPPER width
   (container queries), not the viewport.
   Desktop (1086px): top row 500px + 538px, 48px gap; CAA panel 538 x 295 (12px #E5E5E5 border, #ECDADB); row 2 starts 45px lower,
   3 x 330px cards (295px high), 48px gap. Tablet (viewport >= 768px, wrapper < 1086px): the same composition scaled down.
   Mobile (viewport <= 767px): one centred column, intro / CAA panel / cards all max 330px wide, 32px gaps.
   Tunable on .cp-promotions-overview: --cp-promotions-gap-top (36px below the breadcrumb), --cp-promotions-gap-bottom (87px).
   ============================================================================================================================ */

/* ---- Existing overview tiles of this page are hidden (data stays in the page; nothing is deleted) ------------------------ */
body:has(.cp-promotions-overview) #content .overview-boxes {
	display: none;
}

/* ---- Template title blocks replaced by the new intro (only when the wrapper is on the page) -------------------------------
   The master's own title "<h1><span id="cph_main_lbl_sectionTitle">...</span></h1>" duplicates the intro H1, and
   "#main .page-category" (the "For Your Home" parent label, 36px/1.1 = ~39.6px high) overlaps and adds space above #content. */
body:has(.cp-promotions-overview) #content h1:has(#cph_main_lbl_sectionTitle) {
	display: none;
}

body:has(.cp-promotions-overview) #main .page-category {
	display: none;
}

/* ---- Vertical reset (only when the wrapper is on the page) ---------------------------------------------------------------
   .c-w1 carries "position: relative; top: -30px" (.c-w1-position) which shifted the content up 30px and, below it, left a 30px
   extra gap (87 + 30 = 117 before the divider). It is reset to static; the side padding (0 40px) is kept. The .c-w1 and the
   wrapper's direct parent (e.g. .sfContentBlock) become block formatting contexts with no vertical margin/padding, so the
   wrapper's own 36px top / 87px bottom margins stay inside them and neither collapse through nor double up. */
body:has(.cp-promotions-overview) #content .c-w1,
body:has(.cp-promotions-overview) #content :has(> .cp-promotions-overview) {
	position: static;
	top: auto;
	display: flow-root;
	margin-top: 0;
	margin-bottom: 0;
	padding-top: 0;
	padding-bottom: 0;
}

/* ---- Wrapper: 1086px max, centred; size container for the responsive rules ------------------------------------------------- */
.cp-promotions-overview {
	--cp-promotions-gap-top: 36px;
	--cp-promotions-gap-bottom: 87px;
	container-type: inline-size;
	container-name: cp-promotions;
	display: block;
	box-sizing: border-box;
	clear: both;
	float: none;
	width: 100%;
	max-width: 1086px;
	margin: var(--cp-promotions-gap-top) auto var(--cp-promotions-gap-bottom);
	padding: 0;
	font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
	text-align: left;
}

.cp-promotions-overview *,
.cp-promotions-overview *::before,
.cp-promotions-overview *::after {
	box-sizing: border-box;
}

/* ---- Top row: intro 500px + CAA panel 538px, 48px gap -------------------------------------------------------------------- */
.cp-promotions-overview .cp-promotions-top {
	display: grid;
	grid-template-columns: minmax(0, 500px) minmax(0, 538px);
	column-gap: 48px;
	row-gap: 32px;
	align-items: center;
	width: 100%;
	margin: 0;
	padding: 0;
}

/* intro: 12px left padding, vertically centred against the 295px panel */
.cp-promotions-overview .cp-promotions-intro {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 295px;
	margin: 0;
	padding: 0 0 0 12px;
}

/* h1 margin is !important only because mobile.css has "#content h1 { margin-bottom: 8px }" (an ID selector, up to 640px) */
.cp-promotions-overview .cp-promotions-intro h1 {
	display: block;
	float: none;
	width: 299px;
	max-width: 100%;
	margin: 0 0 12px !important;
	padding: 0;
	border: 0;
	font-family: Lato, sans-serif;
	font-size: 34px;
	font-style: normal;
	font-weight: 900;
	line-height: 36px;
	letter-spacing: 0;
	text-align: left;
	text-transform: uppercase;
	text-shadow: none;
	color: #000;
}

.cp-promotions-overview .cp-promotions-intro p {
	width: 366px;
	max-width: 100%;
	margin: 0;
	padding: 0;
	font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 500;
	line-height: 27px;
	letter-spacing: 0;
	text-align: left;
	text-transform: none;
	color: #000;
}

/* ---- CAA panel: 538 x 295, 12px border inside the size; logo 395 x 143 at top 43px; CTA 300 x 38 at bottom 18px ---------- */
.cp-promotions-overview .cp-promotions-caa {
	position: relative;
	width: 100%;
	max-width: 538px;
	height: 295px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 12px solid #e5e5e5;
	background: #ecdadb;
}

/* width/height/margin are !important only because mobile.css has "#content img { width: auto; margin: 0 auto }" (up to 640px) */
.cp-promotions-overview .cp-promotions-caa .cp-promotions-caa-logo {
	position: absolute;
	top: 43px;
	right: 0;
	left: 0;
	display: block;
	width: 395px !important;
	max-width: calc(100% - 24px);
	height: auto !important;
	margin: 0 auto !important;
	padding: 0;
	aspect-ratio: 395 / 143;
	object-fit: contain;
	border: 0;
}

.cp-promotions-overview .cp-promotions-caa .cp-promotions-button {
	position: absolute;
	right: 0;
	bottom: 18px;
	left: 0;
	width: 300px;
	margin: 0 auto;
}

/* ---- Row 2: 3 x 330px cards, 48px gap, 45px below the top row ------------------------------------------------------------ */
.cp-promotions-overview .cp-promotions-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 330px));
	justify-content: center;
	gap: 32px 48px;
	width: 100%;
	margin: 45px 0 0;
	padding: 0;
}

.cp-promotions-overview .cp-promotions-card {
	position: relative;
	width: 100%;
	max-width: 330px;
	height: 295px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #ecdadb;
}

.cp-promotions-overview .cp-promotions-card .cp-promotions-image {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0 !important;
	padding: 0;
	object-fit: cover;
	object-position: center;
	border: 0;
}

.cp-promotions-overview .cp-promotions-card .cp-promotions-button {
	position: absolute;
	right: 0;
	bottom: 29px;
	left: 0;
	z-index: 1;
	width: 240px;
	margin: 0 auto;
}

/* ---- CTA (all buttons): Source Sans 3 700 18/18 uppercase, white on #026FAD, 38px high ------------------------------------ */
.cp-promotions-overview .cp-promotions-button {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	max-width: calc(100% - 24px);
	padding: 0 12px;
	border: 0;
	background: #026fad;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.75);
	font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
	font-size: 18px;
	font-style: normal;
	font-weight: 700;
	line-height: 18px;
	letter-spacing: 0;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	text-shadow: none;
	white-space: nowrap;
	color: #fff;
	transition: background-color 0.2s ease;
}

.cp-promotions-overview .cp-promotions-button:hover,
.cp-promotions-overview .cp-promotions-button:focus {
	background: #014e7e;
	color: #fff;
	text-decoration: none;
}

.cp-promotions-overview .cp-promotions-button:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

/* ============================================================================================================================
   Tablet (viewport 768px and up) while the wrapper is narrower than 1086px: the desktop composition is kept and scaled down with
   the wrapper width (100cqw): intro + CAA panel in the top row, the three cards in ONE bottom row. Sizes are the desktop
   numbers / 1086 x wrapper width (clamped so type stays readable); positions inside the panel/cards are the desktop positions
   as percentages (logo top 43 / 271, width 395 / 514; CTA bottom 18 / 271, 300 / 514; card CTA bottom 29 / 295, 240 / 330).
   ============================================================================================================================ */
@media screen and (min-width: 768px) {
	@container cp-promotions (max-width: 1085px) {
		.cp-promotions-overview .cp-promotions-top {
			grid-template-columns: minmax(0, 500fr) minmax(0, 538fr);
			column-gap: calc(100cqw * 48 / 1086);
			row-gap: 0;
		}

		.cp-promotions-overview .cp-promotions-intro {
			min-height: 0;
			padding-left: calc(100cqw * 12 / 1086);
		}

		.cp-promotions-overview .cp-promotions-intro h1 {
			width: 60%;
			font-size: clamp(20px, 3.13cqw, 34px);
			line-height: 1.06;
			margin: 0 0 calc(100cqw * 12 / 1086) !important;
		}

		.cp-promotions-overview .cp-promotions-intro p {
			width: 73.2%;
			font-size: clamp(13px, 1.47cqw, 16px);
			line-height: 1.69;
		}

		.cp-promotions-overview .cp-promotions-caa {
			max-width: none;
			height: auto;
			aspect-ratio: 538 / 295;
			border-width: clamp(6px, calc(100cqw * 12 / 1086), 12px);
		}

		.cp-promotions-overview .cp-promotions-caa .cp-promotions-caa-logo {
			top: 15.87%;
			width: 76.85% !important;
			max-width: none;
		}

		.cp-promotions-overview .cp-promotions-caa .cp-promotions-button {
			bottom: 6.64%;
			width: 58.37%;
			max-width: none;
		}

		.cp-promotions-overview .cp-promotions-cards {
			grid-template-columns: repeat(3, minmax(0, 1fr));
			gap: calc(100cqw * 48 / 1086);
			margin-top: calc(100cqw * 45 / 1086);
		}

		.cp-promotions-overview .cp-promotions-card {
			max-width: none;
			height: auto;
			aspect-ratio: 330 / 295;
		}

		.cp-promotions-overview .cp-promotions-card .cp-promotions-button {
			bottom: 9.83%;
			width: 72.73%;
			max-width: none;
		}

		.cp-promotions-overview .cp-promotions-button {
			height: clamp(30px, calc(100cqw * 38 / 1086), 38px);
			padding: 0 6px;
			font-size: clamp(12px, 1.66cqw, 18px);
			line-height: 1;
		}
	}
}

/* ---- Mobile (viewport 767px and below): everything stacks in one centred column, intro, CAA panel and every card the same
   width (max 330px), 32px between them; the intro is aligned to the same 330px column. Panel and cards keep their 295px height. */
@media screen and (max-width: 767px) {
	.cp-promotions-overview .cp-promotions-top {
		grid-template-columns: minmax(0, 330px);
		justify-content: center;
		justify-items: stretch;
		align-items: start;
		row-gap: 32px;
	}

	.cp-promotions-overview .cp-promotions-intro {
		width: 100%;
		min-height: 0;
		padding-left: 0;
	}

	.cp-promotions-overview .cp-promotions-intro h1,
	.cp-promotions-overview .cp-promotions-intro p {
		width: 100%;
	}

	.cp-promotions-overview .cp-promotions-caa {
		width: 100%;
		max-width: 330px;
		margin: 0 auto;
	}

	.cp-promotions-overview .cp-promotions-cards {
		grid-template-columns: minmax(0, 330px);
		justify-content: center;
		gap: 32px;
		margin-top: 32px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cp-promotions-overview .cp-promotions-button {
		transition: none;
	}
}
