/* ==========================================================================
   VILMAR STOREFRONT — BLOCK PATTERN BRIDGE
   Gutenberg puts className on wrappers; these rules move the catalog look
   onto the actual heading / button / column elements.
   ========================================================================== */

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

.vs-hero {
	text-align: center;
	position: relative;
	isolation: isolate;
}

/* Overlay color and opacity come from the Cover block sidebar
   (Overlay + Overlay opacity). Do not paint a second background here. */
.wp-block-cover.vs-hero {
	background-color: transparent;
}

/*
 * "Ink" is a warm gold in this theme. A Cover overlay using that slug, or a
 * group with a gold gradient over a photo, washes the background and kills
 * contrast against ink-soft (#4a4038) copy. Darken the scrim and force
 * parchment type on the hero.
 */
.wp-block-cover.vs-hero .wp-block-cover__background.has-ink-background-color {
	background-color: #241f1a !important;
}

.wp-block-group.vs-hero.has-background::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: rgba(28, 22, 16, 0.42);
}

.wp-block-group.vs-hero.has-background > * {
	position: relative;
	z-index: 1;
}

.vs-hero p {
	max-width: none;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.vs-hero__eyebrow,
.vs-feature-card__eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.vs-hero__eyebrow {
	width: 100%;
	max-width: none;
	text-align: center;
}

.vs-hero .vs-hero__subtitle,
.vs-hero .vs-hero__subtitle.has-text-color {
	color: #f8f4ec !important;
	font-weight: 600;
	line-height: 1.65;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.vs-hero .vs-hero__eyebrow,
.vs-hero .vs-hero__eyebrow.has-text-color,
.vs-hero p.vs-hero__subtitle:first-of-type {
	color: #f4ead6 !important;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.vs-hero p.vs-hero__subtitle:first-of-type {
	font-size: 0.95rem;
	text-transform: uppercase;
}

.vs-hero__title {
	margin: 0 0 1rem;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.vs-hero .vs-hero__title,
.vs-hero .vs-hero__title.has-text-color {
	color: #f8f4ec !important;
}

.vs-hero__subtitle {
	max-width: 65ch;
	margin-left: auto;
	margin-right: auto;
}

.vs-hero .wp-block-buttons {
	justify-content: center;
}

/* core/button puts className on the wrapper; style the clickable link. */
.wp-block-button.vs-btn > a.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.85rem 1.75rem;
	border-radius: var(--vs-radius);
	font-weight: 600;
	font-size: var(--vs-font-base);
	line-height: 1.3;
	min-height: var(--vs-tap-min);
	text-decoration: none;
}

.wp-block-button.vs-btn--primary > a.wp-block-button__link {
	background: var(--vs-oxblood);
	color: var(--vs-white);
	border: 2px solid var(--vs-oxblood);
}

.wp-block-button.vs-btn--primary > a.wp-block-button__link:hover,
.wp-block-button.vs-btn--primary > a.wp-block-button__link:focus-visible {
	background: var(--vs-oxblood-dark);
	border-color: var(--vs-oxblood-dark);
	color: var(--vs-white);
}

.wp-block-button.vs-btn--ghost > a.wp-block-button__link {
	background: transparent;
	border: 2px solid currentColor;
}

.vs-hero .wp-block-button.vs-btn--ghost > a.wp-block-button__link {
	border-color: currentColor;
	color: inherit;
}

.vs-hero .wp-block-button.vs-btn--ghost > a.wp-block-button__link:hover {
	background: currentColor;
	color: var(--vs-ink);
}

.wp-block-button.vs-btn--gold > a.wp-block-button__link {
	background: var(--vs-gold);
	border: 2px solid var(--vs-gold);
	color: var(--vs-ink);
}

.wp-block-button.vs-btn--gold > a.wp-block-button__link:hover {
	background: var(--vs-gold-light);
	border-color: var(--vs-gold-light);
	color: var(--vs-ink);
}

/* ------------------------------ Trust strip ------------------------------- */

.vs-trust .vs-trust__item {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.vs-trust .vs-trust__icon {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	font-size: 0;
	line-height: 0;
	margin: 0 0 0.5rem;
	color: inherit;
	text-align: center;
}

.vs-trust .vs-trust__icon::before {
	content: "";
	display: block;
	flex: 0 0 2rem;
	width: 2rem;
	height: 2rem;
	margin: 0;
	background-color: currentColor;
	-webkit-mask: var(--vs-trust-icon) center / contain no-repeat;
	mask: var(--vs-trust-icon) center / contain no-repeat;
}

.vs-trust__item:nth-child(1) .vs-trust__icon,
.vs-trust .vs-trust__icon--scales {
	--vs-trust-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M5 21h14'/%3E%3Cpath d='M8 6h8'/%3E%3Cpath d='M7 10l-4 7h8l-4-7z'/%3E%3Cpath d='M17 10l-4 7h8l-4-7z'/%3E%3C/svg%3E");
}

.vs-trust__item:nth-child(2) .vs-trust__icon,
.vs-trust .vs-trust__icon--search {
	--vs-trust-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}

.vs-trust__item:nth-child(3) .vs-trust__icon,
.vs-trust .vs-trust__icon--camera {
	--vs-trust-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-2.5h6L17 8h3v11H4V8z'/%3E%3Ccircle cx='12' cy='13.5' r='3.5'/%3E%3C/svg%3E");
}

.vs-trust__item:nth-child(4) .vs-trust__icon,
.vs-trust .vs-trust__icon--mail {
	--vs-trust-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 7 9-7'/%3E%3C/svg%3E");
}

.vs-trust .vs-trust__title {
	font-size: 1.15rem;
	margin: 0 0 0.4rem;
}

.vs-trust .vs-trust__item p:not(.vs-trust__icon) {
	max-width: 28ch;
	margin-left: auto;
	margin-right: auto;
}

@media (max-width: 1024px) {
	.vs-trust .vs-trust__grid {
		flex-wrap: wrap;
	}

	.vs-trust .vs-trust__item {
		flex-basis: calc(50% - 1rem);
	}
}

@media (max-width: 600px) {
	.vs-trust .vs-trust__item {
		flex-basis: 100%;
	}
}

/* ------------------------------ Feature grid ------------------------------ */

.vs-section__head {
	margin-bottom: 2rem;
}

.vs-section__title {
	margin: 0;
}

.vs-section__link a {
	font-weight: 600;
	white-space: nowrap;
}

.vs-feature-card {
	border: 1px solid var(--vs-line);
	border-radius: var(--vs-radius);
}

.vs-feature-card h3 {
	margin-top: 0;
}

/* ---------------------------------- CTA ----------------------------------- */

.vs-cta h2 {
	color: var(--vs-white);
}

.vs-cta p:not(.vs-hero__eyebrow) {
	color: #f3e9de;
	margin-left: auto;
	margin-right: auto;
}

/* ------------------------------ News cards -------------------------------- */

.vs-news-card,
.vs-news__query .wp-block-post {
	border-radius: var(--vs-radius);
	overflow: hidden;
}

.vs-news-card .wp-block-post-title a,
.vs-news__query .wp-block-post-title a {
	color: var(--vs-ink);
	text-decoration: none;
}

.vs-news-card .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 7;
	object-fit: cover;
}

/* --------------------------- Product catalog ------------------------------ */

.vs-catalog__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(var(--vs-catalog-columns, 4), minmax(0, 1fr));
	gap: 2rem;
}

.vs-catalog-card {
	background: var(--vs-white);
	border: 1px solid var(--vs-line);
	border-radius: var(--vs-radius);
	overflow: hidden;
}

.vs-catalog-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.vs-catalog-card__image {
	display: block;
	background: var(--vs-parchment-2);
	line-height: 0;
	position: relative;
}

.vs-catalog-card__image img,
.vs-catalog-card__img {
	width: 100%;
	height: auto;
	display: block;
	padding: 0;
}

.vs-catalog-card__title {
	display: block;
	font-family: var(--vs-font-serif);
	font-weight: 600;
	font-size: 1.15rem;
	line-height: 1.35;
	color: var(--vs-ink);
	padding: 1rem 1.1rem 0.35rem;
	min-height: 4.2em;
}

.vs-catalog-card__title-full {
	display: none;
}

.vs-catalog-card:hover .vs-catalog-card__title-clip,
.vs-catalog-card:focus-within .vs-catalog-card__title-clip {
	display: none;
}

.vs-catalog-card:hover .vs-catalog-card__title-full,
.vs-catalog-card:focus-within .vs-catalog-card__title-full {
	display: inline;
}

.vs-catalog-card__price {
	display: block;
	padding: 0.25rem 1.1rem 1.1rem;
	margin-top: auto;
	font-weight: 700;
	font-size: 1.2rem;
	color: var(--vs-oxblood);
}

.vs-catalog-card__price del {
	color: var(--vs-ink-soft);
	opacity: 0.7;
	font-weight: 400;
}

.vs-catalog__empty {
	margin: 0;
	color: var(--vs-ink-soft);
}

.vs-product-catalog {
	display: block;
	width: 100%;
	max-width: var(--wp--style--global--wide-size, var(--vs-container, 80rem));
	box-sizing: border-box;
}

/*
 * Same width as the original catalog shortcode / pattern (theme wide size).
 * Constrained layouts otherwise cap unaligned blocks at contentSize (48rem).
 */
.is-layout-constrained > .wp-block-vilmar-storefront-product-catalog:not(.alignfull):not(.alignleft):not(.alignright),
.is-layout-flow > .wp-block-vilmar-storefront-product-catalog:not(.alignfull):not(.alignleft):not(.alignright) {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, var(--vs-container, 80rem));
}

