/**
 * Marina's Art — WooCommerce styles shared across the store.
 *
 * Loaded only when WooCommerce is active (and in the editor). Cart, checkout,
 * mini-cart, product gallery and add-to-cart styles live in
 * assets/css/blocks/ and load only with their blocks.
 *
 * WooCommerce components are styled with theme.json tokens so the Site
 * Editor's colour/typography changes carry through. Doubled class names
 * (.a.a) are used where WooCommerce's own rules tie on specificity.
 */

/* ==========================================================================
   Product cards (Product Collection → product template)
   ========================================================================== */

.ma-card__media {
	position: relative;
}

.ma-card__media > .wc-block-components-product-image,
.ma-card__media .wp-block-woocommerce-product-image {
	background-color: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--product-card--radius);
	margin: 0;
	overflow: hidden;
}

.ma-card__media .wc-block-components-product-image img {
	border-radius: inherit;
	object-fit: cover;
	width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
	.ma-card__media .wc-block-components-product-image img {
		transition: transform 0.5s ease;
	}

	.wc-block-product:hover .ma-card__media .wc-block-components-product-image img {
		transform: scale(1.03);
	}
}

/* Product tags shown as badges ("Best seller", "Personalised"…). */
.ma-card__tags {
	display: flex;
	flex-wrap: wrap;
	font-size: 0.6875rem;
	gap: 4px;
	left: 10px;
	line-height: 1.4;
	margin: 0;
	position: absolute;
	right: 10px;
	top: 10px;
	z-index: 1;
}

.ma-card__tags .wp-block-post-terms__separator {
	display: none;
}

.ma-card__tags a {
	background-color: var(--wp--preset--color--white);
	border-radius: var(--wp--preset--border-radius--pill);
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 3px 10px;
	text-decoration: none;
}

.ma-card__tags a:hover {
	background-color: var(--wp--preset--color--pink-tint);
	color: var(--wp--preset--color--contrast);
}

.ma-card__info {
	margin-top: 10px;
}

.ma-card__info .wp-block-post-title {
	margin: 0;
}

.ma-card__info .wc-block-components-product-price {
	margin: 0;
}

/* Product Button → "Round + on image" style (block style: ma-corner-plus). */
.wc-block-components-product-button.is-style-ma-corner-plus {
	bottom: 8px;
	margin: 0;
	position: absolute;
	right: 8px;
	width: auto;
	z-index: 2;
}

.is-style-ma-corner-plus .wc-block-components-product-button__button.wc-block-components-product-button__button {
	border-radius: var(--wp--preset--border-radius--pill);
	box-shadow: var(--wp--preset--shadow--medium);
	height: 44px;
	margin: 0;
	min-height: 44px;
	padding: 0;
	position: relative;
	width: 44px;
}

