

.myc-product-purchase .variations th {
	margin-bottom: calc(var(--ps-space-3) + var(--ps-space-2));
}

.myc-product-purchase .variations td {
	margin-bottom: var(--ps-space-3);
}

.myc-variation-swatches {
	gap: var(--ps-space-2);
	margin-bottom: 0;
}

/* The swatches and the buy controls are separate decisions, and the gap says
   so. It is asked of the last attribute row rather than of the button block
   below it: the legacy sheet pins that block, its wrapper and the table itself
   to `margin: 0 !important`, and a row carries no such rule. Rows between two
   attributes keep the tighter step above. */
.myc-product-purchase .variations tr:last-child td {
	margin-bottom: var(--ps-space-5);
}

.myc-variation-swatch {
	min-height: 48px;
	border-radius: var(--ps-radius-sm);
	font-weight: 800;
}

.myc-variation-swatch.is-selected {
	border-color: var(--ps-color-brand-700);
	background: var(--ps-color-brand-700);
	box-shadow: 0 8px 18px rgb(22 42 70 / 18%);
}

.myc-variation-swatch:disabled {
	background: var(--ps-color-surface-muted);
	color: var(--ps-color-disabled);
	text-decoration: line-through;
}

/*
 * Falta elegir talla.
 *
 * La etiqueta y las tallas que se pueden elegir se tiñen de rojo y el grupo
 * da una sacudida, que es lo que lleva el ojo hasta ellas. No hay otro aviso:
 * esto dice a la vez qué falta y dónde. Se quita en cuanto se elige una
 * talla; lo hace cart-interface.js.
 */
/*
 * Cuando el aviso trae las tallas a la vista, que no queden bajo la cabecera
 * fija. La cabecera mide 67px hasta 1080 y 175px por encima, con la barra de
 * navegación; a las dos se les suman 29 de aire.
 */
.myc-product-purchase .variations {
	scroll-margin-top: 96px;
}

@media (min-width: 1081px) {
	.myc-product-purchase .variations {
		scroll-margin-top: 204px;
	}
}

/*
 * Un rojo más oscuro que el de peligro del tema, a propósito: el de peligro,
 * sobre botones blancos y con relleno rosa, se leía flojo. Aquí va sin relleno
 * ni halo, solo el color en el borde y en el número.
 */
.myc-product-purchase .variations.is-attention {
	--ps-choice-alert: #a51c1c;
}

.myc-product-purchase .variations.is-attention th,
.myc-product-purchase .variations.is-attention th label {
	color: var(--ps-choice-alert);
}

.myc-product-purchase .variations.is-attention .myc-variation-swatches {
	animation: ps-choices-attention-nudge 460ms ease-in-out 1;
}

/* El trazo interior dobla el borde sin mover nada: un borde de 2px empujaría
   las tallas un píxel en cada lado. */
.myc-product-purchase .variations.is-attention .myc-variation-swatch:not(:disabled):not(.is-selected) {
	border-color: var(--ps-choice-alert);
	box-shadow: inset 0 0 0 1px var(--ps-choice-alert);
	color: var(--ps-choice-alert);
}

