/*
 * Components: buttons, icon buttons, option chips, quantity stepper, notice.
 * Tokens only. Every control is a full pill; nothing casts a shadow.
 */

/* ---- Button ------------------------------------------------------------- */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: var(--control-height);
	padding: 0 var(--space-5);
	border: var(--border-width) solid var(--color-border-strong);
	border-radius: var(--radius-pill);
	background: var(--color-surface);
	color: var(--color-text);
	font-size: var(--text-12);
	font-weight: var(--weight-bold);
	line-height: 1;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.button:hover {
	background: var(--color-surface-muted);
}

.button--primary {
	border-color: var(--color-action);
	background: var(--color-action);
	color: var(--color-action-text);
}

.button--primary:hover {
	border-color: var(--color-action-hover);
	background: var(--color-action-hover);
}

.button--primary:focus-visible {
	outline-color: var(--color-action);
}

.button--block {
	width: 100%;
}

/* Modal CTA and drawer checkout: 56px, Bold 16/18 on desktop; 40px, Bold 12 on mobile. */
@media (min-width: 768px) {
	.button--lg {
		min-height: var(--control-height-lg);
		font-size: var(--text-16);
	}
}

/* aria-disabled keeps the control focusable and announced; the label says why. */
.button[aria-disabled="true"],
.button:disabled {
	border-color: var(--color-disabled-border);
	background: var(--color-disabled-bg);
	color: var(--color-disabled-text);
	cursor: not-allowed;
}

.button[aria-busy="true"] {
	cursor: progress;
}

/* ---- Icon button (close X) --------------------------------------------- */

.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--color-text);
}

.icon-button:hover {
	background: var(--color-surface-muted);
}

.icon {
	width: var(--icon-size);
	height: var(--icon-size);
	stroke-width: 1.5px;
}

/* Stroke widths in CSS px, whatever size the icon renders at. */
.icon path {
	vector-effect: non-scaling-stroke;
}

.icon--close {
	width: 18px;
	height: 18px;
	stroke-width: var(--icon-stroke);
}

/* ---- Option chips ------------------------------------------------------- */

.options {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.options__label {
	display: block;
	margin-bottom: 10px;
	font-size: var(--text-12);
	text-transform: uppercase;
}

.options__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/*
 * Circles (57px desktop, 41px mobile) that grow into pills for longer labels
 * ("5-Pack"). Selected = filled red. Sold out = grey with a diagonal strike;
 * the visually hidden note keeps "Out of stock" for screen readers.
 */
.chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--chip-size);
	height: var(--chip-size);
	padding: 0 var(--space-3);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-pill);
	background: var(--color-surface);
	color: var(--color-text);
	font-size: var(--text-14);
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.chip:hover {
	border-color: var(--color-border-strong);
}

.chip[aria-pressed="true"] {
	border-color: var(--color-action);
	background: var(--color-action);
	color: var(--color-action-text);
}

.chip[aria-disabled="true"] {
	border-color: var(--color-disabled-border);
	background:
		linear-gradient(
			to top right,
			transparent calc(50% - 0.5px),
			var(--color-disabled-text) calc(50% - 0.5px),
			var(--color-disabled-text) calc(50% + 0.5px),
			transparent calc(50% + 0.5px)
		),
		var(--color-disabled-bg);
	color: var(--color-disabled-text);
	cursor: not-allowed;
}

.chip[aria-disabled="true"] .chip__label {
	text-decoration: line-through;
}

.chip__note {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (min-width: 768px) {
	.options__list {
		gap: 10px;
	}

	.chip {
		font-size: var(--text-16);
	}
}

/* ---- Quantity stepper --------------------------------------------------- */

/* "- 1 +" in a pill: 143x56 modal, 121x41 sheet, 103x36 / 95x34 cart. */
.stepper {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--stepper-width);
	height: var(--stepper-height);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-pill);
	background: var(--color-surface);
	font-size: var(--text-14);
}

.stepper__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	align-self: stretch;
	min-width: 2rem;
	padding: 0;
	border: 0;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--color-text);
}

.stepper__button:first-child {
	justify-content: flex-end;
}

.stepper__button:last-child {
	justify-content: flex-start;
}

.stepper__button .icon {
	width: 0.625em;
	height: 0.625em;
	stroke-width: 1.25px;
}

.stepper__button:disabled,
.stepper__button[aria-disabled="true"] {
	color: var(--color-disabled-text);
	cursor: not-allowed;
}

.stepper__value {
	min-width: 2.5ch;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
	.stepper {
		font-size: var(--text-16);
	}
}

/* ---- Notice ------------------------------------------------------------- */

.notice-region:empty {
	display: none;
}

.notice {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3);
	padding: var(--space-3) var(--space-4);
	border: var(--border-width) solid var(--color-notice-border);
	border-left: 3px solid var(--color-notice-accent);
	background: var(--color-notice-bg);
	font-size: var(--text-14);
	line-height: var(--leading-snug);
}

.notice + .notice {
	margin-top: var(--space-2);
}

.notice__message {
	flex: 1;
}

.notice__dismiss {
	flex: none;
	padding: 0;
	border: 0;
	background: transparent;
	text-decoration: underline;
	font-size: var(--text-12);
}