.is-style-ma-corner-plus .wc-block-components-product-button__button > span {
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.is-style-ma-corner-plus .wc-block-components-product-button__button::before {
	background-color: currentColor;
	content: "";
	height: 20px;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.75' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.75' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E") center / contain no-repeat;
	width: 20px;
}

.is-style-ma-corner-plus .wc-block-components-product-button__button::after,
.is-style-ma-corner-plus .added_to_cart {
	display: none;
}

/* ==========================================================================
   Grids and carousels
   ========================================================================== */

.ma-product-grid .wc-block-product-template__responsive {
	column-gap: 14px;
	row-gap: 26px;
}

.ma-carousel .is-product-collection-layout-carousel {
	gap: 14px;
}

.ma-carousel .wc-block-product .wc-block-components-product-image {
	background-color: var(--wp--preset--color--surface);
	border-radius: var(--wp--preset--border-radius--large);
	overflow: hidden;
}

.ma-carousel .wc-block-product .wc-block-components-product-image img {
	object-fit: cover;
}

/* Best-seller band: two cards and a peek on phones, like the design. */
.ma-band .is-product-collection-layout-carousel .wc-block-product {
	max-width: 240px;
	min-width: min(62%, 240px);
}

.ma-band .wc-block-product .wc-block-components-product-image {
	background-color: var(--wp--preset--color--white);
}

/* "You may also like": 150px cards on phones, five across on desktop. */
.ma-related .is-product-collection-layout-carousel .wc-block-product {
	max-width: 150px;
	min-width: 150px;
}

@container carousel (min-width: 782px) {
	.ma-related .is-product-collection-layout-carousel .wc-block-product {
		max-width: none;
		min-width: calc(20% - 12px);
	}
}

/* Carousel arrows: round white buttons; phones swipe instead. */
.ma-carousel__nav .wc-block-next-previous-buttons__button,
.wp-block-woocommerce-product-gallery-large-image-next-previous .wc-block-next-previous-buttons__button {
	background-color: var(--wp--preset--color--white);
	border: 0;
	border-radius: var(--wp--preset--border-radius--pill);
	box-shadow: var(--wp--preset--shadow--small);
	color: var(--wp--preset--color--contrast);
	height: 44px;
	width: 44px;
}

@media (max-width: 781px) {
	.ma-carousel__nav {
		display: none;
	}
}

/* Spotlight row + square tile images (best-seller band, promo fallback). */
.ma-spotlight__row > .ma-spotlight__item {
	flex: 0 0 min(62%, 240px);
}

.ma-tile-image img {
	aspect-ratio: 1;
	background-color: var(--wp--preset--color--white);
	border-radius: var(--wp--preset--border-radius--large);
	object-fit: cover;
	width: 100%;
}

.ma-tile-image--portrait img {
	aspect-ratio: 4 / 5;
	border-radius: var(--wp--preset--border-radius--x-large);
}

.ma-spotlight__item p {
	margin: 0;
	padding-inline: 4px;
}

/* ==========================================================================
   Category chips (Product Filters → category → chips)
   ========================================================================== */

/*
 * Let the chip row scroll instead of stretching the page: the filter
 * wrappers are flex items and the <fieldset> defaults to
 * min-width: min-content, so all of them must be allowed to shrink.
 */
.ma-category-chips,
.ma-category-chips .wc-block-product-filters__content,
.ma-category-chips .wc-block-product-filters__overlay,
.ma-category-chips .wc-block-product-filters__overlay-wrapper,
.ma-category-chips .wc-block-product-filters__overlay-dialog,
.ma-category-chips .wc-block-product-filters__overlay-content,
.ma-category-chips .wp-block-woocommerce-product-filter-taxonomy,
.ma-category-chips .wc-block-product-filter-chips,
.ma-category-chips .wc-block-product-filter-chips__fieldset {
	max-width: 100%;
	min-width: 0;
}

.ma-category-chips .wc-block-product-filter-chips__fieldset {
	border: 0;
	margin: 0;
	padding: 0;
}

.ma-category-chips .wc-block-product-filter-chips__items {
	flex-wrap: nowrap;
	gap: 8px;
	overflow-x: auto;
	padding-block: 2px 6px;
	scrollbar-width: none;
}

.ma-category-chips .wc-block-product-filter-chips__items::-webkit-scrollbar {
	display: none;
}

.ma-category-chips .wc-block-product-filter-chips__item,
.ma-category-chips .wc-block-product-filter-chips__show-more {
	align-items: center;
	border-radius: var(--wp--preset--border-radius--pill);
	display: inline-flex;
	flex: none;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	min-height: 44px;
	padding: 0 18px;
	white-space: nowrap;
}

.ma-category-chips .wc-block-product-filter-chips__show-more {
	background: transparent;
	border: 1px dashed var(--wp--preset--color--divider);
	border-radius: var(--wp--preset--border-radius--pill);
	color: var(--wp--preset--color--accent-strong);
	padding-inline: 18px;
}

/* ==========================================================================
   Featured product hero pattern
   ========================================================================== */

.ma-product-hero__media .wc-block-components-product-image {
	border-radius: var(--wp--preset--border-radius--x-large);
}

.ma-product-hero__chip {
	bottom: 16px;
	left: 16px;
	max-width: calc(100% - 32px);
	position: absolute;
	z-index: 2;
}

.ma-product-hero__chip .wp-block-post-title,
.ma-product-hero__chip .wc-block-components-product-price {
	margin: 0;
}

.ma-product-hero__product .wc-block-product-template {
	margin: 0;
}

/* ==========================================================================
   Single product (shared parts; form/gallery styles load with their blocks)
   ========================================================================== */

@media (min-width: 782px) {
	.ma-product__columns > .ma-product__media {
		align-self: flex-start;
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--custom--header--height) + 16px);
	}
}

