/**
 * Envo Blocks Store – home page patterns (sections with the class .eb-section).
 * Loaded on the front end and in the editor.
 */

/* ---------- Shared ---------- */

.eb-section .wp-block-buttons:not(.eb-sample-product__button) .wp-element-button {
	border-radius: 6px;
	font-size: 0.875rem;
	letter-spacing: 0;
	padding: 0.75rem 1.5rem;
	text-transform: none;
}
.eb-section .wp-block-image img {
	display: block;
}

/* ---------- Header icons without WooCommerce (same spacing as the WooCommerce blocks) ---------- */

.eb-header-icon {
	margin: 0;
	padding: 0 8px;
}
.eb-header-icon a {
	display: block;
}

/* ---------- Store header (three rows) ---------- */

.eb-topbar p {
	margin: 0;
}
.eb-header-store__search {
	flex: 1 1 auto;
	max-width: 620px;
}
.eb-header-store__trending {
	font-size: 0.75rem !important;
	line-height: 1.4;
	margin: 0;
}
.eb-header-store__trending a {
	color: var(--wp--preset--color--primary);
}
.eb-header-store__search .wp-block-search__inside-wrapper {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	padding: 2px;
}
.eb-header-store__search .wp-block-search__input {
	border: 0;
	font-size: 0.9375rem;
	line-height: 1.4;
	min-height: 0;
	padding: 0.3rem 0.75rem;
}
.eb-header-store__search .wp-block-search__button {
	border-radius: 4px;
	line-height: 1;
	margin-left: 0;
	min-height: 0;
	padding: 0.4rem 0.8rem;
}
.eb-header-store__search .wp-block-search__button svg {
	height: 20px;
	min-height: 0;
	min-width: 0;
	width: 20px;
}

/* ---------- Store footer ---------- */

.eb-footer-store h2 {
	margin-bottom: 1.25rem;
}
.eb-footer-store__links ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.eb-footer-store__links li {
	margin: 0 0 0.6rem;
}
.eb-footer-store a {
	text-decoration: none;
}
.eb-footer-store a:hover {
	color: var(--wp--preset--color--secondary) !important;
	text-decoration: underline;
}
.eb-footer-store__about,
.eb-footer-store__promises {
	opacity: 0.8;
}
.eb-footer-store__note {
	background: rgba(255, 255, 255, 0.07);
}
.eb-footer-store__note p {
	margin: 0;
}
.eb-footer-store__note p::before {
	color: var(--wp--preset--color--primary);
	content: "●";
	font-size: 0.6em;
	margin-right: 0.6em;
	vertical-align: 0.2em;
}
.eb-footer-store__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.eb-footer-store__bottom p {
	margin: 0;
}

/* ---------- Hero ---------- */

.eb-hero > .wp-block-columns > .wp-block-column {
	display: flex;
	flex-direction: column;
}
.eb-hero .eb-cats,
.eb-hero .eb-hero__main {
	flex: 1;
	margin-block: 0;
}
.eb-hero .eb-hero__main {
	display: flex;
	overflow: hidden;
}
.eb-hero .eb-hero__main > .wp-block-columns {
	flex: 1;
	align-items: stretch !important;
	margin: 0;
}
.eb-hero .eb-hero__figure {
	align-self: center !important;
	padding: 40px 40px 40px 0;
}
.eb-hero .eb-hero__image {
	margin: 0;
}
.eb-hero .eb-hero__image img {
	filter: drop-shadow(0 18px 24px rgba(0, 60, 100, 0.22));
	height: auto;
	max-height: 380px;
	max-width: 100%;
	width: auto;
}

