/**
 * Theme overrides.
 *
 * This file loads AFTER app.css and after WordPress's global styles, so it is
 * the place for fixes that theme.json and Tailwind utilities cannot express.
 * Prefer solving something in theme.json or with a utility class first; use
 * !important here only when a plugin's stylesheet outranks you.
 */

/* -------------------------------------------------------------------------
 * WooCommerce blocks
 * ---------------------------------------------------------------------- */

.wc-block-featured-category {
	min-height: auto;
}

.wc-block-featured-category__wrapper {
	align-content: end;
}

.wc-block-product {
	margin-block-start: 0;
}

.woocommerce.wc-block-catalog-sorting {
	margin-block-start: 0;
}

.woocommerce .woocommerce-ordering {
	margin: 0;
}

form.woocommerce-ordering select {
	background-color: transparent;
}

.relative .woocommerce-category-image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: left center;
	opacity: 0.75;
}

/* Product cards: drop the default panel so the image sits on the page. */
li.wc-block-product {
	background: transparent;
	padding: 0;
}

li.wc-block-product .wc-block-components-product-image {
	background: #f5f5f5;
	border-radius: 16px;
	overflow: hidden;
}

li.wc-block-product .wc-block-components-product-image img {
	border-radius: 12px;
}

/* -------------------------------------------------------------------------
 * Core blocks
 * ---------------------------------------------------------------------- */

:root :where(.is-layout-constrained) > :last-child {
	margin-block-end: auto;
}

ul.wp-block-list {
	list-style: square;
}

.wp-block-search__input {
	padding: 1rem;
}

/*
 * Cover blocks and aspect-* utilities.
 *
 * Nothing to do here. Tailwind emits its utilities with !important (see
 * `important: true` in tailwind.config.js) so that `aspect-[3/4]
 * md:aspect-[16/9]` beats the inline aspect-ratio WordPress writes on every
 * Cover block.
 *
 * Only the min-height floor needs clearing, because the Cover block sizes
 * itself from min-height and that fights aspect-ratio.
 */
.wp-block-cover[class*='aspect-'] {
	min-height: 0;
	height: auto;
}

/* -------------------------------------------------------------------------
 * Browser quirks
 * ---------------------------------------------------------------------- */

/*
 * iOS Safari ignores background-attachment: fixed, which makes a parallax
 * cover jump on scroll. Fall back to a plain scroll there.
 */
@supports ( -webkit-overflow-scrolling: touch ) {
	.wp-block-cover.has-parallax,
	.wp-block-cover-image.has-parallax {
		background-attachment: scroll;
	}

	.wp-block-cover.has-parallax .wp-block-cover__image-background.has-parallax,
	.wp-block-cover-image.has-parallax .wp-block-cover__image-background.has-parallax,
	.wp-block-cover.has-parallax video.wp-block-cover__video-background {
		transform: none;
		will-change: auto;
	}
}