/*
Theme Name: Motherwort
Theme URI: https://motherwort.co.uk/
Author: Wagner Veloso
Description: A calm, clinical block theme for Motherwort herbal clinic: consultations, herbal medicines shop (WooCommerce) and classes. Built on Twenty Twenty-Five by the WordPress team.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.4
Version: 0.5.8
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: motherwort
Tags: full-site-editing, block-patterns, custom-colors, custom-menu, custom-logo, editor-style, wide-blocks, e-commerce
*/

/* Links */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .18em;
}

/* Focus */
:where(.wp-site-blocks *:focus-visible) {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

/* Header: subtle bottom rule, stays on top while scrolling */
.mw-header {
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin-bar .mw-header { top: var(--wp-admin--admin-bar--height, 32px); }

/* Cards */
.is-style-mw-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	padding: var(--wp--preset--spacing--40);
}
.is-style-mw-card-surface {
	background: var(--wp--preset--color--surface);
	border-radius: 16px;
	padding: var(--wp--preset--spacing--40);
}

/* Eyebrow label */
.is-style-mw-eyebrow {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

/* Checkmark list */
ul.is-style-mw-checklist { list-style: none; padding-left: 0; }
ul.is-style-mw-checklist li { position: relative; padding-left: 1.75em; margin-bottom: .5em; }
ul.is-style-mw-checklist li::before {
	content: "";
	position: absolute; left: 0; top: .45em;
	width: 1em; height: 1em; border-radius: 50%;
	background: var(--wp--preset--color--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%232E5641' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/70% no-repeat;
}

/* Inputs */
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], input[type="number"], select, textarea {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
}

/* WooCommerce */
.wc-block-components-product-image img,
.woocommerce-product-gallery img,
.wp-block-woocommerce-product-image-gallery img {
	border-radius: 12px;
}
.wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--primary-soft) !important;
	color: var(--wp--preset--color--primary) !important;
	border: 0 !important;
	border-radius: 999px !important;
}
.wp-block-woocommerce-product-template .wc-block-components-product-button .wp-block-button__link,
.wp-block-woocommerce-product-template .wc-block-components-product-button button {
	border-radius: 999px;
}
.woocommerce-tabs ul.tabs li a { text-decoration: none; }

/* Product cards: left aligned, outline button (matches Figma "Product card") */
.wp-block-woocommerce-product-template .wc-block-components-product-button,
.wp-block-woocommerce-product-template .wp-block-woocommerce-product-price,
.wp-block-woocommerce-product-template .wp-block-post-title {
	text-align: left !important;
	justify-content: flex-start !important;
	align-items: flex-start !important;
}
.wc-block-components-product-button .wp-block-button__link,
.wc-block-components-product-button .wc-block-components-product-button__button {
	background: transparent !important;
	color: var(--wp--preset--color--primary) !important;
	border: 1.5px solid var(--wp--preset--color--primary) !important;
	border-radius: 999px !important;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	padding: calc(0.8rem - 1.5px) calc(1.6rem - 1.5px) !important;
	margin-left: 0 !important;
}
.wc-block-components-product-button .wp-block-button__link:hover,
.wc-block-components-product-button .wc-block-components-product-button__button:hover {
	background: var(--wp--preset--color--primary-soft) !important;
}

/* FAQ (core/details): +/– on the right, like Figma */
.wp-block-details summary {
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	cursor: pointer;
	font-weight: 500;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+";
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
	line-height: 1;
	color: var(--wp--preset--color--primary);
}
.wp-block-details[open] summary::after { content: "–"; }
.wp-block-details[open] summary { margin-bottom: .5rem; }

/* Button hover states (match Figma Button "State=Hover") */
.wp-element-button,
.wp-block-button__link {
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
/* Outline: tinted fill on hover, same as product card buttons */
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background-color: var(--wp--preset--color--primary-soft) !important;
	color: var(--wp--preset--color--primary) !important;
	border-color: var(--wp--preset--color--primary) !important;
}
/* On dark (white button on green): tinted fill on hover */
.wp-block-button__link.has-base-background-color:hover,
.wp-block-button__link.has-base-background-color:focus-visible {
	background-color: var(--wp--preset--color--primary-soft) !important;
}