/* Decorative shapes behind the transparent cut-out images. */
.eb-hero__image,
.eb-tile__image,
.eb-offer__image {
	align-items: flex-end;
	display: flex;
	isolation: isolate;
	justify-content: center;
	position: relative;
}
.eb-hero__image img,
.eb-tile__image img,
.eb-offer__image img {
	position: relative;
	z-index: 1;
}
.eb-hero__image::before,
.eb-hero__image::after,
.eb-tile__image::before,
.eb-offer__image::before,
.eb-offer__image::after {
	content: "";
	pointer-events: none;
	position: absolute;
	z-index: 0;
}
/* Hero: a large soft circle, an primary ring and a small primary dot (the ring's shadow). */
.eb-hero__image::before {
	aspect-ratio: 1;
	background: #b9dcf2;
	border-radius: 50%;
	left: 62%;
	top: 60%;
	transform: translate(-50%, -50%);
	width: min(320px, 92%);
}
.eb-hero__image::after {
	aspect-ratio: 1;
	border: 3px solid var(--wp--preset--color--primary);
	border-radius: 50%;
	box-shadow: -40px 250px 0 -18px var(--wp--preset--color--primary);
	right: -4%;
	top: -2%;
	width: 64px;
}
/* Tiles: a circle in the opposite tint of the tile. */
.eb-tile__image::before {
	aspect-ratio: 1;
	background: var(--wp--preset--color--background);
	border-radius: 50%;
	bottom: 4px;
	left: 50%;
	transform: translateX(-50%);
	width: 136px;
}
.has-surface-background-color .eb-tile__image::before {
	background: var(--wp--preset--color--secondary);
}
/* Offer: a white pill tilted behind the product and a small primary ring. */
.eb-offer__image::before {
	background: var(--wp--preset--color--background);
	border-radius: 999px;
	height: 72%;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) rotate(-8deg);
	width: min(440px, 96%);
}
.eb-offer__image::after {
	aspect-ratio: 1;
	border: 3px solid var(--wp--preset--color--primary);
	border-radius: 50%;
	right: 6%;
	top: -6%;
	width: 44px;
}

/* Category list. */
.eb-cats__list ul,
ul.eb-cats__static {
	list-style: none;
	margin: 0;
	padding: 0;
}
.eb-cats__list li {
	border-bottom: 1px solid var(--wp--preset--color--line);
	margin: 0;
}
.eb-cats__list ul ul,
.eb-cats__list li:nth-child(n+11) {
	display: none;
}
.eb-cats__list li:nth-child(10),
.eb-cats__list li:last-child {
	border-bottom: 0;
}
.eb-cats__list a {
	color: var(--wp--preset--color--foreground);
	display: block;
	font-size: 0.9375rem;
	padding: 0.5rem 1rem;
	text-decoration: none;
}
.eb-cats__list a:hover,
.eb-cats__all a:hover {
	color: var(--wp--preset--color--primary);
}
.eb-cats__all {
	font-weight: 600;
	margin: 0.25rem 0 0;
	padding-left: 1rem;
}
.eb-cats__all a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

/* Two stacked tiles of the same height. */
.eb-hero__tiles {
	gap: 20px;
}
.eb-hero__tiles > .eb-tile {
	flex: 1;
	margin: 0 !important;
	text-align: center;
}
.eb-tile h3 a {
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
}
.eb-tile h3 a:hover {
	color: var(--wp--preset--color--primary);
}
.eb-tile .eb-tile__image {
	margin-top: auto;
	padding-top: 12px;
}
.eb-tile .eb-tile__image img {
	max-height: 150px;
	object-fit: contain;
	width: auto;
}

/* ---------- Promo strips ---------- */

.eb-strip {
	height: 100%;
	min-height: 170px;
	overflow: hidden;
}
.eb-strip h3,
.eb-strip p {
	margin: 0;
}
.eb-strip .eb-strip__link a {
	font-weight: 600;
	text-decoration: none;
}
.eb-strip .eb-strip__link a:hover {
	text-decoration: underline;
}
.eb-strip .eb-strip__image {
	align-items: center;
	display: flex;
	flex-shrink: 0;
	isolation: isolate;
	justify-content: center;
	margin: 0;
	position: relative;
	width: 150px;
}
.eb-strip .eb-strip__image img {
	height: 140px;
	object-fit: contain;
	position: relative;
	width: auto;
	z-index: 1;
}
.eb-strip .eb-strip__image::before {
	aspect-ratio: 1;
	background: var(--wp--preset--color--background);
	border-radius: 50%;
	content: "";
	left: 50%;
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translate(-42%, -38%);
	width: 130px;
	z-index: 0;
}
.eb-strip--dark .eb-strip__image::before {
	background: var(--wp--preset--color--primary);
}

/* ---------- Benefits ---------- */

.eb-features__row {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
}
.eb-feature {
	padding: 28px 32px;
}
.eb-feature + .eb-feature {
	border-left: 1px solid var(--wp--preset--color--line);
}
.eb-feature h3 {
	margin: 0;
}
.eb-feature p {
	margin: 0;
}

/* ---------- Promo cards and banner ---------- */

