/*
 * The shop's look on top of Vela (options are in skin.json): a deep navy ink header and footer,
 * a pale blue-grey page, white cards with soft shadows, blue pill buttons and a yellow accent.
 * Sora for headings, Manrope for text.
 */

:root {
	--sdshop-ink: #03102c;
	--sdshop-ink-muted: #9fafc8;
	--sdshop-ink-border: rgba(255, 255, 255, 0.12);
	--sdshop-primary: #076be3;
	--sdshop-primary-hover: #0054cb;
	--sdshop-accent: #fccf28;
	--sdshop-muted: #5e6a7b;
	--sdshop-border: #dce2e9;
	--sdshop-tag: #e5ecf5;
	--sdshop-radius: 14px;
	--sdshop-shadow: 0 1px 2px rgba(10, 21, 42, 0.06), 0 8px 24px -12px rgba(10, 21, 42, 0.18);
	--sdshop-shadow-lift: 0 2px 4px rgba(10, 21, 42, 0.06), 0 24px 48px -16px rgba(7, 84, 203, 0.35);
}

h1,
h2,
h3 {
	letter-spacing: -0.02em;
}

/* Header: one ink row, logo left, menu centred, the cart as a yellow pill. */
.site-header {
	border-bottom: 1px solid var(--sdshop-ink-border);
	background: var(--sdshop-ink);
}

.site-header .custom-logo {
	width: auto;
	max-height: 40px;
}

.site-header__row .primary-navigation .menu > li > a {
	font-weight: 500;
}

.site-header__row .primary-navigation .current-menu-item > a {
	color: #fff;
}

.site-header .header-cart {
	gap: 6px;
	height: 34px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--sdshop-accent);
	color: var(--sdshop-ink);
}

.site-header .header-cart:hover {
	background: #ffdb4d;
	color: var(--sdshop-ink);
}

.site-header .header-cart svg {
	width: 16px;
	height: 16px;
}

.site-header .header-cart__count {
	position: static;
	min-width: 0;
	padding: 0;
	background: none;
	color: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1;
}

/* The account link: text only, muted like the menu ("Log in" / "My account"); an icon on phones. */
.site-header .header-account {
	margin-right: 8px;
	color: var(--vela-menu-link-color);
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
}

.site-header .header-account:hover {
	color: #fff;
}

.site-header .header-account__icon {
	display: none;
}

@media (max-width: 1023px) {
	.site-header .header-account__icon {
		display: block;
		width: 20px;
		height: 20px;
	}

	.site-header .header-account__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}

/* Cards and buttons. */
.sdshop-card,
.sdshop-product-sidebar .widget:not(.widget_block:has(.wp-block-sfdc-shop-purchase-box)) {
	margin-bottom: 24px;
	padding: 20px;
	border: 1px solid var(--sdshop-border);
	border-radius: var(--sdshop-radius);
	background: #fff;
	box-shadow: var(--sdshop-shadow);
}

.sdshop-product-sidebar .widget:has(.wp-block-sfdc-shop-purchase-box) {
	margin-bottom: 24px;
}

.wp-element-button,
.wp-block-button__link,
.woocommerce .button,
.woocommerce button.button,
.woocommerce a.button {
	border-radius: 999px;
	background: var(--sdshop-primary);
	color: #fff;
	font-weight: 700;
}

:is(.wp-element-button, .wp-block-button__link, .woocommerce .button, .woocommerce button.button, .woocommerce a.button):hover {
	background: var(--sdshop-primary-hover);
	color: #fff;
}

.woocommerce :is(input.input-text, select, textarea),
.woocommerce form .form-row :is(input.input-text, select, textarea) {
	border: 1px solid var(--sdshop-border);
	border-radius: 10px;
	background: #fff;
}