.vs-catalog__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.vs-catalog__sort,
.vs-catalog__search {
	margin: 0;
}

.vs-catalog__orderby,
.vs-catalog__search-input,
.vs-catalog__categories-btn {
	min-height: var(--vs-tap-min);
	padding: 0.55rem 0.85rem;
	border: 1px solid var(--vs-line);
	border-radius: var(--vs-radius);
	background: var(--vs-white);
	color: var(--vs-ink);
	font-family: inherit;
	font-size: var(--vs-font-sm);
	line-height: 1.3;
}

.vs-catalog__search {
	flex: 1 1 16rem;
}

.vs-catalog__search-input {
	width: 100%;
}

.vs-catalog__categories-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	cursor: pointer;
	font-weight: 600;
	white-space: nowrap;
}

.vs-catalog__categories-btn:hover {
	border-color: var(--vs-gold);
	color: var(--vs-oxblood);
}

.vs-catalog__categories-count {
	font-weight: 500;
	color: var(--vs-ink-soft);
}

.vs-catalog__results.is-loading {
	opacity: 0.55;
	pointer-events: none;
}

.vs-catalog__pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem;
	margin: 2rem 0 0;
}

.vs-catalog__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--vs-tap-min);
	min-height: var(--vs-tap-min);
	padding: 0 0.65rem;
	border: 1px solid var(--vs-line);
	border-radius: var(--vs-radius);
	text-decoration: none;
	color: var(--vs-ink);
	background: var(--vs-white);
}

