/*! SD Store 0.2.0 | sd-grid.css | Silent Diving | Spilt Media
 * Category grids ([sd_products], [wps_products] takeover), the product card (grids and related products) and the
 * shared .sd-btn buttons. Same tokens and card look as the search results page (sd-store.css .sd-search-card), so the
 * store reads as one system. Scoped to .sd-grid*, .sd-card*, .sd-btn*, .sd-related*; nothing reaches the theme.
 * Two classes deep on buttons/inputs so Hello Elementor's [type=button] pink and input resets never win.
 */

.sd-grid,
.sd-related,
.sd-pdp,
.sd-pdp-crumbs,
.sd-pdp-gallery,
.sd-pdp-buy,
.sd-pdp-desc,
.sd-pdp-zoom {
	--sd-store-ink: #0b2636;
	--sd-store-navy: #0b3046;
	--sd-store-heading: #12364d;
	--sd-store-text: #26343e;
	--sd-store-muted: #52616c;
	--sd-store-line: #dde6eb;
	--sd-store-line-strong: #c3d1d9;
	--sd-store-control: #7d919e;
	--sd-store-well: #f3f6f8;
	--sd-store-tint: #eef6fa;
	--sd-store-blue: #009efb;      /* brand blue: fills only, navy text on it (4.8:1) */
	--sd-store-blue-hover: #33b1fc;
	--sd-store-link: #006dad;      /* brand text blue on light (5.4:1 on white) */
	--sd-store-accent: #f3d500;
	--sd-store-ok: #17663a;
	--sd-store-warn: #8a3b12;
	--sd-store-radius: 8px;
	--sd-store-radius-sm: 6px;
	/* Two families, the ones the site renders: Oswald (headings) and Titillium Web (text). Not the Elementor kit
	 * variables: kit 445 still holds Elementor's defaults (Roboto, not loaded), so var(--e-global-…) would fall back
	 * to a third, system font. */
	--sd-store-font-display: "Oswald", "Arial Narrow", Arial, sans-serif;
	--sd-store-font-head: "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--sd-store-font-body: "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--sd-store-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

.sd-grid,
.sd-related {
	box-sizing: border-box;
	width: 100%;           /* never sized by its content inside an Elementor column */
	max-width: 100%;
	min-width: 0;
	align-self: stretch;
	text-align: left;      /* Elementor columns may centre text (Cells) */
	margin-bottom: 64px;   /* the site's grey blog band follows on category pages */
	color: var(--sd-store-text);
	font-family: var(--sd-store-font-body);
	font-size: 16px;
	line-height: 1.5;
}

.sd-grid *,
.sd-grid *::before,
.sd-grid *::after,
.sd-related *,
.sd-related *::before,
.sd-related *::after {
	box-sizing: border-box;
}

.sd-store-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* =====================================================================================================
   Buttons (shared with the product page)
   ===================================================================================================== */

.sd-grid .sd-btn,
.sd-related .sd-btn,
.sd-pdp-buy .sd-btn,
.sd-pdp .sd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 0 22px;
	border: 1px solid var(--sd-store-navy);
	border-radius: var(--sd-store-radius-sm);
	background: #fff;
	color: var(--sd-store-navy);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.sd-grid .sd-btn:hover,
.sd-grid .sd-btn:focus,
.sd-related .sd-btn:hover,
.sd-pdp .sd-btn--outline:hover,
.sd-pdp .sd-btn--outline:focus {
	border-color: var(--sd-store-navy);
	background: var(--sd-store-tint);
	color: var(--sd-store-navy);
}

.sd-grid .sd-btn:focus-visible,
.sd-related .sd-btn:focus-visible,
.sd-pdp .sd-btn:focus-visible,
.sd-pdp-buy .sd-btn:focus-visible {
	outline: 2px solid var(--sd-store-navy);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--sd-store-accent);
}

/* =====================================================================================================
   Grid toolbar
   ===================================================================================================== */

.sd-grid__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	min-height: 60px;
	padding: 0 0 14px;
	border-bottom: 1px solid var(--sd-store-line);
}

.sd-grid__summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 20px;
}

.sd-grid .sd-grid__help {
	margin: 0;
	color: var(--sd-store-muted);
	font-size: 15px;
	line-height: 1.4;
}

.sd-grid .sd-grid__help a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--sd-store-link);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.sd-grid .sd-grid__help a:hover {
	color: var(--sd-store-navy);
}

.sd-grid .sd-grid__help a:focus-visible {
	outline: 2px solid var(--sd-store-navy);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--sd-store-accent);
}

.sd-grid .sd-grid__count {
	margin: 0;
	color: var(--sd-store-text);
	font-size: 16px;
	line-height: 1.4;
}

.sd-grid__count strong {
	color: var(--sd-store-ink);
	font-weight: 700;
}

.sd-grid__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
}

/* Until sd-grid.js is ready the controls keep their space (no layout shift) but can't be used. */
.sd-grid:not(.is-ready) .sd-grid__controls {
	visibility: hidden;
}

.sd-grid .sd-grid__field {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	color: var(--sd-store-muted);
	font-size: 15px;
	line-height: 1.2;
	white-space: nowrap;
}