/* Primary-coloured covers (the home page's) take the shop hero's ink gradient. */
.wp-block-cover .wp-block-cover__background.has-background-dim.has-primary-background-color {
	background:
		radial-gradient(ellipse at 20% 0%, rgba(0, 91, 210, 0.55), transparent 55%),
		radial-gradient(ellipse at 90% 100%, rgba(0, 96, 164, 0.45), transparent 50%),
		linear-gradient(180deg, #03102c, #030920);
	opacity: 1;
}

.wp-block-cover h1 {
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	font-weight: 800;
	line-height: 1.1;
}

/* Footer: one ink row, the copyright left and the menu right. */
.site-footer {
	margin-top: 64px;
	background: var(--sdshop-ink);
}

.site-footer a:hover {
	color: #fff;
}

/* ---- Single product (body.sdshop-product-layout, inc/product-page.php) ---- */

.sdshop-product-title {
	padding-top: 48px;
	text-align: center;
}

.sdshop-product-title .product_title {
	margin: 0;
	font-size: 2rem;
}

.sdshop-product-layout .site-content {
	padding-top: 32px;
}

/* Breadcrumbs (Vela's or WooCommerce's), the empty summary column and the gallery are not on
   the original page. */
.sdshop-product-layout :is(.breadcrumbs, .woocommerce-breadcrumb, .summary.entry-summary, .woocommerce-product-gallery) {
	display: none;
}

.sdshop-product-layout div.product {
	display: block;
}

/* The description card: the video, the website button (the original's Live Preview), the four
   link tiles (an HTML table of images), then the promo images full width. */
.sdshop-description > :first-child {
	margin-top: 0;
}

.sdshop-description img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-inline: auto;
}

.sdshop-description p {
	margin: 0 0 16px;
}

.sdshop-description .wp-block-buttons {
	justify-content: center;
	margin: 0 0 24px;
	padding: 12px;
	background: var(--sdshop-border);
}

.sdshop-description .wp-block-button__link {
	padding: 8px 18px;
	border-radius: 4px;
	background: var(--sdshop-primary);
	color: #fff;
	font-weight: 600;
}

.sdshop-description .wp-block-button__link::before {
	content: "👁 ";
}

.sdshop-description .wp-block-embed {
	margin: 0;
}

.sdshop-description table {
	width: 100%;
	margin: 0 0 24px;
	border: 0;
	border-collapse: separate;
	border-spacing: 4px;
}

.sdshop-description td {
	width: 25%;
	padding: 0;
	border: 0;
	background: var(--sdshop-border);
	vertical-align: middle;
}

.sdshop-description td img {
	margin: 0;
}

@media (max-width: 599px) {
	.sdshop-description tr {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 4px;
	}

	.sdshop-description td {
		width: auto;
	}
}

/* The product sidebar: sticky on desktop; the "Products" thumbnails two by two. */
@media (min-width: 1024px) {
	.sdshop-product-layout .sdshop-product-sidebar {
		position: sticky;
		top: 24px;
		align-self: start;
	}
}

.sdshop-product-sidebar .sdshop-widget-title {
	margin: 0 0 12px;
	color: var(--sdshop-primary);
	font-size: 0.8rem;
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
}

.sdshop-product-sidebar ul.products {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 0;
}

.sdshop-product-sidebar ul.products::before,
.sdshop-product-sidebar ul.products::after {
	display: none;
}

.sdshop-product-sidebar ul.products li.product {
	width: auto;
	margin: 0;
	padding: 6px;
	border: 1px solid var(--sdshop-border);
	border-radius: var(--sdshop-radius);
}

.sdshop-product-sidebar ul.products li.product :is(.price, .button, .star-rating, .woocommerce-loop-product__title) {
	display: none;
}

.sdshop-product-sidebar ul.products li.product img {
	margin: 0;
	border-radius: 4px;
}

/* Phones and tablets: the purchase box first, then the description, then the rest. */
@media (max-width: 1023px) {
	.sdshop-product-layout .site-content {
		display: flex;
		flex-direction: column;
	}

	.sdshop-product-layout .sdshop-product-sidebar {
		display: contents;
	}

	.sdshop-product-layout .site-main {
		order: 1;
	}

	.sdshop-product-layout .sdshop-product-sidebar .widget {
		order: 2;
	}

	.sdshop-product-layout .sdshop-product-sidebar .widget:has(.wp-block-sfdc-shop-purchase-box) {
		order: 0;
	}
}

/* Phones: a smaller logo, so it and the cart share one row. */
@media (max-width: 599px) {
	.site-header .custom-logo {
		max-height: 32px;
	}
}

/* ---- Shop and category pages (inc/shop-page.php): ink hero, filter bar, wide cards, promises ---- */