.eb-promo,
.eb-banner {
	overflow: hidden;
}
.eb-showcase > .wp-block-columns > .wp-block-column:first-child > .eb-promo {
	height: 100%;
}
.eb-promo h2,
.eb-banner h2 {
	margin-top: 0;
}

/* ---------- Product cards ---------- */

/* The cards use the shop's default look; only the buttons line up at the bottom. */
:root .eb-products .wc-block-product {
	display: flex;
	flex-direction: column;
}
:root .eb-products .wc-block-product .wp-block-button.wc-block-components-product-button {
	margin-top: auto;
}

/* Sample product cards (shown instead of the products when WooCommerce is not active). */
.eb-sample-products {
	gap: 20px;
}
.eb-sample-product {
	display: flex;
	flex-direction: column;
	position: relative;
	text-align: center;
}
.eb-sample-product > * {
	margin-block: 0;
}
.eb-sample-product__image,
.eb-sample-product__image a {
	display: block;
	width: 100%;
}
.eb-sample-product__image {
	margin-bottom: 0.75rem !important;
}
.eb-sample-product__image img {
	aspect-ratio: 1;
	background: var(--wp--preset--color--surface);
	box-sizing: border-box;
	object-fit: contain;
	padding: 14%;
	width: 100%;
}
.eb-sample-product__badge {
	background: var(--wp--preset--color--sale);
	border-radius: 2px;
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1.4;
	padding: 0.25em 0.6em;
	position: absolute;
	right: 0.75em;
	text-transform: uppercase;
	top: 0.75em;
	z-index: 1;
}
.eb-sample-product__title {
	font-size: 1.0625rem !important;
	font-weight: 600;
	line-height: 1.4;
	margin-bottom: 0.25rem !important;
}
.eb-sample-product__title a {
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
}
.eb-sample-product__title a:hover {
	color: var(--wp--preset--color--primary);
}
.eb-sample-product__rating {
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
	letter-spacing: 0.1em;
}
.eb-sample-product__price {
	font-weight: 600;
	margin: 0.25rem 0 1rem !important;
}
.eb-sample-product__price del {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
	margin-right: 0.35em;
}
.eb-sample-product__price ins {
	text-decoration: none;
}
.eb-sample-product__button {
	margin-top: auto !important;
}

/* ---------- Details block (FAQ style, used anywhere) ---------- */

.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	margin-block: 0 !important;
	padding: 1rem 0;
}
.wp-block-details:first-of-type {
	border-top: 1px solid var(--wp--preset--color--line);
}
:not(.wp-block-details) + .wp-block-details {
	margin-top: 1.5rem !important;
}
.wp-block-details summary {
	cursor: pointer;
	font-size: 1.0625rem;
	font-weight: 600;
	list-style: none;
	padding-right: 2rem;
	position: relative;
}
.wp-block-details summary::-webkit-details-marker {
	display: none;
}
.wp-block-details summary::after {
	color: var(--wp--preset--color--primary);
	content: "+";
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1;
	position: absolute;
	right: 0.25rem;
	top: 0;
}
.wp-block-details[open] summary::after {
	content: "–";
}
.wp-block-details summary:hover {
	color: var(--wp--preset--color--primary);
}
.wp-block-details > :not(summary) {
	color: var(--wp--preset--color--muted);
	margin-top: 0.75rem;
}

/* ---------- Sidebar (Page / Post with sidebar templates) ---------- */