.sd-grid .sd-grid__label {
	color: var(--sd-store-muted);
	font-size: 15px;
}

.sd-grid select.sd-grid__select {
	display: block;
	width: auto;
	min-width: 180px;
	max-width: 280px;
	height: 44px;
	margin: 0;
	padding: 0 40px 0 14px;
	border: 1px solid var(--sd-store-control);
	border-radius: var(--sd-store-radius-sm);
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230b3046' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
	color: var(--sd-store-ink);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-overflow: ellipsis;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.sd-grid select.sd-grid__select:hover {
	border-color: var(--sd-store-navy);
}

.sd-grid select.sd-grid__select:focus-visible,
.sd-grid .sd-grid__check:focus-within {
	outline: 2px solid var(--sd-store-navy);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--sd-store-accent);
}

.sd-grid .sd-grid__check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	margin: 0;
	padding: 0 4px;
	border-radius: var(--sd-store-radius-sm);
	color: var(--sd-store-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
}

.sd-grid input.sd-grid__checkbox {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	accent-color: var(--sd-store-navy);
	cursor: pointer;
}

.sd-grid input.sd-grid__checkbox:focus {
	outline: none;
	box-shadow: none;
}

/* =====================================================================================================
   Grid list
   ===================================================================================================== */

.sd-grid__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px 20px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

.sd-grid__list--4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sd-grid__item {
	display: flex;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.sd-grid__item::before,
.sd-grid__item::marker {
	content: none;
}

.sd-grid__item.is-more,
.sd-grid__item.is-hidden {
	display: none;
}

/* =====================================================================================================
   Card (same look as .sd-search-card)
   ===================================================================================================== */

.sd-card,
.sd-card * {
	text-align: left;
}

.sd-card {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	padding: 12px;
	border: 1px solid var(--sd-store-line);
	border-radius: var(--sd-store-radius);
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.2s var(--sd-store-ease);
}

.sd-card:hover {
	border-color: var(--sd-store-control);
	box-shadow: 0 6px 18px rgba(7, 28, 40, 0.08);
}

.sd-card__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--sd-store-radius-sm);
	background: var(--sd-store-well);
}

.sd-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 8%;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
	mix-blend-mode: multiply;
	transition: transform 0.25s var(--sd-store-ease);
}

.sd-card:hover .sd-card__media img {
	transform: scale(1.03);
}

.sd-card.is-oos .sd-card__media img {
	opacity: 0.55;
}

.sd-card__noimg {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: #6b7b86;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
}

.sd-card__noimg svg {
	width: 32px;
	height: 32px;
}

.sd-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	padding-top: 14px;
	container-type: inline-size; /* the quick add shows its "Add" label only when the body is wide enough */
}

.sd-grid .sd-card__title,
.sd-related .sd-card__title,
.sd-card .sd-card__title {
	display: block;
	min-height: 2.6em;
	margin: 0;
	padding: 0;
	color: var(--sd-store-heading);
	font-family: var(--sd-store-font-head);
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.3;
	text-transform: none;
	overflow-wrap: anywhere;
}

/* Clamp at three lines, not two: the search page found two lines made sibling parts read the same
 * ("Rebreather Mouthpiece (DSV) wit..."). Rows share the tallest card, so heights stay even. */
.sd-card .sd-card__link {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	color: inherit;
	text-decoration: none;
}

/* Whole card is the link's hit area; one tab stop per card. */
.sd-card .sd-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: var(--sd-store-radius);
}

.sd-card:hover .sd-card__link {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.sd-card .sd-card__link:focus {
	outline: none;
	box-shadow: none;
}

.sd-card .sd-card__link:focus-visible::after {
	outline: 2px solid var(--sd-store-navy);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--sd-store-accent);
}

.sd-card .sd-card__sku {
	margin: 0;
	color: var(--sd-store-muted);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.sd-card__sku b {
	color: var(--sd-store-text);
	font-weight: 600;
}

.sd-card .sd-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	margin: auto 0 0;
	padding-top: 10px;
	color: var(--sd-store-ink);
	font-family: var(--sd-store-font-head);
	font-size: 19px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.25;
}

.sd-card__price s {
	color: var(--sd-store-muted);
	font-size: 15px;
	font-weight: 600;
}

.sd-card .sd-card__stock {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: var(--sd-store-ok);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.sd-card__stock::before {
	content: "";
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

.sd-card .sd-card__stock.is-out {
	color: var(--sd-store-warn);
}

.sd-card__actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.sd-card .sd-card__cta {
	text-align: center;
}

.sd-card__cta {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--sd-store-navy);
	border-radius: var(--sd-store-radius-sm);
	color: var(--sd-store-navy);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	transition: background-color 0.15s, color 0.15s;
}

.sd-card:hover .sd-card__cta {
	background: var(--sd-store-navy);
	color: #fff;
}

/* Quick add: above the whole-card link (z-index 2), brand blue with navy text. Icon only in narrow cards. */
.sd-card button.sd-card__add {
	position: relative;
	z-index: 2;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 11px;
	border: 1px solid var(--sd-store-blue);
	border-radius: var(--sd-store-radius-sm);
	background: var(--sd-store-blue);
	color: var(--sd-store-navy);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s;
}

.sd-card button.sd-card__add:hover,
.sd-card button.sd-card__add:focus {
	border-color: var(--sd-store-blue-hover);
	background: var(--sd-store-blue-hover);
	color: var(--sd-store-navy);
}

.sd-card button.sd-card__add:focus-visible {
	outline: 2px solid var(--sd-store-navy);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--sd-store-accent);
}