.sdshop-band {
	padding: 72px 0 104px;
	background:
		linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 48px 48px,
		linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 48px 48px,
		radial-gradient(ellipse at 20% 0%, rgba(0, 91, 210, 0.55), transparent 55%),
		radial-gradient(ellipse at 90% 100%, rgba(0, 96, 164, 0.45), transparent 50%),
		linear-gradient(180deg, #03102c, #030920);
	color: var(--sdshop-ink-muted);
}

.sdshop-band__title {
	max-width: 640px;
	margin: 0 0 20px;
	color: #fff;
	font-size: clamp(2.25rem, 5vw, 3.75rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.025em;
}

.sdshop-band__accent {
	color: var(--sdshop-accent);
}

.sdshop-band__line {
	max-width: 480px;
	margin: 0 0 24px;
	font-size: 1rem;
	line-height: 1.6;
}

.sdshop-band__checks {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin: 0;
	padding: 0;
	font-size: 0.8125rem;
	list-style: none;
}

.sdshop-band__checks li::before {
	content: "✓";
	margin-right: 8px;
	color: var(--sdshop-accent);
	font-weight: 700;
}

:is(.woocommerce-shop, .tax-product_cat) .site-content {
	padding-top: 0;
}

/* The bar sits over the hero's bottom edge. */
.sdshop-bar {
	display: flex;
	flex-wrap: wrap;
	position: relative;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: -52px 0 32px;
	padding: 8px;
	border: 1px solid var(--sdshop-border);
	border-radius: 16px;
	background: #fff;
	box-shadow: var(--sdshop-shadow);
}

.sdshop-bar__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.sdshop-chip {
	padding: 6px 16px;
	border-radius: 999px;
	color: var(--sdshop-muted);
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.sdshop-chip:hover,
.sdshop-chip:focus-visible {
	background: var(--sdshop-tag);
	color: var(--sdshop-ink);
}

.sdshop-chip.is-current {
	background: var(--sdshop-ink);
	color: #fff;
}

.sdshop-bar__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sdshop-bar :is(.woocommerce-product-search, .woocommerce-ordering) {
	margin: 0;
}

.sdshop-bar .woocommerce-product-search {
	position: relative;
}

.sdshop-bar .woocommerce-product-search .search-field {
	width: 190px;
	height: 34px;
	padding: 0 12px 0 34px;
	border: 0;
	border-radius: 999px;
	background: #eaeff5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235e6a7b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 12px center / 14px no-repeat;
	font-size: 0.8125rem;
}

.sdshop-bar .woocommerce-product-search button {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.sdshop-bar .woocommerce-ordering select {
	height: 34px;
	padding: 0 32px 0 14px;
	border: 0;
	border-radius: 999px;
	background-color: #eaeff5;
	color: var(--sdshop-ink);
	font-size: 0.8125rem;
	font-weight: 600;
}

:is(.woocommerce-shop, .tax-product_cat) .woocommerce-result-count {
	float: none;
	margin: 0 0 16px;
	color: var(--sdshop-muted);
	font-size: 0.8125rem;
}

/* Products: two wide cards a row, image left. */
:is(.woocommerce-shop, .tax-product_cat) ul.products {
	display: grid;
	clear: both;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	margin: 0;
}

:is(.woocommerce-shop, .tax-product_cat) ul.products::before,
:is(.woocommerce-shop, .tax-product_cat) ul.products::after {
	display: none;
}

/* [class] outweighs WooCommerce's `.woocommerce ul.products.columns-N li.product` widths. The
   product link is display: contents, so the image, labels and price place on the card's grid. */
:is(.woocommerce-shop, .tax-product_cat) ul.products[class] li.product {
	display: grid;
	position: relative;
	grid-template-columns: 41% 1fr auto;
	grid-template-rows: auto auto auto 1fr auto;
	column-gap: 16px;
	width: auto;
	min-height: 216px;
	margin: 0;
	padding: 0 16px 0 0;
	overflow: hidden;
	border: 1px solid var(--sdshop-border);
	border-radius: var(--sdshop-radius);
	background: #fff;
	box-shadow: var(--sdshop-shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

:is(.woocommerce-shop, .tax-product_cat) ul.products li.product:hover {
	box-shadow: var(--sdshop-shadow-lift);
	transform: translateY(-3px);
}

:is(.woocommerce-shop, .tax-product_cat) ul.products[class] li.product a.woocommerce-LoopProduct-link {
	display: contents;
	color: inherit;
	text-decoration: none;
}

:is(.woocommerce-shop, .tax-product_cat) ul.products li.product a img {
	grid-row: 1 / -1;
	grid-column: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

:is(.woocommerce-shop, .tax-product_cat) ul.products li.product > :not(a.woocommerce-LoopProduct-link),
:is(.woocommerce-shop, .tax-product_cat) ul.products li.product .woocommerce-LoopProduct-link > :not(img, .sdshop-card__badge, .onsale) {
	grid-column: 2 / -1;
}

.sdshop-card__badge,
:is(.woocommerce-shop, .tax-product_cat) ul.products li.product .onsale {
	position: absolute;
	z-index: 1;
	top: 12px;
	left: 12px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--sdshop-accent);
	color: var(--sdshop-ink);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.5;
}

:is(.woocommerce-shop, .tax-product_cat) .sdshop-card__category {
	grid-row: 1;
	padding-top: 20px;
	color: var(--sdshop-muted);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.sdshop-card__category span:first-child {
	color: var(--sdshop-primary);
}

.sdshop-card__category span + span::before {
	content: "·";
	margin: 0 8px;
	color: var(--sdshop-border);
}

:is(.woocommerce-shop, .tax-product_cat) ul.products li.product .woocommerce-loop-product__title {
	grid-row: 2;
	margin: 6px 0 4px;
	padding: 0;
	color: var(--sdshop-ink);
	font-size: 1.0625rem;
	line-height: 1.3;
}

.sdshop-card__line {
	grid-row: 3;
	margin: 0 0 10px;
	color: var(--sdshop-muted);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.sdshop-card__tags {
	display: flex;
	flex-wrap: wrap;
	grid-row: 4;
	align-content: start;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sdshop-card__tags li {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--sdshop-tag);
	color: var(--sdshop-ink);
	font-size: 0.6875rem;
	font-weight: 500;
}

:is(.woocommerce-shop, .tax-product_cat) ul.products li.product .price {
	grid-row: 5;
	grid-column: 2;
	align-self: end;
	margin: 16px 0 20px;
	color: var(--sdshop-ink);
	font-family: var(--wp--preset--font-family--sora, inherit);
	font-size: 1.375rem;
	font-weight: 800;
	line-height: 1.1;
}

:is(.woocommerce-shop, .tax-product_cat) ul.products li.product .price .amount {
	display: inline;
}

.sdshop-from {
	display: block;
	color: var(--sdshop-muted);
	font-family: var(--wp--preset--font-family--manrope, inherit);
	font-size: 0.6875rem;
	font-weight: 500;
}

:is(.woocommerce-shop, .tax-product_cat) ul.products[class] li.product .button {
	grid-row: 5;
	grid-column: 3;
	align-self: end;
	margin: 0 0 20px;
	padding: 8px 16px;
	font-size: 0.8125rem;
	white-space: nowrap;
}

:is(.woocommerce-shop, .tax-product_cat) ul.products li.product .button::after {
	content: " →";
}

/* Promises under the products. */
.sdshop-promises {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 48px 0 0;
	padding: 20px 24px;
	border: 1px solid var(--sdshop-border);
	border-radius: 16px;
	background: #fff;
	list-style: none;
}

.sdshop-promises li {
	display: grid;
	position: relative;
	padding-left: 44px;
	font-size: 0.8125rem;
}

.sdshop-promises li::before {
	content: "✓";
	display: grid;
	position: absolute;
	top: 2px;
	left: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--sdshop-tag);
	color: var(--sdshop-primary);
	font-weight: 700;
	place-items: center;
}

.sdshop-promises strong {
	color: var(--sdshop-ink);
	font-size: 0.9375rem;
}

.sdshop-promises span {
	color: var(--sdshop-muted);
}

@media (max-width: 899px) {
	:is(.woocommerce-shop, .tax-product_cat) ul.products {
		grid-template-columns: 1fr;
	}

	.sdshop-promises {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 599px) {
	.sdshop-band {
		padding: 48px 0 88px;
	}

	.sdshop-bar__tools,
	.sdshop-bar__tools > *,
	.sdshop-bar :is(.woocommerce-product-search .search-field, select) {
		width: 100%;
	}

	:is(.woocommerce-shop, .tax-product_cat) ul.products[class] li.product {
		grid-template-columns: 1fr auto;
		padding: 0 16px;
	}

	:is(.woocommerce-shop, .tax-product_cat) ul.products li.product a img {
		grid-row: auto;
		grid-column: 1 / -1;
		width: calc(100% + 32px);
		height: auto;
		margin: 0 -16px;
		aspect-ratio: 16 / 9;
	}

	:is(.woocommerce-shop, .tax-product_cat) ul.products li.product > :not(a.woocommerce-LoopProduct-link),
	:is(.woocommerce-shop, .tax-product_cat) ul.products li.product .woocommerce-LoopProduct-link > :not(img, .sdshop-card__badge, .onsale) {
		grid-row: auto;
		grid-column: 1 / -1;
	}

	:is(.woocommerce-shop, .tax-product_cat) ul.products li.product .price {
		grid-column: 1;
	}

	:is(.woocommerce-shop, .tax-product_cat) ul.products[class] li.product .button {
		grid-row: -2;
		grid-column: 2;
	}
}