.vs-catalog__page:hover:not(.is-disabled),
.vs-catalog__page.is-current {
	border-color: var(--vs-oxblood);
	color: var(--vs-oxblood);
}

.vs-catalog__page.is-current {
	font-weight: 700;
	background: var(--vs-parchment-2);
}

.vs-catalog__page.is-disabled {
	pointer-events: none;
	color: var(--vs-ink-soft);
	border-color: var(--vs-line);
	background: var(--vs-parchment-2);
	opacity: 0.65;
}

body.vs-catalog-modal-open {
	overflow: hidden;
}

.vs-catalog-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
}

.vs-catalog-modal[hidden] {
	display: none !important;
}

.vs-catalog-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(32, 24, 18, 0.55);
}

.vs-catalog-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(32rem, 100%);
	max-height: min(36rem, calc(100vh - 2.5rem));
	background: var(--vs-white);
	border: 1px solid var(--vs-line);
	border-radius: var(--vs-radius);
	box-shadow: 0 1.25rem 3rem rgba(32, 24, 18, 0.22);
}

.vs-catalog-modal__header,
.vs-catalog-modal__footer {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.9rem 1.1rem;
	border-bottom: 1px solid var(--vs-line);
}

.vs-catalog-modal__footer {
	border-bottom: 0;
	border-top: 1px solid var(--vs-line);
	justify-content: flex-end;
}

