/*
 * Better font smoothing on Mac
 * https://dbushell.com/2024/11/05/webkit-font-smoothing/
 */
html {
	-webkit-font-smoothing: antialiased;
}

/* Utility classes */

.relative {
	position: relative;
}

.overflow-hidden {
	overflow: hidden;
}

.justify-between {
	justify-content: space-between;
}

.z-below {
	z-index: -1 !important;
}

.z-over {
	z-index: 1 !important;
}

.block-editor-iframe__body .z-over {
	z-index: 21 !important;
}

/* Title margin reset */
h1, h2, h3, h4, h5, h6 {
	margin: 0;
}

/* Mark background color reset */
mark {
	background-color: unset;
}

/* Improve editor page preview title section display to avoid thinking it's included in the default design */
.editor-visual-editor__post-title-wrapper {
	background-color: white;
	margin-top: 0 !important;
	padding-top: 2rem;
}

/* Pill */
.pill {
	color: var(--wp--preset--color--accent-5);
	background-color: var(--wp--preset--color--contrast);
	border-radius: 0.75rem;
	padding: 0.25rem 0.75rem;
	font-weight: 700;
	text-decoration: none;
}

a.pill:hover {
	text-decoration: underline;
}

/* Make product cards always be the max height of the line */
.wc-block-product-template.columns-3 > li > .block-editor-block-list__block,
.wc-block-product-template.columns-3 > li > .block-editor-block-list__block > .wp-block-group,
.wc-block-product-template.columns-3 > li > .wp-block-group {
	height: 100%;
}

/* Make product image gallery align to the top */
.wc-block-product-gallery.is-vertical.is-nowrap.is-layout-flex .wc-block-product-gallery-large-image .wc-block-product-gallery-large-image__container {
	align-items: flex-start;
}

/* Make product image gallery only take their content height/width */
.wc-block-product-gallery.is-vertical.is-nowrap.is-layout-flex .wc-block-product-gallery-large-image:has(.wc-block-components-product-image--aspect-ratio-auto),
.wc-block-product-gallery.is-vertical.is-nowrap.is-layout-flex .wc-block-product-gallery-large-image .wc-block-product-gallery-large-image__wrapper:has(.wc-block-components-product-image--aspect-ratio-auto) {
	aspect-ratio: auto;
}

/* Custom styles for product taxonomy filter chips */
.wp-block-woocommerce-product-filter-taxonomy
.wc-block-product-filter-chips__items {
	justify-content: center;
	gap: 0.5rem;
}

.wp-block-woocommerce-product-filter-taxonomy
.wc-block-product-filter-chips__items > button {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	padding: 0.375rem 0.625rem;
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 1rem;
}

.wp-block-woocommerce-product-filter-taxonomy
.wc-block-product-filter-chips__items > button[aria-checked=true] {
	color: var(--wp--preset--color--accent-5);
	background: var(--wp--preset--color--contrast);
}

/* Remove default padding to WooCommerce main block wrapper */
.wp-site-blocks > .wp-block-group.woocommerce {
	padding-right: 0;
	padding-left: 0;
}

/* Mobile product filters modal */
.wc-block-product-filters__overlay-dialog header {
	margin-bottom: var(--wp--preset--spacing--30);
}

/* Mobile menu */
.wp-block-navigation__responsive-container.has-modal-open .wp-block-navigation__responsive-dialog {
	gap: var(--wp--preset--spacing--50);
}

.wp-block-navigation__responsive-container.has-modal-open .wp-block-navigation__container > li > a {
	font-weight: bold;
}

/* Default list style */
/*.wp-block-list {
	padding-left: 1.5em;
}

.wp-block-list li {
	padding-bottom: 0.5em;
}
*/