.ma-product__summary .wc-block-components-product-price {
	font-weight: 700;
}

.ma-product__summary .wp-block-woocommerce-product-summary p {
	margin: 0;
}

.ma-trust__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ma-trust__list li {
	margin: 0;
}

.ma-facts.ma-facts {
	column-gap: 18px;
	grid-template-columns: auto minmax(0, 1fr);
}

.ma-facts p {
	margin: 0;
}

/* Product specifications (material, dimensions…) inside the accordion. */
.wp-block-woocommerce-product-specifications table {
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
	width: 100%;
}

.wp-block-woocommerce-product-specifications th,
.wp-block-woocommerce-product-specifications td {
	border: 0;
	padding: 6px 0;
	text-align: left;
	vertical-align: top;
}

.wp-block-woocommerce-product-specifications th {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
	padding-right: 18px;
	white-space: nowrap;
}

/* Reviews on the product page. */
.ma-product-reviews .wc-block-components-review-list-item__rating,
.ma-product-reviews .wc-block-product-review-rating {
	color: var(--wp--preset--color--accent-strong);
}

.ma-product-reviews .comment-respond {
	background-color: var(--wp--preset--color--paper);
	border-radius: var(--wp--preset--border-radius--x-large);
	padding: 22px;
}

/* ==========================================================================
   Breadcrumbs, badges, prices, toolbar
   ========================================================================== */

.woocommerce-breadcrumb .ma-breadcrumbs__sep {
	margin-inline: 0.4em;
	opacity: 0.7;
}

.wc-block-components-product-sale-badge {
	border-radius: var(--wp--preset--border-radius--pill);
	letter-spacing: 0.02em;
	padding: 3px 10px;
}