/* Single product gallery (match Figma: square main image, 4 thumbnails with 16px gaps) */
.wp-block-woocommerce-product-image-gallery,
.wp-block-woocommerce-product-image-gallery .woocommerce-product-gallery {
	width: 100% !important;
	max-width: none !important;
	float: none !important;
}
.woocommerce-product-gallery .woocommerce-product-gallery__image img.wp-post-image,
.woocommerce-product-gallery .woocommerce-product-gallery__image > a > img:not(.zoomImg) {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 20px;
}
.woocommerce-product-gallery .flex-control-thumbs {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--wp--preset--spacing--30);
	margin: var(--wp--preset--spacing--30) 0 0 !important;
	padding: 0 !important;
	list-style: none;
}
.woocommerce-product-gallery .flex-control-thumbs li {
	width: auto !important;
	float: none !important;
	margin: 0 !important;
}
.woocommerce-product-gallery .flex-control-thumbs img {
	width: 100%;
	height: auto;
	aspect-ratio: 153 / 120;
	object-fit: cover;
	border-radius: 12px;
	cursor: pointer;
	opacity: .7;
	transition: opacity .15s ease;
}
.woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs img:hover { opacity: 1; }

/* Keep the gallery's rounded corners while zooming and sliding:
   clip the container, not just the image (the zoom layer and sliding slides sit on top). */
.woocommerce-product-gallery .flex-viewport,
.woocommerce-product-gallery .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:only-child {
	border-radius: 20px;
	overflow: hidden;
	clip-path: inset(0 round 20px);
}
.woocommerce-product-gallery .woocommerce-product-gallery__image {
	overflow: hidden;
}
.woocommerce-product-gallery .woocommerce-product-gallery__image img.zoomImg {
	border-radius: 0;
}

/* Product meta (SKU, category, tags): stacked, small, muted, like Figma */
.wp-block-woocommerce-product-meta .wp-block-post-terms,
.wp-block-woocommerce-product-meta .wc-block-components-product-sku {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	margin: 0;
}

/* Footer: tight, top-aligned columns like Figma */
footer .wp-block-columns { align-items: flex-start; }
footer .wp-block-site-title { font-size: 1.375rem; }

/* No gap between header, main and footer: sections sit edge to edge like Figma */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Dropdowns: every select (catalog sorting, product options, checkout, etc.) uses one style */
select,
.woocommerce-ordering select,
.wc-block-catalog-sorting select,
.wp-block-woocommerce-catalog-sorting select,
table.variations select,
.wc-block-components-select select {
	-webkit-appearance: none !important;
	appearance: none !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.2 !important;
	color: var(--wp--preset--color--contrast) !important;
	background-color: var(--wp--preset--color--base) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%231F2A24' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: calc(100% - 12px) 50% !important;
	background-size: 16px 16px !important;
	border: 1px solid var(--wp--preset--color--border) !important;
	border-radius: 10px !important;
	padding: 12px 42px 12px 15px !important;
	min-height: 42px;
	box-shadow: none !important;
	cursor: pointer;
	transition: border-color .15s ease;
}
select:hover { border-color: var(--wp--preset--color--muted) !important; }
select:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--primary) !important;
}

/* Rounded product thumbnails in the mini cart, cart page and checkout summary */
.wc-block-cart-item__image img,
.wc-block-mini-cart__products-table .wc-block-cart-item__image img,
.wc-block-components-order-summary-item__image img,
.woocommerce-cart-form .product-thumbnail img,
.woocommerce-checkout-review-order-table img {
	border-radius: 12px;
	overflow: hidden;
}

/* Quantity stepper (− 1 +) on the product page, matching the mini cart and dropdowns */
.wc-block-add-to-cart-form--stepper .quantity {
	display: inline-flex !important;
	align-items: center;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	background: var(--wp--preset--color--base);
	overflow: hidden;
	height: 44px;
}
.wc-block-add-to-cart-form--stepper .quantity input.qty {
	border: 0 !important;
	width: 2.5em !important;
	text-align: center;
	background: transparent;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	padding: 0 !important;
	-moz-appearance: textfield;
}
.wc-block-add-to-cart-form--stepper .wc-block-components-quantity-selector__button {
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--muted);
	width: 40px;
	height: 100%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: color .15s ease, background-color .15s ease;
}
.wc-block-add-to-cart-form--stepper .wc-block-components-quantity-selector__button:hover {
	color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--surface);
}
.wc-block-add-to-cart-form--stepper .wc-block-components-quantity-selector__button:disabled { opacity: .35; cursor: default; }
/* Never show the browser's up/down arrows on quantity fields */
input.qty::-webkit-outer-spin-button,
input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.qty[type=number] { -moz-appearance: textfield; }