.vs-catalog-modal__title {
	margin: 0;
	flex: 1;
	font-family: var(--vs-font-serif);
	font-size: 1.45rem;
	font-weight: 600;
}

.vs-catalog-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--vs-tap-min);
	height: var(--vs-tap-min);
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--vs-ink);
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}

.vs-catalog-modal__body {
	overflow: auto;
	padding: 0.75rem 1.1rem 1.1rem;
	flex: 1;
}

.vs-catalog-modal__hint,
.vs-catalog-modal__loading,
.vs-catalog-modal__empty {
	margin: 0 0 0.85rem;
	font-size: var(--vs-font-sm);
	color: var(--vs-ink-soft);
}

.vs-catalog-modal__tree {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vs-catalog-modal__tree .vs-catalog-modal__tree {
	padding-left: 1.25rem;
}

.vs-catalog-modal__option {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-height: var(--vs-tap-min);
	margin: 0;
	cursor: pointer;
}

.vs-catalog-modal__option input {
	width: 1.1rem;
	height: 1.1rem;
	margin: 0;
	flex-shrink: 0;
}

.vs-catalog-modal__name {
	flex: 1;
	min-width: 0;
}

.vs-catalog-modal__count {
	color: var(--vs-ink-soft);
	font-size: var(--vs-font-sm);
	font-variant-numeric: tabular-nums;
}

.vs-catalog-modal__count::before {
	content: "(";
}

.vs-catalog-modal__count::after {
	content: ")";
}

.vs-catalog-modal__cancel,
.vs-catalog-modal__apply {
	min-height: var(--vs-tap-min);
	padding: 0.45rem 1rem;
	border-radius: var(--vs-radius);
	font-family: inherit;
	font-size: var(--vs-font-sm);
	font-weight: 600;
	cursor: pointer;
}

.vs-catalog-modal__cancel {
	border: 1px solid var(--vs-line);
	background: var(--vs-white);
	color: var(--vs-ink);
}

.vs-catalog-modal__apply {
	border: 1px solid var(--vs-oxblood);
	background: var(--vs-oxblood);
	color: var(--vs-white);
}

.vs-catalog-modal__apply:hover {
	background: var(--vs-oxblood-dark);
	border-color: var(--vs-oxblood-dark);
}

/* -------------------------------- Responsive ------------------------------ */

@media (max-width: 1024px) {
	.vs-catalog__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.vs-hero .wp-block-buttons {
		flex-direction: column;
	}

	.vs-hero .wp-block-button,
	.vs-hero .wp-block-button > a.wp-block-button__link {
		width: 100%;
	}

	.vs-catalog__grid {
		grid-template-columns: 1fr;
	}

	.vs-catalog__sort,
	.vs-catalog__search,
	.vs-catalog__categories-btn {
		flex: 1 1 100%;
	}

	.vs-catalog__orderby,
	.vs-catalog__categories-btn {
		width: 100%;
	}
}
