/**
 * Shilpi WooCommerce Kit.
 *
 * Every colour resolves through the site's own tokens first, so a store that
 * has set a brand colour gets badges and buttons in it without configuring
 * anything here. The literals are the last resort, and they are neutral.
 */

:root {
	--swk-accent: var(--commerce-accent, var(--color-primary, #1f2124));
	--swk-line: var(--commerce-line, var(--color-border, #e5e7eb));
	--swk-surface: var(--color-surface, #fff);
	--swk-text: var(--color-text, #1f2124);
	--swk-muted: var(--color-muted, #5c6169);
	--swk-radius: var(--commerce-radius, 12px);
	--swk-sale: #d93025;
	--swk-new: #1f9d55;
	--swk-featured: #8a5a10;
	--swk-sold: #6b7280;
}

/* ---------- Labels ---------- */

.swk-labels {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	left: 12px;
	pointer-events: none;
	position: absolute;
	top: 12px;
	z-index: 3;
}

/* The card and the gallery both need to be the positioning context, and
   neither reliably is. Setting it here is safe: `relative` on an element that
   is already relative changes nothing. */
.woocommerce ul.products li.product,
.woocommerce div.product div.images,
.sh-woo-element--product-gallery { position: relative; }

.swk-label {
	background: var(--swk-sold);
	border-radius: 999px;
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1.6;
	padding: 3px 10px;
	white-space: nowrap;
}

.swk-label--sale { background: var(--swk-sale); }
.swk-label--new { background: var(--swk-new); }
.swk-label--featured { background: var(--swk-featured); }
.swk-label--stock { background: var(--swk-sold); }

/* ---------- Swatches ---------- */

.swk-swatches select {
	border: 0;
	clip: rect(0 0 0 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.swk-swatches__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.swk-swatch {
	align-items: center;
	background: var(--swk-surface);
	border: 1.5px solid var(--swk-line);
	border-radius: 999px;
	color: var(--swk-text);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	gap: 7px;
	min-height: 40px;
	padding: 0 16px;
	transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.swk-swatch:hover { border-color: var(--swk-accent); color: var(--swk-accent); }

.swk-swatch[aria-pressed="true"] {
	border-color: var(--swk-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--swk-accent) 18%, transparent);
	color: var(--swk-accent);
}

/* Unavailable, not hidden. Removing the option loses the information that the
   combination exists at all, which is the thing the shopper is trying to
   learn. */
.swk-swatch[disabled] {
	cursor: not-allowed;
	opacity: .4;
	position: relative;
	text-decoration: line-through;
}

.swk-swatch__chip {
	background: var(--swk-swatch-colour, #ccc);
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 50%;
	height: 16px;
	width: 16px;
}

.swk-swatch--colour { padding-left: 10px; }

/* ---------- Sticky buy bar ---------- */

.swk-bar {
	background: var(--swk-surface);
	border-top: 1px solid var(--swk-line);
	bottom: 0;
	box-shadow: 0 -8px 30px rgba(16, 24, 40, .10);
	left: 0;
	position: fixed;
	right: 0;
	transform: translateY(100%);
	transition: transform .22s ease;
	z-index: 90;
}

.swk-bar[hidden] { display: none; }
.swk-bar.is-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
	.swk-bar { transition: none; }
}

.swk-bar__inner {
	align-items: center;
	display: flex;
	gap: 16px;
	margin: 0 auto;
	max-width: var(--shell, 1240px);
	padding: 10px var(--pad-x, 20px);
}

.swk-bar__thumb {
	border-radius: 8px;
	flex: none;
	height: 46px;
	object-fit: cover;
	width: 46px;
}

.swk-bar__text {
	display: grid;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.swk-bar__title {
	color: var(--swk-text);
	font-size: 14.5px;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.swk-bar__price {
	color: var(--swk-accent);
	font-size: 15px;
	font-weight: 800;
}

.swk-bar__price del { color: var(--swk-muted); font-size: 13px; font-weight: 600; margin-right: 6px; opacity: 1; }
.swk-bar__price ins { text-decoration: none; }

.swk-bar__button {
	background: var(--swk-accent);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	flex: none;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	min-height: 46px;
	padding: 0 28px;
	transition: filter .18s ease;
}

.swk-bar__button:hover { filter: brightness(.92); }
.swk-bar__button[disabled] { cursor: not-allowed; opacity: .5; }

@media (max-width: 767px) {
	.swk-bar--desktop-only { display: none; }
	.swk-bar__thumb { display: none; }
	.swk-bar__title { display: none; }
	.swk-bar__inner { gap: 12px; padding: 8px var(--pad-x, 16px); }
	.swk-bar__button { flex: 1 1 auto; padding: 0 18px; }
}

/* ---------- Phase 1 discovery tools ---------- */

.swk-product-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
}

.swk-product-actions--loop {
	padding: 0 14px 14px;
}

.swk-product-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 38px;
	padding: 0 13px;
	border: 1px solid var(--swk-line);
	border-radius: 999px;
	background: var(--swk-surface);
	color: var(--swk-text);
	font: inherit;
	font-size: 13px;
	font-weight: 650;
	line-height: 1;
	cursor: pointer;
	transition: border-color .18s ease, color .18s ease, background .18s ease, opacity .18s ease;
}

.swk-product-action > span[aria-hidden="true"] {
	font-size: 18px;
	line-height: 1;
}

.swk-product-action:hover,
.swk-product-action.is-active {
	border-color: var(--swk-accent);
	background: color-mix(in srgb, var(--swk-accent) 9%, var(--swk-surface));
	color: var(--swk-accent);
}

.swk-product-action.is-loading { cursor: wait; opacity: .55; }
.swk-product-action.is-error { border-color: var(--swk-sale); color: var(--swk-sale); }

.swk-empty-list {
	display: grid;
	justify-items: center;
	gap: 10px;
	padding: clamp(34px, 6vw, 70px) 24px;
	border: 1px dashed var(--swk-line);
	border-radius: var(--swk-radius);
	background: color-mix(in srgb, var(--swk-surface) 82%, transparent);
	text-align: center;
}

.swk-empty-list > span { color: var(--swk-accent); font-size: 34px; }
.swk-empty-list p { margin: 0; color: var(--swk-muted); }
.swk-empty-list a { color: var(--swk-accent); font-weight: 700; }

.swk-compare {
	width: 100%;
	overflow-x: auto;
	border: 1px solid var(--swk-line);
	border-radius: var(--swk-radius);
	background: var(--swk-surface);
}

.swk-compare table {
	width: 100%;
	min-width: 720px;
	margin: 0;
	border: 0;
	border-collapse: collapse;
}

.swk-compare th,
.swk-compare td {
	padding: 16px;
	border: 0;
	border-right: 1px solid var(--swk-line);
	border-bottom: 1px solid var(--swk-line);
	vertical-align: top;
	text-align: left;
}

.swk-compare tr:last-child > * { border-bottom: 0; }
.swk-compare tr > *:last-child { border-right: 0; }
.swk-compare thead th { min-width: 190px; background: color-mix(in srgb, var(--swk-line) 30%, var(--swk-surface)); }
.swk-compare tbody th { width: 140px; color: var(--swk-muted); font-size: 13px; }
.swk-compare img { display: block; width: 130px; height: 130px; border-radius: 10px; object-fit: cover; }
.swk-compare .swk-product-actions { margin: 0; }

.swk-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 14px 0;
}

.swk-share__label { margin-right: 3px; color: var(--swk-muted); font-size: 13px; font-weight: 700; }
.swk-share a,
.swk-share button {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 12px;
	border: 1px solid var(--swk-line);
	border-radius: 999px;
	background: var(--swk-surface);
	color: var(--swk-text);
	font: inherit;
	font-size: 12.5px;
	font-weight: 650;
	text-decoration: none;
	cursor: pointer;
}

.swk-share a:hover,
.swk-share button:hover { border-color: var(--swk-accent); color: var(--swk-accent); }