/* Variation chips (Add to Cart + Options), match Figma "Variation chip" */
.wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name,
.wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name label {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 15px;
	color: var(--wp--preset--color--contrast);
	margin: 0;
}
.wc-block-product-filter-chips__items {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}
.wc-block-product-filter-chips__item {
	min-height: 44px;
	padding: 0 20px !important;
	border: 1px solid var(--wp--preset--color--border) !important;
	border-radius: 10px !important;
	background: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.wc-block-product-filter-chips__item:hover:not([disabled]):not([aria-checked="true"]) {
	border-color: var(--wp--preset--color--muted) !important;
}
.wc-block-product-filter-chips__item[aria-checked="true"] {
	background: var(--wp--preset--color--primary) !important;
	border-color: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--base) !important;
}
.wc-block-product-filter-chips__item[disabled] {
	background: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--muted) !important;
	text-decoration: line-through;
	cursor: not-allowed;
}
.wc-block-product-filter-chips__item:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}
.wc-block-product-filter-chips__count,
.wc-block-product-filter-chips__swatch--no-color { display: none; }

/* Full-width Add to cart on the product page */
.mw-add-to-cart-full,
.mw-add-to-cart-full .wp-block-button__link,
.mw-add-to-cart-full .wc-block-components-product-button__button {
	width: 100% !important;
	max-width: none !important;
}
.wp-block-woocommerce-add-to-cart-with-options .wp-block-woocommerce-product-stock-indicator:empty { display: none; }

/* Product page Add to cart stays the filled primary button (product cards use outline) */
.mw-add-to-cart-full .wp-block-button__link,
.mw-add-to-cart-full .wc-block-components-product-button__button {
	background: var(--wp--preset--color--primary) !important;
	border-color: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--base) !important;
	padding: 0.8rem 1.6rem !important;
}
.mw-add-to-cart-full .wp-block-button__link:hover:not([disabled]):not(.disabled),
.mw-add-to-cart-full .wc-block-components-product-button__button:hover:not([disabled]):not(.disabled) {
	background: var(--wp--preset--color--primary-dark) !important;
	border-color: var(--wp--preset--color--primary-dark) !important;
}
.mw-add-to-cart-full [disabled],
.mw-add-to-cart-full .disabled,
.mw-add-to-cart-full [aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* Cart / mini cart quantity selector: same box as dropdowns and the Figma "Quantity stepper" */
.wc-block-components-quantity-selector {
	border: 1px solid var(--wp--preset--color--border) !important;
	border-radius: 10px !important;
	background: var(--wp--preset--color--base) !important;
	box-shadow: none !important;
	height: 44px;
	width: 120px !important;
	overflow: hidden;
}
.wc-block-components-quantity-selector::after { display: none !important; }
.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	color: var(--wp--preset--color--contrast) !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	min-width: 0;
}
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	color: var(--wp--preset--color--muted) !important;
	background: transparent !important;
	min-width: 40px;
	font-size: 18px;
	opacity: 1;
	transition: color .15s ease, background-color .15s ease;
}
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover:not(:disabled) {
	color: var(--wp--preset--color--primary) !important;
	background: var(--wp--preset--color--surface) !important;
}
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled { opacity: .35; }
.wc-block-components-quantity-selector:focus-within {
	border-color: var(--wp--preset--color--primary) !important;
}

/* Product cards: variation chips + full-width Add to cart (match Figma "Product card") */
.mw-card-add-to-cart { width: 100%; margin-top: 0; }
.mw-card-add-to-cart .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name { display: none; }
.mw-card-add-to-cart .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute .wp-block-group {
	margin-bottom: var(--wp--preset--spacing--30) !important;
}
.mw-card-add-to-cart .wc-block-product-filter-chips__items { gap: 8px; }

.mw-card-add-to-cart .wp-block-woocommerce-add-to-cart-with-options-variation-description,
.mw-card-add-to-cart .wc-block-components-product-stock-indicator:not(.wc-block-components-product-stock-indicator--out-of-stock) { display: none; }
.wc-block-components-product-stock-indicator--out-of-stock {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	background: var(--wp--preset--color--surface);
	border-radius: 999px;
	padding: 4px 12px;
	display: inline-block;
}
/* In cards the Add to cart is the filled primary button, full width */
.wp-block-woocommerce-product-template .mw-card-add-to-cart .wc-block-components-product-button .wp-block-button__link,
.wp-block-woocommerce-product-template .mw-card-add-to-cart .wc-block-components-product-button__button {
	width: 100% !important;
	justify-content: center;
	background: var(--wp--preset--color--primary) !important;
	border-color: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--base) !important;
	padding: 0.8rem 1.2rem !important;
}
.wp-block-woocommerce-product-template .mw-card-add-to-cart .wc-block-components-product-button .wp-block-button__link:hover:not([disabled]),
.wp-block-woocommerce-product-template .mw-card-add-to-cart .wc-block-components-product-button__button:hover:not([disabled]) {
	background: var(--wp--preset--color--primary-dark) !important;
	border-color: var(--wp--preset--color--primary-dark) !important;
}
.wp-block-woocommerce-product-template .mw-card-add-to-cart .wc-block-components-product-button { width: 100%; }

