@charset "UTF-8";

/******************************************************************************
* Deals page - v2 (left-hand range nav, Top offers, More to discover)
* Loaded by deal/versions/v2/index.phtml. v1 uses deal/default.css.
******************************************************************************/

/******************************************************************************
* Page shell
******************************************************************************/

.deals-header {
	background-color: #1a1a1a;
}

/* Dark content panel - a separate section that sits directly below the hero */
/* Colours marked var(--deals-*) can be set per deal in the Deal Manager (deals.style_v2);
   the value after the comma is the built-in design default. See deal/versions/v2/partials/styles.phtml */
.deals-main {
	padding: 0 1rem 4rem;
	background-color: var(--deals-content-bg, #1a1a1a);
	color: #ffffff;
	font-family: 'Centrale Sans Regular', Trebuchet, sans-serif;
}

/* The shared breadcrumbs partial wraps its list in its own .container-xxl. Inside our
   .container-xxxl that nests a narrower, padded container, so the crumbs end up indented.
   Make the inner container fill the outer one so the crumbs line up with the content. */
.deals-main .breadcrumbs .container-xxl {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

.deals-main .breadcrumbs ul {
	margin: 0;
	padding-left: 0;
}

@media screen and (min-width: 992px) {
	.deals-main {
		padding: 0 2rem 5rem;
	}
}

/******************************************************************************
* Range navigation
*  >= 1200px  : vertical list in the left column
*  768-1199px : pill button + dropdown-style overlay list (tablet)
*  < 768px    : pill button + in-flow collapsible panel (mobile)
******************************************************************************/

.deals-nav-title,
.deals-filter-title {
	margin: 2rem 0 1.25rem;
	padding-left: 0.75rem;
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-size: 1.375rem;
	color: var(--deals-heading-color, #ffffff);
}

.deals-nav-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.875rem 1.25rem;
	border: 0;
	border-radius: 1.5rem;
	background-color: #ffffff;
	color: #0099ff;
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-size: 1rem;
	text-align: left;
}

.deals-nav-toggle i {
	transition: transform 0.2s ease;
}

.deals-nav-toggle[aria-expanded="true"] i {
	transform: rotate(180deg);
}

.deals-nav-list {
	margin: 0;
	padding: 0;
}

.deals-nav-link,
.deals-nav-link:link,
.deals-nav-link:visited {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-bottom: 0.25rem;
	padding: 0.9rem 1.25rem 0.9rem 0.875rem;
	border-radius: 0.75rem;
	color: var(--deals-nav-text, #ffffff);
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-size: 1.125rem;
	text-decoration: none;
}

.deals-nav-link:hover {
	background-color: var(--deals-nav-hover-bg, #313131);
	color: var(--deals-nav-hover-text, #ffffff);
}

.deals-nav-link.active,
.deals-nav-link.active:hover {
	background-color: var(--deals-nav-active-bg, #0099ff);
	color: var(--deals-nav-active-text, #ffffff);
}

.deals-nav-text {
	flex: 1 1 auto;
}

.deals-nav-chevron {
	margin-left: auto;
	opacity: 0.85;
}

.deals-nav-link.active .deals-nav-chevron {
	visibility: hidden;
}

/* Desktop: list is always open (overrides Bootstrap's .collapse) */
@media screen and (min-width: 1200px) {
	.deals-nav-list.collapse:not(.show),
	.deals-nav-list.collapsing {
		display: block;
		height: auto;
		overflow: visible;
		transition: none;
	}

	/* Cap the nav at roughly the design's pill width; the column keeps its 3/12 share so the
	   leftover space becomes the gap before the content. */
	.deals-nav {
		max-width: 15rem;
	}

	.deals-sidebar {
		padding-right: 1.5rem;
	}
}

@media screen and (min-width: 1400px) {
	.deals-sidebar {
		padding-right: 0;
	}
}

/* Tablet + mobile: centred pill with a panel below it */
@media screen and (max-width: 1199.98px) {
	.deals-nav {
		position: relative;
		max-width: 24rem;
		margin: 1.5rem auto 1rem;
	}

	.deals-nav-list {
		margin-top: 0.5rem;
		padding: 0.5rem;
		border-radius: 1rem;
		background-color: var(--deals-nav-dropdown-bg, #2a2a2a);
	}
}

/* Tablet: overlay like a dropdown so the page doesn't jump */
@media screen and (min-width: 768px) and (max-width: 1199.98px) {
	.deals-nav-list {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 30;
		box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
		/* Never taller than the screen (the bar is sticky, so it can be open anywhere on the page); scrolls inside */
		max-height: calc(100vh - 7rem);
		max-height: calc(100dvh - 7rem);
		overflow-y: auto;
	}
}

/******************************************************************************
* Filter by offer / Filter by brand (same three layouts as the range nav above)
******************************************************************************/

.deals-filter-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.875rem 1.25rem;
	border: 1px solid var(--deals-heading-color, #ffffff);
	border-radius: 1.5rem;
	background-color: transparent;
	color: var(--deals-heading-color, #ffffff);
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-size: 1rem;
	text-align: left;
}

.deals-filter-toggle i {
	transition: transform 0.2s ease;
}

.deals-filter-toggle[aria-expanded="true"] i {
	transform: rotate(180deg);
}

.deals-filter-list {
	margin: 0;
	padding: 0;
}

.deals-filter-option {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.625rem 0.75rem;
	border-radius: 0.75rem;
	color: var(--deals-nav-text, #ffffff);
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-size: 1rem;
	cursor: pointer;
}

/* The real checkbox stays in the page (focusable, screen-reader friendly) but is drawn as the round control */
.deals-filter-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.deals-filter-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 1.125rem;
	height: 1.125rem;
	border: 2px solid #ffffff;
	border-radius: 50%;
	background-color: #ffffff;
}

.deals-filter-option input:checked + .deals-filter-check {
	border-color: var(--deals-nav-active-bg, #0099ff);
	background-color: var(--deals-nav-active-bg, #0099ff);
}

.deals-filter-option input:checked + .deals-filter-check::after {
	content: "";
	width: 0.3rem;
	height: 0.55rem;
	margin-top: -0.1rem;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.deals-filter-option input:focus-visible + .deals-filter-check {
	outline: 2px solid var(--deals-nav-active-bg, #0099ff);
	outline-offset: 2px;
}

.deals-filter-option input:checked ~ .deals-filter-label {
	color: var(--deals-nav-active-bg, #0099ff);
}

.deals-filter-label {
	flex: 1 1 auto;
}

/* No deals left with this option given the other ticked filters: dimmed and not tickable (see refreshCounts() in
   partials/filters.phtml). The option keeps its place so the list doesn't jump about as filters are ticked. */
.deals-filter-option.is-disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.deals-filter-count {
	margin-left: auto;
	opacity: 0.6;
	font-size: 0.875rem;
}

/* "Show more" under a long list (the brand filter): extra options stay hidden until it is used */
.deals-filter-extra[hidden],
.deals-filter-more-item[hidden] {
	display: none;
}

.deals-filter-more {
	padding: 0.625rem 0.75rem;
	border: 0;
	background: none;
	color: var(--deals-nav-text, #ffffff);
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-size: 1rem;
	text-decoration: underline;
	cursor: pointer;
}

.deals-filter-more:hover {
	text-decoration: none;
}

.deals-filter-more:focus-visible {
	outline: 2px solid var(--deals-nav-active-bg, #0099ff);
	outline-offset: 2px;
	border-radius: 0.75rem;
}

/* Desktop: open list under a rule that separates it from the range nav */
@media screen and (min-width: 1200px) {
	.deals-filter {
		max-width: 15rem;
		margin-top: 1.5rem;
		border-top: 1px solid rgba(128, 128, 128, 0.35);
	}

	.deals-filter-list.collapse:not(.show),
	.deals-filter-list.collapsing {
		display: block;
		height: auto;
		overflow: visible;
		transition: none;
	}
}

/* Tablet + mobile: a pill that opens a panel, like the range nav pill */
@media screen and (max-width: 1199.98px) {
	.deals-filter {
		position: relative;
		max-width: 24rem;
		margin: 0 auto 1rem;
	}

	.deals-filter-list {
		margin-top: 0.5rem;
		padding: 0.5rem;
		border-radius: 1rem;
		background-color: var(--deals-nav-dropdown-bg, #2a2a2a);
	}
}

/* Tablet: the range pill and the two filter pills sit side by side in one bar that sticks to the top of the screen
   while the page scrolls (the bar is a child of the row that also holds the content column, so it stays stuck for the
   whole content). Each list overlays like a dropdown. */
@media screen and (min-width: 768px) and (max-width: 1199.98px) {
	.deals-sidebar {
		position: sticky;
		top: 0;
		z-index: 40;
		display: flex;
		align-items: flex-start;
		justify-content: center;
		gap: 1rem;
		margin-top: 0.75rem;
		padding-top: 0.75rem;
		padding-bottom: 0.75rem;
		background-color: var(--deals-content-bg, #1a1a1a);
		box-shadow: 0 0.75rem 0.5rem -0.5rem rgba(0, 0, 0, 0.5);
	}

	/* The wrapper around the two filter groups drops out so the groups are flex items of the bar, like the range pill */
	.deals-filters {
		display: contents;
	}

	.deals-sidebar .deals-nav,
	.deals-sidebar .deals-filter {
		flex: 1 1 0;
		max-width: 18rem;
		margin: 0;
	}

	.deals-filter-list {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 30;
		box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
		max-height: calc(100vh - 7rem);
		max-height: calc(100dvh - 7rem);
		overflow-y: auto;
	}
}

/* Mobile: the range pill stays where it is (it scrolls away); the two filter pills share a bar that sticks to the top of
   the screen. Their lists overlay the page below the bar, the full width of it (in-flow lists would push the page down
   and could fill the screen from a sticky bar). */
@media screen and (max-width: 767.98px) {
	/* The sidebar column drops out so the range pill and the filter bar become flex items of the row: the bar's sticky
	   range is then the whole row, content included, not just the short sidebar. Bootstrap's `.row > *` full-width and
	   side-padding rules only reach DOM children, so the two are given them here; the range pill's cap grows by the
	   padding so the pill stays the same width. */
	.deals-sidebar {
		display: contents;
	}

	.deals-sidebar .deals-nav,
	.deals-filters {
		flex: 0 0 100%;
		width: 100%;
		padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
		padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
	}

	.deals-sidebar .deals-nav {
		max-width: calc(24rem + var(--bs-gutter-x, 1.5rem));
	}

	.deals-filters {
		position: sticky;
		top: 0;
		z-index: 40;
		display: flex;
		gap: 0.5rem;
		padding-top: 0.625rem;
		padding-bottom: 0.625rem;
		background-color: var(--deals-content-bg, #1a1a1a);
		box-shadow: 0 0.75rem 0.5rem -0.5rem rgba(0, 0, 0, 0.5);
	}

	/* The two pills are the same height: on screens too narrow for "Filter by offer" on one line the text wraps to two
	   lines (the label is never cut off), and the pill that doesn't need two stretches to match. */
	.deals-filters .deals-filter {
		position: static;
		display: flex;
		flex: 1 1 0;
		min-width: 0;
		max-width: none;
		margin: 0;
	}

	.deals-filters .deals-filter-toggle {
		flex: 1 1 auto;
		gap: 0.25rem;
		padding: 0.75rem 0.875rem;
		font-size: 0.9375rem;
		line-height: 1.2;
	}

	.deals-filters .deals-filter-toggle > span {
		min-width: 0;
	}

	.deals-filters .deals-filter-list {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 30;
		margin-top: 0;
		box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
		max-height: calc(100vh - 6rem);
		max-height: calc(100dvh - 6rem);
		overflow-y: auto;
	}
}

/* Widest screens: the column has room, so the nav and the filter panel (kept the same width so their edges and the
   rule between them line up) widen enough for "Small Appliances" to stay on one line. Below 1400px the column is
   the limit, so the 15rem cap above is unchanged. */
@media screen and (min-width: 1400px) {
	.deals-sidebar .deals-nav,
	.deals-sidebar .deals-filter {
		max-width: 17rem;
	}
}

/******************************************************************************
* Section headings
******************************************************************************/

.deals-section {
	margin-bottom: 3rem;
}

.deals-section-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.75rem;
	margin: 1.5rem 0;
}

.deals-section-title {
	margin: 0;
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-size: 1.5rem;
	color: var(--deals-heading-color, #ffffff);
}

.deals-section-sub {
	font-size: 1rem;
	color: var(--deals-heading-color, #e6e6e6);
}

.deals-section-sub::before {
	content: "\00b7";
	margin-right: 0.75rem;
}

.deals-section-heading-split {
	align-items: flex-end;
	justify-content: space-between;
}

.deals-section-heading-split .deals-section-title {
	display: inline-block;
}

/* The title and subtitle sit in a wrapper here (the count is its sibling), so it needs the same flex layout and gap as
   .deals-section-heading, which puts the same space either side of the dot */
.deals-section-heading-split > div {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.75rem;
}

.deals-count {
	font-size: 1rem;
	color: var(--deals-heading-color, #e6e6e6);
}

/* Mobile: everything centred, with the subtitle on its own line below the title (and so no separating dot), and
   the Deals count on its own line below that with a little room above it */
@media screen and (max-width: 767.98px) {
	.deals-section-heading,
	.deals-section-heading-split {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.deals-section-heading-split > div {
		flex-direction: column;
		align-items: center;
	}

	.deals-section-sub {
		display: block;
	}

	.deals-section-sub::before {
		content: none;
	}

	.deals-section-heading-split .deals-count {
		margin-top: 0.75rem;
	}
}

/******************************************************************************
* Deal cards (shared by Top offers + More to discover)
******************************************************************************/

.deal-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 1.5rem;
	border-radius: 2rem;
	background-color: #ffffff;
	color: #102a4b;
}

.deal-card a {
	color: #102a4b;
	text-decoration: none;
}

.deal-card-header {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: 1.5rem;
}

/* Logos are all ~120px wide but 15-68px tall, so limiting height alone made wide logos huge and
   tall ones tiny. Each logo is fitted inside the same small box (right-aligned) instead. */
.deal-card-brand {
	flex-shrink: 0;
	width: 5rem;
	height: 1.5rem;
}

.deal-card-brand img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: contain;
	object-position: right center;
}

.deal-card-image {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 1rem 0;
}

.deal-card-image img {
	width: auto;
	max-height: 180px;
}

.deal-card-title {
	margin: 0 0 1rem;
	font-family: 'Centrale Sans Regular', Trebuchet, sans-serif;
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.3;
}

.deal-card-buttons {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

/* Promo badge (promotion data only) */
.deal-badge {
	position: absolute;
	top: -0.5rem;
	left: 1rem;
	z-index: 2;
	padding: 0.4rem 0.75rem;
	border-radius: 0.625rem;
	background-color: #cc0000;
	color: #ffffff;
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	line-height: 1.15;
	text-align: center;
}

.deal-badge-main {
	display: block;
	font-size: 1rem;
}

.deal-badge-code {
	display: block;
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-size: 0.75rem;
}

.deal-badge-full {
	top: -0.75rem;
	left: 1.25rem;
	padding: 0.5rem 0.875rem;
}

.deal-badge-full .deal-badge-main {
	font-size: 1.25rem;
}

/* Was-price discount badge ("Save 12%"): used when there is no save-code badge. Unlike the code badge it sits inside the
   card, vertically centred on the brand logo (doubled class beats the .deal-badge-full rules above). Absolutely
   positioned, so it takes no grid row. Top offers: logo centre is 2rem down; More to discover: 1.75rem. */
.deal-badge.deal-badge-discount {
	top: 0.875rem;
	left: 1.25rem;
	padding: 0.3rem 0.75rem;
	white-space: nowrap;
}

.deal-badge.deal-badge-discount.deal-badge-full {
	top: 1.0625rem;
	left: 1.5rem;
	padding: 0.3rem 0.875rem;
}

.deal-badge.deal-badge-discount .deal-badge-main {
	font-size: 1rem;
}

.deal-badge.deal-badge-discount.deal-badge-full .deal-badge-main {
	font-size: 1.125rem;
}

/* "Hand-picked deal" tag: the quiet tag for a card with no code and no Was price. Same place as the Was-price badge
   (inside the card, level with the brand logo) but a soft blue tint, smaller and squarer, so it never reads as a
   discount. Top offers: logo centre is 2rem down; More to discover: 1.75rem. */
.deal-badge.deal-badge-handpicked {
	top: 1.03rem;
	left: 1.25rem;
	padding: 0.25rem 0.625rem;
	border-radius: 0.5rem;
	background-color: #e3eefb;
	color: #0b3a6e;
}

.deal-badge.deal-badge-handpicked.deal-badge-full {
	top: 1.28rem;
	left: 1.5rem;
	padding: 0.25rem 0.625rem;
}

.deal-badge.deal-badge-handpicked .deal-badge-main,
.deal-badge.deal-badge-handpicked.deal-badge-full .deal-badge-main {
	font-size: 0.8125rem;
}

/* In the narrowest More to discover cards (four across, roughly 1400-1749px) "Hand-picked deal" runs into a wide brand
   logo, so there the tag drops to "Hand-picked". */
@media screen and (min-width: 1400px) and (max-width: 1749.98px) {
	.deal-card-grid .deal-badge-handpicked .deal-badge-extra {
		display: none;
	}
}

/* Buttons */
.deal-card a.pushbutton.deal-btn {
	margin: 0;
	border-radius: 1.5rem;
	color: #ffffff;
}

.deal-card a.pushbutton.deal-btn-outline,
.deal-card a.pushbutton.deal-btn-outline:visited {
	background-color: transparent;
	border: 1px solid #102a4b;
	color: #102a4b;
}

.deal-card a.pushbutton.deal-btn-outline:hover,
.deal-card a.pushbutton.deal-btn-outline:active {
	background-color: #102a4b;
	color: #ffffff;
}

/******************************************************************************
* Top offers cards
******************************************************************************/

/* The grid: one column (cards centred, up to 30rem wide) below 768px, two columns from 768px (a third card is
   centred on its own row), three columns from 992px (the range nav and filters sit above the content from 992px to
   1199px, so the content has the full width there).
   The doubled class beats the .deal-grid breakpoint rules defined further down. As in More to discover there is
   no row-gap (it would open gaps inside the subgrid cards); the space between stacked cards is margin-bottom. */
.deal-grid.deal-grid-top {
	grid-template-columns: minmax(0, 1fr);
}

/* Tablet (768-991px): two across. A lone last card (the 3rd of 3) takes a whole row but is only as wide as one
   column, centred. (Plain two columns, not a 4-column grid with cards spanning 2: that stretched the card's rows on
   iOS Safari in landscape, leaving extra height inside the buttons and price block.) */
@media screen and (min-width: 768px) and (max-width: 991.98px) {
	.deal-grid.deal-grid-top {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.deal-grid-top .deal-card-top:last-child:nth-child(odd) {
		grid-column: 1 / -1;
		justify-self: center;
		width: calc((100% - 1.5rem) / 2);
	}
}

@media screen and (min-width: 992px) {
	.deal-grid.deal-grid-top {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* The last card already leaves its 1.5rem margin-bottom, so the section needs 1.5rem less than the default */
.top-offers {
	margin-bottom: 1.5rem;
}

/* iPhone / iPad only (-webkit-touch-callout exists only in iOS WebKit). With the subgrid cards, iOS Safari leaves
   less room below the last row of Top offers than other browsers do, so "More to discover" sat tight against the
   cards (nearly touching in portrait on an iPad, about 1.75rem short with three across). This adds the missing
   space. The margin collapses with the heading's own margin-top, so these values are the total gap. Measured from
   iPad screenshots, not understood; revisit if the layout of the cards changes. */
@supports (-webkit-touch-callout: none) {
	@media screen and (min-width: 768px) and (max-width: 991.98px) {
		.top-offers {
			margin-bottom: 4.5rem;
		}
	}

	@media screen and (min-width: 992px) {
		.top-offers {
			margin-bottom: 3.25rem;
		}
	}
}

.deal-card-top {
	/* width: 100% because the auto side margins would otherwise let a grid item shrink to its content */
	width: 100%;
	max-width: 30rem;
	margin: 0 auto 1.5rem;
	padding: 2.25rem 1.5rem 1.5rem;
	border-radius: 3rem;
	/* Optional drop shadow from the Deal Manager (top_offers_card_shadow, see partials/styles.phtml): the whole value,
	   or "none". No shadow when the key isn't set. */
	box-shadow: var(--deals-top-card-shadow, none);
	text-align: center;
	align-items: center;
}

/* Each card spans 7 rows of the grid (image, title, the price block's label / value / notes, offer line, buttons)
   and shares those row heights with the other cards in its row. The badge and brand logo are absolutely positioned,
   so they take no row. Browsers without subgrid keep the flex layout above, with the price pushed to the bottom.
   The card's one column is pinned to the card's width (minmax(0, 1fr)). Left as an implicit `auto` column it could
   grow to the widest unwrapped content (a long product name, the button row) on iOS Safari, pushing the title, rules
   and buttons out past the card edge on phones.
   Subgrid only from 768px, where cards share a row and need their parts to line up. Below that the cards are stacked
   one per row, so there is nothing to line up and the plain flex layout is used: on iOS Safari the subgrid card also
   ended up overlapping the "More to discover" heading below it, which the flex layout doesn't. */
@media screen and (min-width: 768px) {
	@supports (grid-template-rows: subgrid) {
		.deal-card-top {
			display: grid;
			grid-row: span 7;
			grid-template-rows: subgrid;
			grid-template-columns: minmax(0, 1fr);
			align-items: stretch;
		}
	}
}

.deal-card-top .deal-card-brand {
	position: absolute;
	top: 1.25rem;
	right: 1.5rem;
}

/* Every image sits in a box of the same shape (2:1 of the card's content width), so products of
   different proportions don't change where the title/price/button start across the row.
   The link must span the card (the card centres its children, which would otherwise shrink-wrap
   the link). The image is taken out of flow and fitted inside the box (object-fit: contain), so a
   tall image can never stretch the box: it is as wide as 55% of the box and no taller than the box. */
.deal-card-top .deal-card-image {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 2 / 1;
	flex-shrink: 0;
}

.deal-card-top .deal-card-image img {
	position: absolute;
	top: 0;
	left: 22.5%;
	width: 55%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: contain;
}

/* Same reduction as the grid cards (1px off the name, tighter line height, 2px less below it) */
.deal-card-top .deal-card-title {
	margin-bottom: 0.875rem;
	font-size: 0.9375rem;
	line-height: 1.25;
}

.deal-card-top .deal-card-price {
	margin-top: auto;
}

/* Same pairing as the grid cards: Add to Basket takes the free width, View sits beside it */
.deal-card-top .deal-card-buttons {
	width: 100%;
}

.deal-card-top .deal-card-buttons .deal-btn:first-child {
	flex: 1 1 auto;
}

.deal-card-top .deal-card-buttons .deal-btn-outline {
	flex: 0 0 auto;
	min-width: 5rem;
}

@media screen and (min-width: 992px) {
	.deal-card-top {
		max-width: none;
	}
}

/******************************************************************************
* More to discover grid cards
******************************************************************************/

/* The grid. Same breakpoints as the Bootstrap columns it replaced: 1 / 2 (576px) / 3 (992px) / 4 (1400px).
   There is deliberately no row-gap: with subgrid the card's own rows are the grid's rows, so a row-gap would
   open gaps inside every card. The vertical space between rows of cards is the cards' margin-bottom instead. */
.deal-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: 1.5rem;
}

@media screen and (min-width: 576px) {
	.deal-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media screen and (min-width: 992px) {
	.deal-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media screen and (min-width: 1400px) {
	.deal-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.deal-card-grid {
	margin-bottom: 3rem;
	padding: 1rem 1.25rem 1.25rem;
	/* Optional 1px border from the Deal Manager (more_to_discover_card_border sends the colour; partials/styles.phtml
	   builds "1px solid <colour>"). No border when the key isn't set. */
	border: var(--deals-more-card-border, none);
}

/* Fallback (browsers without subgrid): cards in a row are the same height and the buttons sit at the bottom. */
.deal-card-grid .deal-card-title {
	flex-grow: 1;
}

/* Each card spans 8 rows of the grid (header, image, title, the price block's label / value / notes, offer line,
   buttons) and shares those row heights with the other cards in its row, so every part lines up across the row.
   Each row is only as tall as the tallest card needs. The price block continues the subgrid (see its rules at the end
   of this file), so the price values line up whether or not a card has a "Marks+ Member" label above them. */
@supports (grid-template-rows: subgrid) {
	.deal-card-grid {
		display: grid;
		grid-row: span 8;
		grid-template-rows: subgrid;
	}
}

/* Same approach as Top offers: the box sets the size and the image is fitted inside it, so the
   layout never depends on the source image's shape. The grid uses the 180x180 "bigthumb" files,
   so the box is square and capped at 150px (scales down on narrow cards, never enlarges). */
.deal-card-grid .deal-card-image {
	position: relative;
	display: block;
	width: 100%;
	max-width: 150px;
	aspect-ratio: 1 / 1;
	flex-shrink: 0;
	margin: 1rem auto;
}

.deal-card-grid .deal-card-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: contain;
}

/* Grid cards run slightly smaller than the base sizes, as in the design, which also limits how much a name that
   wraps onto several lines stretches the title row (every card in a row shares that row's height). */
.deal-card-grid .deal-card-title {
	margin-bottom: 0.625rem;
	font-size: 0.875rem;
	line-height: 1.25;
}

.deal-card-grid .deal-price-value {
	font-size: 1.5rem;
}

/* Banner offer line above the buttons ("Free Installation"). The box is always rendered so prices and
   buttons line up across a row; the hairlines and text only show when the item has an offer. */
.deal-card-offer {
	display: flex;
	/* Full card width even in the flex fallback (Top offers below 768px), where the card centres its children and
	   the line would otherwise shrink to its text */
	width: 100%;
	align-items: center;
	justify-content: center;
	min-height: 1.875rem;
	margin-top: 1.25rem;
	padding: 0.3125rem 0.25rem;
	border-top: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-size: 0.875rem;
	line-height: 1.25;
	text-align: center;
	color: #102a4b;
}

.deal-card-offer-empty {
	border-color: transparent;
}

/* The banner's icon sits before the text, vertically centred against it (the box is a centring flex row, so this holds
   for one or two lines of text). 1.25em is exactly one line of the text (line-height 1.25), so the icon is never
   taller than a single line; width follows the image's own proportions up to a cap. */
.deal-card-offer-icon {
	flex: 0 0 auto;
	height: 1.25em;
	width: auto;
	max-width: 1.75em;
	margin-right: 0.5rem;
	object-fit: contain;
}

/* SVG icons are repainted in the colour set in the <filter> in content.phtml; a dashboard icon that is a PNG/JPG keeps
   its own colours. */
.deal-card-offer-icon[src$=".svg" i] {
	filter: url(#deals-offer-icon-tint);
}

.deal-card-offer-text {
	min-width: 0;
	/* When the line wraps, share the words evenly across the lines instead of leaving one word on its own
	   ("...cashback from / Samsung"). Browsers without support wrap as they did before. */
	text-wrap: balance;
}

/* The fallback line for a card with no offer line (product protection available / the warranty; see
   DealItemOffers::getFallbackLine()). Same row and the same colour as an offer (the .deal-card-offer text, #102a4b,
   which is also the colour the offer icons are tinted to), with a Font Awesome icon in place of the offer's image. */
.deal-card-fallback-icon {
	flex: 0 0 auto;
	width: 1.25em;
	margin-right: 0.5rem;
	text-align: center;
}

/* Cards hidden by "Filter by offer" (the grid's display rules would otherwise override the hidden attribute) */
.deal-card-grid[hidden] {
	display: none;
}

.deals-filter-empty {
	margin: 0 0 3rem;
	text-align: center;
	color: var(--deals-heading-color, #e6e6e6);
}

.deal-card-grid .deal-card-buttons .deal-btn:first-child {
	flex: 1 1 auto;
}

.deal-card-grid .deal-card-buttons .deal-btn-outline {
	flex: 0 0 auto;
	min-width: 5rem;
}

/* Single-column cards (below 576px) can be wide enough that the buttons don't fill the row, which left a gap after
   View. View now takes a share of the free width too (Add to Basket keeps most of it, 5:1), so the row is always full. */
@media screen and (max-width: 575.98px) {
	.deal-card-grid .deal-card-buttons .deal-btn:first-child {
		flex: 5 1 auto;
	}

	.deal-card-grid .deal-card-buttons .deal-btn-outline {
		flex: 1 1 auto;
	}
}

/* The last row of cards already leaves its 3rem margin-bottom above this link, and the grid's section
   needs no bottom margin of its own (see .more-to-discover). */
.more-to-discover {
	margin-bottom: 0;
}

.deals-browse-all {
	margin-top: 0;
	text-align: center;
}

.deals-main .deals-browse-all a.pushbutton {
	display: inline-block;
	border-radius: 1.5rem;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

/******************************************************************************
* Price block (member / non-member). Same data rules as v1, new look.
******************************************************************************/

.deal-price {
	display: flex;
	align-items: stretch;
}

.deal-price-col {
	display: flex;
	flex-direction: column;
}

/* column-gap only: a row gap would also open space between the label / value / notes rows of the subgrid */
.deal-price-member {
	column-gap: 1rem;
}

.deal-price-col + .deal-price-col {
	padding-left: 1rem;
	border-left: 1px solid #d3d3d3;
}

.deal-price-label {
	/* "Marks+ Member" stays on one line: wrapping it left a gap above the price and knocked the two columns out of line.
	   The code line beside it may wrap instead. */
	white-space: nowrap;
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-size: 0.6875rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #102a4b;
}

.deal-price-value {
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-size: 1.75rem;
	line-height: 1.15;
	color: #102a4b;
}

.deal-price-col-member .deal-price-label,
.deal-price-col-member .deal-price-value {
	color: #0099ff;
}

/* Savings lines under a price: "Save [an extra] £x" and "Was £y". Same look as the list pages (red bold saving,
   struck-through Was price). Both sit below the price, one per line. */
.deal-price-notes {
	margin-top: 0.125rem;
}

.deal-price-save,
.deal-price-was {
	display: block;
	font-size: 0.8125rem;
	line-height: 1.25;
}

.deal-price-save {
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	color: #e40000;
}

.deal-price-was {
	color: #102a4b;
	text-decoration: line-through;
}

/* "£521.10 with code OUTLET10" under the standard price, after any Save / Was lines. A touch larger than those notes
   (it is a price). It is part of the notes row, so on a row of cards the row is as tall as the card with the most lines. */
.deal-price-code {
	display: block;
	font-size: 0.875rem;
	line-height: 1.25;
	/* The red of the "Save £x" lines (.deal-price-save), which this line sits among */
	color: #e40000;
}

/* The code itself is the part to spot at a glance (some have dashes), so it is set in the bold face, like the price */
.deal-price-code strong {
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-weight: normal;
}

.deal-price-code .deal-price-code-value {
	letter-spacing: 0.02em;
}

/* The prices are left-aligned within their columns (the Top offers card centres the block, not the text) */
.deal-price {
	text-align: left;
}

.deal-card-top .deal-price {
	justify-content: center;
}

.deal-card-top .deal-price-value {
	font-size: 2rem;
}

/* The price block continues the cards' subgrid: it spans 3 of the card's rows, one each for the label ("Marks+
   Member" / "Non-member"), the price value and the savings lines. Every card in a row shares those rows, so the
   price values line up across the row even when some cards have a label above them and others don't, and the
   savings lines start at the same height. A row nobody uses (no card has a label) takes no height.
   Without subgrid the block stays a plain flex layout (see above) and just stacks. */
@supports (grid-template-rows: subgrid) {
	.deal-card .deal-card-price {
		display: grid;
		grid-row: span 3;
		grid-template-rows: subgrid;
		margin-top: 0;
	}

	.deal-price {
		display: grid;
		grid-row: 1 / span 3;
		grid-template-rows: subgrid;
		grid-auto-flow: column;
		grid-auto-columns: auto;
		justify-content: start;
		column-gap: 1rem;
	}

	.deal-price-col {
		display: grid;
		grid-row: 1 / span 3;
		grid-template-rows: subgrid;
	}

	.deal-price-label {
		grid-row: 1;
	}

	.deal-price-value {
		grid-row: 2;
	}

	.deal-price-notes {
		grid-row: 3;
	}
}

/******************************************************************************
* Back to top (mobile only; see partials/back-to-top.phtml)
******************************************************************************/

/* Not shown from 768px up: the tablet and desktop layouts don't get the button */
.deals-back-to-top {
	display: none;
}

@media screen and (max-width: 767.98px) {
	/* Centred at the bottom of the screen (clear of the chat button, which sits at the right). 2.75rem is 44px tall,
	   the usual minimum for a comfortable tap target. Hidden (and out of the tab order, via visibility) until the
	   script adds .is-visible, once the visitor has scrolled past the "More to discover" heading. */
	.deals-back-to-top {
		box-sizing: border-box;
		position: fixed;
		bottom: calc(0.875rem + env(safe-area-inset-bottom, 0px));
		left: 50%;
		z-index: 1030;
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		height: 2.75rem;
		padding: 0 1.25rem 0 1rem;
		/* 70% black with white text: stands out less than the earlier white button but is readable over both the dark
		   page and a white card */
		border: 0;
		border-radius: 1.375rem;
		background-color: rgba(0, 0, 0, 0.7);
		color: #ffffff;
		font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
		font-size: 0.9375rem;
		line-height: 1;
		white-space: nowrap;
		box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.35);
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		opacity: 0;
		visibility: hidden;
		transform: translate(-50%, 0.5rem);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	}

	.deals-back-to-top.is-visible {
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, 0);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
	}

	.deals-back-to-top:active {
		background-color: rgba(0, 0, 0, 0.85);
	}

	.deals-back-to-top:focus-visible {
		outline: 2px solid #ffffff;
		outline-offset: 2px;
	}

	.deals-back-to-top i {
		font-size: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.deals-back-to-top,
	.deals-back-to-top.is-visible {
		transition: none;
	}
}

/******************************************************************************
* Applied filters row (under the More to discover heading; built by partials/filters.phtml)
******************************************************************************/

/* "Applied filters" - one chip per ticked option - "Clear all". Shown only while something is ticked. */
.deals-applied {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	margin: -0.5rem 0 1.5rem;
}

.deals-applied[hidden] {
	display: none;
}

.deals-applied-title {
	color: var(--deals-heading-color, #ffffff);
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-size: 1rem;
}

.deals-applied-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
}

.deals-applied-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	min-height: 2.25rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid #c9d0d8;
	border-radius: 0.5rem;
	background-color: #ffffff;
	color: #102a4b;
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-size: 0.9375rem;
	line-height: 1.2;
	cursor: pointer;
}

.deals-applied-chip:hover {
	background-color: #e6e6e6;
}

.deals-applied-chip:focus-visible,
.deals-applied-clear:focus-visible {
	outline: 2px solid var(--deals-nav-active-bg, #0099ff);
	outline-offset: 2px;
}

.deals-applied-chip i {
	font-size: 0.8125rem;
}

.deals-applied-clear {
	padding: 0.5rem 0.25rem;
	border: 0;
	background: none;
	color: var(--deals-nav-active-bg, #0099ff);
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-size: 1rem;
	cursor: pointer;
}

.deals-applied-clear:hover {
	text-decoration: underline;
}

/* The mobile headings above are centred, so the row is too */
@media screen and (max-width: 767.98px) {
	.deals-applied {
		justify-content: center;
		text-align: center;
	}

	.deals-applied-list {
		justify-content: center;
	}
}
