/**
 * Shared storefront styles: the small pieces StoreMaster adds to a theme's own
 * product markup. Kept deliberately tiny — the front-end budget is 25 KB gzip
 * for everything shared (PRD 27.3), and a toolkit that restyles a merchant's
 * theme is a support burden, not a feature.
 */

.sm-price del {
	opacity: 0.7;
	margin-right: 0.35em;
}

.sm-price__saving {
	font-size: 0.875em;
	font-weight: 600;
	white-space: nowrap;
}

.sm-lead-time {
	margin: 0.5em 0;
	font-size: 0.9375em;
}

.sm-lead-time__label {
	font-weight: 600;
}

.sm-tab__icon {
	margin-right: 0.35em;
}

.sm-notice {
	margin: 0.75em 0;
	padding: 0.75em 1em;
	border-left: 4px solid currentColor;
	background: rgba(15, 23, 42, 0.04);
}

.sm-search {
	position: relative;
}

.sm-search__results {
	list-style: none;
	margin: 0;
	padding: 0;
	position: absolute;
	inset-inline: 0;
	z-index: 50;
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid rgba(15, 23, 42, 0.15);
	border-radius: 0.375rem;
	max-height: 24rem;
	overflow: auto;
}

.sm-search__result {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	padding: 0.5rem 0.75rem;
}

.sm-search__result[aria-selected="true"],
.sm-search__result:hover {
	background: rgba(15, 23, 42, 0.06);
}

.sm-search__result mark {
	background: transparent;
	font-weight: 700;
	text-decoration: underline;
}

/* --- product tables ------------------------------------------------------
 * A real table, styled to stay readable rather than to look like a data grid.
 * The horizontal scroll lives on the wrapper, so a wide table never makes the
 * PAGE scroll sideways (PRD 24.9).
 */

.sm-table-wrap {
	margin: 1.5em 0;
}

.sm-table {
	width: 100%;
	border-collapse: collapse;
	display: block;
	overflow-x: auto;
	white-space: nowrap;
}

@media (min-width: 48rem) {
	.sm-table {
		display: table;
		white-space: normal;
	}
}

.sm-table th,
.sm-table td {
	padding: 0.6em 0.75em 0.6em 0;
	border-bottom: 1px solid rgba(15, 23, 42, 0.12);
	text-align: left;
	vertical-align: middle;
}

.sm-table thead th {
	font-size: 0.8125em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom-width: 2px;
}

.sm-table thead a {
	text-decoration: none;
	display: inline-block;
}

.sm-table thead a:focus-visible,
.sm-filters__option:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.sm-col--image img {
	max-width: 56px;
	height: auto;
	display: block;
}

.sm-col--price,
.sm-col--quantity {
	white-space: nowrap;
}

.sm-col--quantity input {
	max-width: 6em;
}

.sm-table__unavailable {
	opacity: 0.7;
	font-size: 0.9375em;
}

.sm-table__controls {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}

.sm-table__actions {
	margin-top: 1rem;
}

.sm-table__paging ul {
	list-style: none;
	display: flex;
	gap: 0.35rem;
	padding: 0;
	margin: 1rem 0 0;
	flex-wrap: wrap;
}

.sm-table__paging a {
	display: inline-block;
	padding: 0.2em 0.6em;
	border: 1px solid rgba(15, 23, 42, 0.2);
	border-radius: 0.25rem;
	text-decoration: none;
}

.sm-table__paging a[aria-current="page"] {
	font-weight: 700;
	border-color: currentColor;
}

/* --- filters ------------------------------------------------------------- */

.sm-filters__group {
	border: 0;
	padding: 0;
	margin: 0 0 1.25rem;
}

.sm-filters__group legend {
	font-weight: 600;
	padding: 0;
	margin-bottom: 0.35rem;
}

.sm-filters__group ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.15rem;
}

.sm-filters__option {
	text-decoration: none;
	display: inline-block;
	padding: 0.1em 0;
}

/* Active state is carried by the checkmark and aria-current, never by colour
 * alone (PRD 11.3). */
.sm-filters__option.is-active {
	font-weight: 700;
}

.sm-filters__option.is-active::before {
	content: "\2713\00a0";
}

.sm-filters__count {
	opacity: 0.7;
	font-size: 0.875em;
}

.sm-filters__active ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	padding: 0;
	margin: 0 0 1rem;
}

.sm-chip {
	display: inline-block;
	padding: 0.15em 0.6em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 0.875em;
	text-decoration: none;
}

.sm-filters__price label {
	display: inline-block;
	margin-right: 0.35rem;
}

.sm-filters__price input {
	max-width: 7em;
	margin-right: 0.75rem;
}

/* --- unlock form --------------------------------------------------------- */

.sm-unlock {
	max-width: 26rem;
	margin: 2rem auto;
}

.sm-unlock input[type="password"] {
	width: 100%;
}

.sm-unlock__error {
	border-left: 4px solid currentColor;
	padding: 0.5em 0.75em;
	background: rgba(15, 23, 42, 0.04);
	font-weight: 600;
}

/* --- product options ------------------------------------------------------ */

.sm-options__group {
	border: 0;
	padding: 0;
	margin: 0 0 1.5em;
}

.sm-options__group legend {
	font-weight: 600;
	padding: 0;
	margin-bottom: 0.5em;
}

.sm-options__field {
	display: grid;
	gap: 0.25em;
	margin: 0 0 1em;
}

.sm-options__field label {
	font-weight: 600;
}

.sm-options__choices {
	display: grid;
	gap: 0.25em;
}

.sm-options__choice {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
}

.sm-options__choice label {
	font-weight: 400;
}

.sm-options__description {
	font-size: 0.875em;
	opacity: 0.8;
}

.sm-options__heading {
	margin: 1.25em 0 0.25em;
	font-size: 1.05em;
}