/* Variation chips v2 (Figma "Variation chip"): 36px tall, Body / Extra small (12px regular) */
.wc-block-product-filter-chips__item {
	min-height: 36px !important;
	height: 36px;
	padding: 0 20px !important;
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 400 !important;
	line-height: 1.6 !important;
}
.wc-block-product-filter-chips__item[aria-checked="true"] { border-width: 1.5px !important; }
.wc-block-product-filter-chips__items { gap: 8px; }

/* Product card (Figma "Product card"): 16px between every element, muted price */
.wp-block-woocommerce-product-template > li {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
}
.wp-block-woocommerce-product-template > li > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.wp-block-woocommerce-product-template .wp-block-woocommerce-product-price,
.wp-block-woocommerce-product-template .wp-block-woocommerce-product-price .wc-block-components-product-price {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Body / Small (14px) and Body / Extra small (12px) use a 1.6 line height, like the Figma text styles */
.has-small-font-size,
.has-x-small-font-size { line-height: 1.6; }

/* Single-option variation: always selected, not clickable to unselect */
.wc-block-product-filter-chips__items:has(> .wc-block-product-filter-chips__item:only-of-type) .wc-block-product-filter-chips__item[aria-checked="true"] {
	cursor: default;
}

/* Class rows: date | details | Enquire, vertically centred, full width with a divider (Figma "Pattern / Classes") */
.mw-class-row .wp-block-columns { flex-wrap: nowrap; }
.mw-class-row .mw-class-action { flex: 0 0 auto !important; width: max-content !important; }
.mw-class-row .wp-block-column:first-child { flex: 0 0 260px !important; }
.mw-class-row .wp-block-column:nth-child(2) { flex: 1 1 0 !important; min-width: 0; }
.mw-class-row p, .mw-class-row h3 { margin: 0; }
@media (max-width: 781px) {
	.mw-class-row .wp-block-columns { flex-wrap: wrap !important; }
	.mw-class-row .wp-block-column,
	.mw-class-row .wp-block-column:first-child,
	.mw-class-row .wp-block-column:nth-child(2),
	.mw-class-row .mw-class-action { flex: 0 0 100% !important; width: 100% !important; }
	.mw-class-row .mw-class-action .wp-block-buttons { justify-content: flex-start; }
}
.mw-class-row h3 + p { margin-top: var(--wp--preset--spacing--20); }

/* "Showing all X results": Body / Small, muted */
.wp-block-woocommerce-product-results-count,
.wp-block-woocommerce-product-results-count .woocommerce-result-count,
.woocommerce-result-count {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 400;
	line-height: 1.6;
	color: var(--wp--preset--color--muted) !important;
	margin: 0;
}

/* Breadcrumbs: Body / Small, muted (links keep the primary colour) */
.wp-block-woocommerce-breadcrumbs,
.wp-block-woocommerce-breadcrumbs .woocommerce-breadcrumb,
.woocommerce-breadcrumb {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 400;
	line-height: 1.6;
	color: var(--wp--preset--color--muted) !important;
}

/* Product page: short description and meta (category, tags) in the muted colour, like Figma */
.single-product .wp-block-post-excerpt,
.single-product .wp-block-post-excerpt__excerpt,
.single-product .wp-block-woocommerce-product-summary {
	color: var(--wp--preset--color--muted) !important;
}
.wp-block-woocommerce-product-meta,
.wp-block-woocommerce-product-meta .wp-block-post-terms,
.wp-block-woocommerce-product-meta .wp-block-post-terms a,
.wp-block-woocommerce-product-meta .wc-block-components-product-sku {
	color: var(--wp--preset--color--muted) !important;
}
.wp-block-woocommerce-product-meta .wp-block-post-terms a:hover { color: var(--wp--preset--color--primary) !important; }