.wc-block-components-product-price del {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

.wc-block-components-product-price ins {
	text-decoration: none;
}

.ma-shop-toolbar {
	flex-wrap: wrap;
	row-gap: 8px;
}

.wc-block-catalog-sorting select,
.woocommerce-ordering select {
	background-color: transparent;
	border-color: var(--wp--preset--color--divider);
	border-radius: var(--wp--preset--border-radius--pill);
	min-height: 44px;
	padding-inline: 14px 32px;
}

/* ==========================================================================
   Notices (block store notices + classic notices from legacy forms)
   ========================================================================== */

.wc-block-components-notice-banner.wc-block-components-notice-banner {
	background-color: var(--wp--preset--color--accent-tint);
	border: 0;
	border-radius: var(--wp--preset--border-radius--medium);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
}

.wc-block-components-notice-banner.is-error {
	background-color: var(--wp--preset--color--pink-tint);
}

.wc-block-components-notice-banner.is-error > svg {
	background-color: var(--wp--preset--color--berry);
}

.wc-block-components-notice-banner.is-success > svg {
	background-color: var(--wp--preset--color--accent-strong);
}

.wc-block-components-notice-banner .wc-forward.wp-element-button {
	background: transparent;
	color: var(--wp--preset--color--accent-strong);
	min-height: 0;
	padding: 0;
	text-decoration: underline;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	background-color: var(--wp--preset--color--accent-tint);
	border: 0;
	border-radius: var(--wp--preset--border-radius--medium);
	color: var(--wp--preset--color--contrast);
	list-style: none;
	padding: 14px 18px;
}

.woocommerce-error {
	background-color: var(--wp--preset--color--pink-tint);
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
	display: none;
}

/* ==========================================================================
   My Account (classic [woocommerce_my_account] inside page-my-account)
   ========================================================================== */

.woocommerce-account .woocommerce {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
}

.woocommerce-account .woocommerce-MyAccount-navigation {
	flex: 1 1 220px;
	max-width: 100%;
}

.woocommerce-account .woocommerce-MyAccount-content {
	flex: 999 1 420px;
	min-width: 0;
}

.woocommerce-MyAccount-navigation ul {
	display: flex;
	flex-direction: column;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
	align-items: center;
	border-radius: var(--wp--preset--border-radius--pill);
	color: var(--wp--preset--color--contrast);
	display: flex;
	font-weight: 600;
	min-height: 44px;
	padding: 0 18px;
	text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
	background-color: color-mix(in srgb, var(--wp--preset--color--contrast) 7%, transparent);
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation li a[aria-current] {
	background-color: var(--wp--preset--color--accent);
	text-decoration: none;
}

@media (max-width: 781px) {
	.woocommerce-MyAccount-navigation ul {
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.woocommerce-MyAccount-navigation li {
		flex: none;
	}

	.woocommerce-account .woocommerce-MyAccount-navigation li a {
		border: 1px solid var(--wp--preset--color--divider);
		white-space: nowrap;
	}
}

.woocommerce-account form .form-row {
	margin: 0 0 var(--wp--preset--spacing--30);
	padding: 0;
}

.woocommerce-account form .form-row label {
	color: var(--wp--preset--color--muted);
	display: block;
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: 5px;
}

/* Multi-field forms use the 16px radius (single search/name fields stay pill-shaped). */
.woocommerce-account form .input-text,
.woocommerce-account form select {
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: var(--wp--preset--border-radius--medium);
	font-size: 1rem;
	min-height: 48px;
	padding: 6px 16px;
	width: 100%;
}

.woocommerce-account form.login,
.woocommerce-account form.register,
.woocommerce-account .woocommerce-EditAccountForm,
.woocommerce-account .woocommerce-address-fields {
	background-color: var(--wp--preset--color--paper);
	border: 0;
	border-radius: var(--wp--preset--border-radius--x-large);
	padding: clamp(20px, 4vw, 32px);
}

.woocommerce-account .woocommerce-Addresses,
.woocommerce-account .u-columns {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.woocommerce-account .woocommerce-Address,
.woocommerce-account .u-column1,
.woocommerce-account .u-column2 {
	float: none;
	width: auto;
}

.woocommerce-account .woocommerce-Address {
	background-color: var(--wp--preset--color--paper);
	border-radius: var(--wp--preset--border-radius--large);
	padding: 20px;
}

.woocommerce-account address {
	font-style: normal;
}

.woocommerce-account table.shop_table,
.woocommerce-account table.woocommerce-orders-table {
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	font-size: var(--wp--preset--font-size--small);
	width: 100%;
}

.woocommerce-account table.shop_table th {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-align: left;
	text-transform: uppercase;
}

.woocommerce-account table.shop_table th,
.woocommerce-account table.shop_table td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--divider);
	padding: 12px 8px;
}

.woocommerce-account .woocommerce-button,
.woocommerce-account .button {
	border-radius: var(--wp--preset--border-radius--pill);
}

/* ==========================================================================
   Order confirmation
   ========================================================================== */

.ma-order-confirmation .wc-block-order-confirmation-summary {
	background-color: var(--wp--preset--color--paper);
	border-radius: var(--wp--preset--border-radius--x-large);
	padding: 20px 22px;
}

.ma-order-confirmation .wc-block-order-confirmation-totals table,
.ma-order-confirmation .wc-block-order-confirmation-address-wrapper address {
	border-color: var(--wp--preset--color--divider);
	border-radius: var(--wp--preset--border-radius--large);
}