@keyframes ps-choices-attention-nudge {
	0%,
	100% {
		transform: translateX(0);
	}

	20% {
		transform: translateX(-6px);
	}

	40% {
		transform: translateX(6px);
	}

	60% {
		transform: translateX(-4px);
	}

	80% {
		transform: translateX(4px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.myc-product-purchase .variations.is-attention .myc-variation-swatches {
		animation: none;
	}
}

/* ------------------------------------------------------- collapsible steps --- */

/* 44px so the row is a real touch target: it is the only way to reopen a step. */
.myc-field-step__summary {
	display: flex;
	min-height: 44px;
	align-items: center;
	gap: var(--ps-space-3);
	padding: var(--ps-space-2) 0;
	cursor: pointer;
	list-style: none;
	-webkit-tap-highlight-color: transparent;
}

/* Safari paints its own disclosure triangle through a pseudo-element that
   `list-style: none` alone does not reach. */
.myc-field-step__summary::-webkit-details-marker {
	display: none;
}

.myc-field-step__number {
	display: flex;
	width: 24px;
	height: 24px;
	flex: none;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--ps-color-brand-50);
	color: var(--ps-color-brand-700);
	font-size: 12px;
	font-weight: 800;
}

.myc-field-step__heading {
	display: flex;
	min-width: 0;
	flex: 1;
	flex-direction: column;
	gap: 4px;
}

/* The heading keeps its own margin for the expanded layout; inside the summary
   the flex gap places it instead. */
.myc-field-step__heading h3 {
	margin: 0;
}

.myc-field-step__choice {
	overflow: hidden;
	color: var(--ps-color-text-muted);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* The chosen option is the one thing worth reading on a closed step, so it only
   shows there — open, the checked row says it already. */
.myc-field-step[open] .myc-field-step__choice {
	display: none;
}

/*
 * A 9px square rotated 45° measures about 13px across, so its corner reached
 * 2px past the column's right edge. The margin gives the rotation that room
 * back instead of letting the chevron sit on the edge.
 */
.myc-field-step__toggle {
	width: 9px;
	height: 9px;
	flex: none;
	border-right: 2px solid var(--ps-color-text-muted);
	border-bottom: 2px solid var(--ps-color-text-muted);
	margin-right: 2px;
	margin-bottom: 3px;
	transform: rotate(45deg);
	transition: transform var(--ps-transition-fast);
}

.myc-field-step[open] .myc-field-step__toggle {
	margin-bottom: -3px;
	transform: rotate(-135deg);
}

.myc-field-step__body {
	padding-top: var(--ps-space-3);
}

/* ---------------------------------------------- a step left unanswered --- */

.myc-field-step.is-invalid .myc-field-step__number {
	background: var(--ps-color-danger-ring);
	color: var(--ps-color-danger);
}

.myc-field-step.is-invalid .myc-field-step__heading h3,
.myc-field-step.is-invalid .myc-field-step__heading h3 span {
	color: var(--ps-color-danger);
}

.myc-field-step__pending {
	flex: none;
	color: var(--ps-color-danger);
	font-size: 12px;
	font-weight: 800;
}

/* Closed, the header carries the whole message; open, the box below says it in
   full and the word would only repeat it. */
.myc-field-step[open] .myc-field-step__pending {
	display: none;
}

.myc-field-step__error {
	display: flex;
	align-items: flex-start;
	gap: var(--ps-space-2);
	margin: 0 0 var(--ps-space-3);
	padding: var(--ps-space-2) var(--ps-space-3);
	border: 1px solid var(--ps-color-danger);
	border-radius: var(--ps-radius-sm);
	background: var(--ps-color-danger-soft);
	color: var(--ps-color-danger);
	font-size: 13px;
	line-height: 1.4;
}

.myc-field-step__error[hidden] {
	display: none;
}

/* Stroked, like the header icons, so it sits at the same weight as the rest of
   the theme's iconography rather than reading as a filled badge. */
.myc-field-step__error-icon {
	width: 16px;
	height: 16px;
	flex: none;
	margin-top: 1px;
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-width: 1.8;
}

/* The dot of the exclamation mark is the one part that is solid. */
.myc-field-step__error-icon circle:last-of-type {
	fill: currentcolor;
	stroke: none;
}

@media (hover: hover) {
	.myc-field-step__summary:hover .myc-field-step__toggle {
		border-color: var(--ps-color-brand-600);
	}
}

.myc-product-purchase .woocommerce-error,
.myc-product-purchase .woocommerce-info,
.myc-product-purchase .woocommerce-message {
	margin: 0 0 var(--ps-space-4);
	padding: var(--ps-space-3) var(--ps-space-4);
	border: 1px solid var(--ps-color-border);
	border-radius: var(--ps-radius-sm);
	background: var(--ps-color-surface-subtle);
	box-shadow: none;
}

/*
 * Availability is a line, not a panel. It used to share the box above, which
 * put a framed grey slab between the sizes and the buy button for a sentence
 * of two words — and the slab never looked square, because WooCommerce's own
 * <p> kept its bottom margin inside padding that had none to spare.
 */
.myc-product-purchase .woocommerce-variation-availability {
	/*
	 * Centred between the sizes and the buy button, which takes more than
	 * repeating the margin above it. `form.cart` is a flex container with a
	 * 12px gap, and the availability lives in the next flex item down, so the
	 * space above the line is the last size row's 24px margin *plus* that gap.
	 * Below it there is no gap to add — the buy button is its sibling inside
	 * the same item — so matching the two means 24 + 12 here.
	 */
	margin: 0 0 calc(var(--ps-space-5) + var(--ps-space-3));
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}

.myc-product-purchase .woocommerce-variation-availability:empty {
	display: none;
}

.myc-product-purchase .woocommerce-variation-availability p.stock {
	display: flex;
	align-items: center;
	gap: var(--ps-space-2);
	margin: 0;
	padding: 0;
	color: var(--ps-color-text-muted);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}

.myc-product-purchase .woocommerce-variation-availability p.out-of-stock {
	color: var(--ps-color-danger);
}

/*
 * The glyph is a mask rather than an image, so it is painted in the same red
 * as the words beside it and follows them if that colour ever changes.
 */
.myc-product-purchase .woocommerce-variation-availability p.out-of-stock::before {
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	background-color: currentcolor;
	content: '';
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V13'/%3E%3Cpath d='M12 16.4h.01'/%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='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V13'/%3E%3Cpath d='M12 16.4h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.myc-product-purchase .woocommerce-error {
	border-color: var(--ps-color-danger);
	background: var(--ps-color-danger-soft);
	color: var(--ps-color-danger);
}

.myc-product-purchase form.cart,
.myc-product-purchase .woocommerce-variation-add-to-cart {
	gap: var(--ps-space-3);
}

.myc-product-quantity-control {
	min-height: 56px;
	border-color: var(--ps-color-summary-border);
	border-radius: var(--ps-radius-sm);
}

.myc-product-quantity-control button,
.myc-product-quantity-value {
	min-height: 54px;
}

.myc-product-quantity-control button:focus-visible {
	position: relative;
	z-index: 1;
}

.myc-product-purchase button.single_add_to_cart_button,
.myc-product-purchase .single_add_to_cart_button,
.myc-product-purchase button.myc-ajax-add-to-cart-button,
.myc-product-purchase .myc-buy-now-button {
	min-height: 56px;
	border-radius: var(--ps-radius-sm);
	font-weight: 700;
	letter-spacing: .01em;
}

.myc-product-purchase .myc-buy-now-button {
	flex: 0 0 100%;
	width: 100%;
	margin: 0;
	/* A soft blue fill and a border a shade stronger than the brand's own
	   --ps-color-brand-border, so the secondary action reads as filled rather
	   than as an outline of the primary. Neither tone has a slot on the brand
	   scale, hence the literals. */
	border: 1px solid #97acc9;
	background: #eef2f8;
	color: var(--ps-color-brand-700);
	font: inherit;
	/* `font` is a shorthand: it resets weight to inherited along with family and
	   size, so the 850 above (which add-to-cart also needs and does not use this
	   shorthand) does not survive here on its own — this one has to restate it. */
	font-weight: 700;
	cursor: pointer;
	transition: background-color var(--ps-transition-fast), border-color var(--ps-transition-fast), color var(--ps-transition-fast);
}

/* #f2f5fa, which is --ps-color-brand-50 exactly. The border does not move:
   it is the button's own edge, not a hover signal. */
.myc-product-purchase .myc-buy-now-button:hover:not(:disabled),
.myc-product-purchase .myc-buy-now-button:focus-visible {
	background: var(--ps-color-brand-50);
	color: var(--ps-color-brand-700);
}

/* Same fill as the totals box and the add-to-cart button's disabled state,
   so all three read as one family. No external opacity touches this one —
   its own opacity: .5 only made it fainter than the colour already says on
   its own, so it stays dropped. */
.myc-product-purchase .myc-buy-now-button:disabled {
	border-color: var(--ps-color-summary-border);
	background: var(--ps-color-summary-fill);
	color: var(--ps-color-text-muted);
	opacity: 1;
}

.myc-product-purchase .myc-buy-now-button.is-loading {
	position: relative;
	border-color: var(--ps-color-brand-700);
	background: var(--ps-color-brand-50);
	color: transparent;
	opacity: 1;
	cursor: progress;
}

.myc-product-purchase .myc-buy-now-button.is-loading::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	border: 2px solid rgb(28 53 87 / 22%);
	border-top-color: var(--ps-color-brand-700);
	border-radius: 50%;
	content: '';
	transform: translate(-50%, -50%);
	animation: myc-cart-spinner .65s linear infinite;
}

.myc-product-purchase .single_add_to_cart_button.is-loading,
.myc-product-purchase .myc-ajax-add-to-cart-button.is-loading {
	background-color: var(--ps-color-brand-700);
}

@media (max-width: 760px) {
	.myc-product-purchase .quantity {
		flex: 0 0 128px;
	}

	.myc-product-purchase button.single_add_to_cart_button,
	.myc-product-purchase .single_add_to_cart_button,
	.myc-product-purchase button.myc-ajax-add-to-cart-button {
		flex: 1 1 0;
		width: auto;
		min-width: 0;
		padding-right: var(--ps-space-3);
		padding-left: var(--ps-space-3);
		font-size: 14px;
	}

	.myc-variation-swatches {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