.sd-card button.sd-card__add[aria-busy="true"] {
	cursor: progress;
	opacity: 0.75;
}

.sd-card button.sd-card__add.is-added {
	border-color: var(--sd-store-ok);
	background: var(--sd-store-ok);
	color: #fff;
}

.sd-card button.sd-card__add.is-error {
	border-color: var(--sd-store-warn);
	background: #fff;
	color: var(--sd-store-warn);
}

.sd-card__add svg {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
}

.sd-card__add-text {
	display: none;
}

@container (min-width: 215px) {
	.sd-card__add-text {
		display: inline;
	}
}

/* =====================================================================================================
   Empty, show more
   ===================================================================================================== */

.sd-grid__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin: 40px 0 0;
	padding: 40px 20px;
	border: 1px dashed var(--sd-store-line-strong);
	border-radius: var(--sd-store-radius);
	text-align: center;
}

.sd-grid__empty[hidden],
.sd-grid__more[hidden] {
	display: none;
}

.sd-grid__empty p,
.sd-grid .sd-grid__none {
	margin: 0;
	color: var(--sd-store-text);
	font-size: 16px;
}

.sd-grid .sd-grid__none a {
	color: var(--sd-store-link);
	font-weight: 600;
}

.sd-grid__more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin: 40px 0 0;
	text-align: center;
}

.sd-grid .sd-grid__progress {
	margin: 0;
	color: var(--sd-store-muted);
	font-size: 15px;
}

.sd-grid .sd-grid__more-btn {
	min-width: 220px;
	min-height: 48px;
}

/* =====================================================================================================
   Responsive: 3-4 columns desktop, 2 at 768-1024 and phones, 1 under 380px
   ===================================================================================================== */

@media (min-width: 1025px) and (max-width: 1199.98px) {
	.sd-grid__list--4 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 1024.98px) {
	/* Elementor's column already pads 10px; this makes the store's side gutter 20px at tablet and phone widths. */
	.sd-grid {
		padding-right: 10px;
		padding-left: 10px;
	}

	.sd-grid__list,
	.sd-grid__list--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px 16px;
	}
}

@media (max-width: 767.98px) {
	.sd-grid {
		margin-bottom: 48px;
	}

	.sd-grid__toolbar {
		align-items: stretch;
		flex-direction: column;
		gap: 12px;
	}

	.sd-grid__controls {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px 12px;
	}

	.sd-grid .sd-grid__field {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
		min-width: 0;
	}

	.sd-grid .sd-grid__label {
		font-size: 14px;
	}

	.sd-grid select.sd-grid__select {
		width: 100%;
		min-width: 0;
		max-width: none;
	}

	.sd-grid .sd-grid__check {
		grid-column: 1 / -1;
		order: 3;
	}

	.sd-grid__list,
	.sd-grid__list--4 {
		gap: 16px 12px;
		margin-top: 20px;
	}

	.sd-card {
		padding: 8px;
	}

	.sd-card__body {
		padding: 10px 2px 2px;
	}

	.sd-grid .sd-card__title,
	.sd-related .sd-card__title,
	.sd-card .sd-card__title {
		font-size: 16px;
	}

	.sd-card .sd-card__price {
		font-size: 17px;
	}

	.sd-card__price s {
		font-size: 14px;
	}

	.sd-card__actions {
		flex-wrap: wrap;
		margin-top: 10px;
	}

	/* Never narrower than its label (QA 11/27: "View product" spilled out of a 77px button); quick add wraps below. */
	.sd-card__cta {
		flex: 1 0 auto;
		padding: 0 8px;
		font-size: 14px;
	}

	.sd-card button.sd-card__add {
		flex: 1 0 auto;
	}
}

/* Small phones: one horizontal card per row (as the search results page) */
@media (max-width: 379.98px) {
	.sd-grid__list,
	.sd-grid__list--4 {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.sd-card {
		display: grid;
		grid-template-columns: 112px minmax(0, 1fr);
		gap: 0 14px;
		align-items: start;
		padding: 10px;
	}

	.sd-card__body {
		padding: 0;
	}

	.sd-card .sd-card__title {
		min-height: 0;
	}

	.sd-card .sd-card__price {
		margin-top: 4px;
		padding-top: 4px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sd-card,
	.sd-card__media img,
	.sd-card__cta,
	.sd-card__add {
		transition: none;
	}

	.sd-card:hover .sd-card__media img {
		transform: none;
	}
}

@media (forced-colors: active) {
	.sd-card,
	.sd-card__cta,
	.sd-card__add {
		border: 1px solid CanvasText;
	}
}