.eb-widget > * {
	margin-block: 0;
}
.eb-widget > * + * {
	margin-top: 0.75rem;
}
.eb-widget__title {
	font-size: 1.0625rem !important;
	margin-bottom: 0.25rem !important;
}
.eb-widget__list,
.eb-widget__list ul,
.eb-widget__posts {
	list-style: none;
	margin: 0;
	padding: 0;
}
.eb-widget__list li {
	border-bottom: 1px solid var(--wp--preset--color--line);
	font-size: 0.9375rem;
	margin: 0;
	padding: 0.45rem 0;
}
.eb-widget__list li:last-child {
	border-bottom: 0;
}
.eb-widget__list ul ul,
.eb-widget__list > li:nth-child(n+11),
.eb-widget__list ul > li:nth-child(n+11) {
	display: none;
}
.eb-widget__list a,
.eb-widget__posts a {
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
}
.eb-widget__list a:hover,
.eb-widget__posts a:hover {
	color: var(--wp--preset--color--primary);
}
.eb-widget__list .wc-block-product-categories-list-item-count,
.eb-widget__list .cat-item {
	color: var(--wp--preset--color--muted);
}
.eb-widget__posts li {
	display: flow-root;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 0.9rem;
}
.eb-widget__posts li:last-child {
	margin-bottom: 0;
}
.eb-widget__posts .wp-block-latest-posts__featured-image img {
	border-radius: 8px;
	object-fit: cover;
}
.eb-widget__posts .wp-block-latest-posts__featured-image.alignleft {
	margin: 0 0.75rem 0 0;
}
.eb-widget__posts .wp-block-latest-posts__post-date {
	color: var(--wp--preset--color--muted);
	font-size: 0.8125rem;
	font-weight: 400;
}
/* Small product list in the shop sidebar. */
:root .eb-mini-products .wc-block-product-template {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
}
:root .eb-mini-products .wc-block-product {
	align-content: center;
	column-gap: 12px;
	display: grid;
	grid-template-columns: 64px 1fr;
	margin: 0 !important;
	min-height: 0;
	row-gap: 2px;
	text-align: left;
}
:root .eb-mini-products .wc-block-product > * {
	margin-block: 0 !important;
}
:root .eb-mini-products .wc-block-components-product-image {
	border-radius: 8px;
	grid-row: span 2;
	margin: 0;
	overflow: hidden;
	width: 64px;
}
:root .eb-mini-products .wc-block-components-product-image img {
	aspect-ratio: 1;
	object-fit: cover;
}
:root .eb-mini-products.wp-block-woocommerce-product-collection .wp-block-post-title {
	align-self: end;
	font-size: 0.9375rem !important;
	margin: 0;
	text-align: left;
}
:root .eb-mini-products .wc-block-components-product-price {
	align-self: start;
	font-size: 0.875rem;
	margin: 0;
	text-align: left;
}

.eb-widget--promo h2,
.eb-widget--promo a {
	color: var(--wp--preset--color--background);
}

/* ---------- Blog cards ---------- */

.eb-post {
	height: 100%;
	transition: box-shadow 0.2s ease;
}
.eb-post:hover {
	box-shadow: 0 10px 30px rgba(34, 37, 41, 0.08);
}
.eb-post .wp-block-post-title a:hover {
	color: var(--wp--preset--color--primary) !important;
}
.eb-post .wp-block-post-title,
.eb-post .wp-block-post-excerpt__excerpt {
	margin: 0;
}

/* ---------- Contact ---------- */

.eb-contact > .wp-block-columns > .wp-block-column > .wp-block-group {
	height: 100%;
}
.eb-contact__card p {
	margin: 0;
}
.eb-offer .eb-offer__image {
	max-width: 100%;
	width: fit-content;
}
.eb-offer .eb-offer__image img {
	max-width: 420px;
	width: 100%;
}

/* ---------- Small screens ---------- */

@media (max-width: 781px) {
	.eb-sample-products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	.eb-topbar p:not(:first-child),
	.eb-header-store__trending {
		display: none;
	}
	.eb-topbar .alignwide {
		justify-content: center !important;
	}
	.eb-header-store__main {
		flex-wrap: wrap !important;
		gap: 14px 16px !important;
	}
	.eb-header-store__search {
		max-width: none;
		order: 3;
		width: 100%;
	}
	.eb-strip {
		min-height: 0;
		padding: 20px 16px 20px 24px !important;
	}
	.eb-strip h3 {
		font-size: 1.25rem !important;
	}
	.eb-strip .eb-strip__image {
		width: 96px;
	}
	.eb-strip .eb-strip__image img {
		height: 100px;
	}
	.eb-strip .eb-strip__image::before {
		width: 88px;
	}
	.eb-hero .eb-hero__cats {
		display: none !important;
	}
	.eb-hero .eb-hero__main {
		padding-left: 28px !important;
	}
	.eb-hero .eb-hero__main > .wp-block-columns > .wp-block-column:first-child {
		padding-right: 28px;
		padding-bottom: 0 !important;
	}
	.eb-hero .eb-hero__figure {
		padding: 8px 28px 40px 0;
	}
	.eb-hero .eb-hero__image img {
		max-height: 260px;
	}
	.eb-feature + .eb-feature {
		border-left: 0;
		border-top: 1px solid var(--wp--preset--color--line);
	}
	.eb-banner,
	.eb-contact__card,
	.eb-offer {
		padding: 32px 24px !important;
	}
	.eb-promo {
		min-height: 320px !important;
	}
}
