/*!
 * TemplateHive — marketplace stylesheet
 * Loaded only on shop, product, cart, checkout and account views.
 */

/* ===================================================== 1. Product cards */

.th-products {
	display: grid;
	gap: clamp(18px, 2vw, 26px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.th-products--grid { grid-template-columns: repeat(var(--th-cols, 4), minmax(0, 1fr)); }
.th-products--list { grid-template-columns: 1fr; }

@media (max-width: 1180px) { .th-products--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .th-products--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .th-products--grid { grid-template-columns: 1fr; } }

.th-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--th-surface);
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	overflow: hidden;
	transition: transform var(--th-base), box-shadow var(--th-base), border-color var(--th-base);
}

.th-card:hover {
	transform: translateY(-4px);
	border-color: rgba(var(--th-primary-rgb), .35);
	box-shadow: var(--th-shadow-md);
}

.th-card__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: linear-gradient(135deg, #eef2ff, #f5f3ff);
}

.th-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s var(--th-ease);
}

.th-card:hover .th-card__media img { transform: scale(1.045); }

.th-card__overlay {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	gap: 10px;
	background: linear-gradient(180deg, rgba(15, 23, 42, .1), rgba(15, 23, 42, .62));
	opacity: 0;
	transition: opacity var(--th-base);
}

.th-card:hover .th-card__overlay,
.th-card:focus-within .th-card__overlay { opacity: 1; }

.th-card__overlay .th-btn { transform: translateY(8px); transition: transform var(--th-base); }
.th-card:hover .th-card__overlay .th-btn { transform: translateY(0); }

.th-card__flags {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	z-index: 2;
}

.th-flag {
	padding: .26rem .62rem;
	border-radius: var(--th-radius-pill);
	background: rgba(15, 23, 42, .78);
	color: #fff;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.th-flag--sale { background: #dc2626; }
.th-flag--free { background: #059669; }
.th-flag--new { background: var(--th-primary); }
.th-flag--featured { background: linear-gradient(135deg, #f59e0b, #f97316); }

.th-wishlist {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--th-body);
	cursor: pointer;
	box-shadow: var(--th-shadow-sm);
	transition: transform var(--th-fast), color var(--th-fast), background var(--th-fast);
}

.th-wishlist:hover { transform: scale(1.08); color: #e11d48; }
.th-wishlist.is-active { color: #e11d48; }
.th-wishlist.is-active svg { fill: currentColor; }
.th-wishlist.is-busy { opacity: .55; }

.th-card__body {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 18px;
	flex: 1;
}

.th-card__cat {
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--th-primary);
	text-decoration: none;
}

.th-card__title { margin: 0; font-size: 1.04rem; line-height: 1.35; }
.th-card__title a { color: var(--th-ink); text-decoration: none; }
.th-card__title a:hover { color: var(--th-primary); }
.th-card__excerpt { margin: 0; font-size: .89rem; color: var(--th-body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.th-card__stats { display: flex; align-items: center; gap: 12px; font-size: .82rem; color: var(--th-muted); }
.th-card__stats span { display: inline-flex; align-items: center; gap: 5px; }

.th-card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--th-line-soft);
}

.th-card__foot .th-btn { padding-inline: .85em; }

.th-price { display: flex; align-items: baseline; gap: 6px; font-size: 1.06rem; font-weight: 700; color: var(--th-ink); white-space: nowrap; }
.th-price del { color: var(--th-muted); font-weight: 500; font-size: .86em; margin-right: 6px; }
.th-price ins { text-decoration: none; }
.th-price--free { color: var(--th-success); }
.th-card__foot .th-price .amount { font-weight: 700; }

/* List view */

.th-products--list .th-card { flex-direction: row; }
.th-products--list .th-card__media { flex: 0 0 clamp(220px, 30%, 320px); aspect-ratio: 4 / 3; }
.th-products--list .th-card__body { padding: 22px 24px; }
.th-products--list .th-card__excerpt { -webkit-line-clamp: 3; }

@media (max-width: 720px) {
	.th-products--list .th-card { flex-direction: column; }
	.th-products--list .th-card__media { flex: none; width: 100%; }
}

/* ================================================== 2. Marketplace shell */

.th-shop { padding-block: clamp(28px, 4vw, 44px); }

.th-market {
	display: grid;
	grid-template-columns: 274px minmax(0, 1fr);
	gap: clamp(22px, 3vw, 40px);
	align-items: start;
}

@media (max-width: 980px) { .th-market { grid-template-columns: 1fr; } }

.th-filters {
	position: sticky;
	top: calc(var(--th-header-h) + 20px);
	display: grid;
	gap: 4px;
	padding: 20px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	background: var(--th-surface);
	box-shadow: var(--th-shadow-xs);
	max-height: calc(100vh - var(--th-header-h) - 40px);
	overflow-y: auto;
}

.th-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-bottom: 12px;
	margin-bottom: 6px;
	border-bottom: 1px solid var(--th-line-soft);
}

.th-filters__head h2 { margin: 0; font-size: 1rem; }

/* Server-side submit for the filter form. TemplateHive Core adds
   .th-filters--live to the form when it takes over with AJAX. */
.th-filters__submit { margin: 14px 0 0; }
.th-filters--live .th-filters__submit { display: none; }

.th-filter-group { padding: 14px 0; border-bottom: 1px solid var(--th-line-soft); }
.th-filter-group:last-of-type { border-bottom: 0; }

.th-filter-group > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	list-style: none;
	font-size: .88rem;
	font-weight: 700;
	color: var(--th-ink);
	letter-spacing: .01em;
}

.th-filter-group > summary::-webkit-details-marker { display: none; }

.th-filter-group > summary::after {
	content: "";
	width: 16px;
	height: 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform var(--th-fast);
}

.th-filter-group[open] > summary::after { transform: rotate(180deg); }

.th-filter-list { display: grid; gap: 9px; margin-top: 13px; max-height: 230px; overflow-y: auto; padding-right: 4px; }
.th-filter-list::-webkit-scrollbar { width: 5px; }
.th-filter-list::-webkit-scrollbar-thumb { background: var(--th-line); border-radius: 4px; }

.th-filter-list .th-check { justify-content: flex-start; font-weight: 500; font-size: .9rem; }
.th-filter-list .th-check span + span { margin-left: auto; color: var(--th-muted); font-size: .8rem; }
.th-filter-list .th-check > span:first-of-type { flex: 1; }

.th-price-range { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.th-price-range input { padding: .5rem .6rem; font-size: .88rem; }

.th-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	margin-bottom: 22px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	background: var(--th-surface);
	box-shadow: var(--th-shadow-xs);
}

.th-toolbar__count { font-size: .92rem; color: var(--th-body); font-weight: 500; }
.th-toolbar__count strong { color: var(--th-ink); }
.th-toolbar__spacer { margin-left: auto; }
.th-toolbar select { width: auto; min-width: 190px; padding-block: .55rem; font-size: .9rem; }

.th-view-toggle {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	background: var(--th-bg);
}

.th-view-toggle button {
	display: grid;
	place-items: center;
	width: 34px;
	height: 32px;
	border: 0;
	border-radius: 7px;
	background: none;
	color: var(--th-muted);
	cursor: pointer;
	transition: background var(--th-fast), color var(--th-fast);
}

.th-view-toggle button[aria-pressed="true"] { background: var(--th-surface); color: var(--th-primary); box-shadow: var(--th-shadow-xs); }

.th-filter-open { display: none; }

@media (max-width: 980px) {
	.th-filter-open { display: inline-flex; }

	.th-drawer {
		position: fixed;
		inset: 0;
		z-index: 90;
		background: rgba(15, 23, 42, .5);
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--th-base), visibility var(--th-base);
	}

	.th-drawer.is-open { opacity: 1; visibility: visible; }

	.th-drawer .th-filters {
		position: absolute;
		inset: 0 auto 0 0;
		width: min(360px, 88vw);
		max-height: none;
		border-radius: 0;
		border: 0;
		transform: translateX(-100%);
		transition: transform var(--th-base);
		overflow-y: auto;
	}

	.th-drawer.is-open .th-filters { transform: translateX(0); }
}

@media (min-width: 981px) {
	.th-drawer { display: contents; }
}

.th-active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.th-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: .3rem .75rem;
	border-radius: var(--th-radius-pill);
	background: var(--th-primary-soft);
	color: var(--th-primary-dark);
	font-size: .84rem;
	font-weight: 600;
	border: 0;
	cursor: pointer;
}

/* ================================================== 3. Single template */

.th-product {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 372px;
	gap: clamp(24px, 3vw, 48px);
	align-items: start;
	padding-block: clamp(24px, 3vw, 40px);
}

@media (max-width: 1024px) { .th-product { grid-template-columns: 1fr; } }

/* .th-product sets align-items:start, which shrinks this column to the height
   of the purchase card — leaving the sticky card inside it no distance to
   travel, so it unsticks immediately. Stretching the column to the row height
   is what actually makes the sticky buy card work. */
.th-product__aside { align-self: stretch; }

.th-product__head { margin-bottom: 22px; }
.th-product__title { margin: 10px 0 12px; }

.th-product__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 18px;
	font-size: .9rem;
	color: var(--th-muted);
}

.th-product__meta span { display: inline-flex; align-items: center; gap: 6px; }
.th-product__meta a { color: var(--th-body); text-decoration: none; }
.th-product__meta a:hover { color: var(--th-primary); }

.th-gallery {
	position: relative;
	border-radius: var(--th-radius);
	overflow: hidden;
	border: 1px solid var(--th-line);
	background: var(--th-bg);
	box-shadow: var(--th-shadow-sm);
}

.th-gallery img { width: 100%; display: block; }

.th-gallery__thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
	gap: 10px;
	margin-top: 12px;
}

.th-gallery__thumbs button {
	padding: 0;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	overflow: hidden;
	background: none;
	cursor: pointer;
	aspect-ratio: 4 / 3;
	transition: border-color var(--th-fast), transform var(--th-fast);
}

.th-gallery__thumbs button:hover { transform: translateY(-2px); }
.th-gallery__thumbs button[aria-current="true"] { border-color: var(--th-primary); box-shadow: 0 0 0 2px rgba(var(--th-primary-rgb), .25); }
.th-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.th-product__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* Purchase card */

.th-buy-card {
	position: sticky;
	top: calc(var(--th-header-h) + 20px);
	padding: 24px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	background: var(--th-surface);
	box-shadow: var(--th-shadow-md);
}

.th-buy-card__price {
	display: flex;
	align-items: baseline;
	gap: 10px;
	font-size: 2rem;
	font-weight: 800;
	color: var(--th-ink);
	line-height: 1.1;
}

/* Sale badge beside the price, replacing WooCommerce's floating corner
   circle (unhooked in inc/woocommerce.php). */
.th-save {
	align-self: center;
	padding: .28rem .6rem;
	border-radius: var(--th-radius-pill);
	background: var(--th-danger);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Belt and braces: other plugins and WooCommerce shortcodes can still print
   the default badge, and the theme has no styling for it. */
.woocommerce span.onsale,
.woocommerce-page span.onsale { display: none; }

.th-buy-card__price del { font-size: 1.1rem; font-weight: 500; color: var(--th-muted); }
.th-buy-card__price ins { text-decoration: none; }
.th-buy-card__licence { margin: 6px 0 18px; font-size: .88rem; color: var(--th-muted); }

.th-buy-card form.cart { margin: 0; display: grid; gap: 10px; }
.th-buy-card .quantity { display: none; }

.th-buy-card__actions { display: grid; gap: 10px; margin-bottom: 20px; }

.th-specs { display: grid; gap: 0; margin: 0; font-size: .9rem; }

.th-specs__row {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	padding: 11px 0;
	border-bottom: 1px solid var(--th-line-soft);
}

.th-specs__row:last-child { border-bottom: 0; }
.th-specs__key { color: var(--th-muted); }
.th-specs__val { color: var(--th-ink); font-weight: 600; text-align: right; }

.th-buy-card__note {
	display: flex;
	gap: 9px;
	margin-top: 18px;
	padding: 12px 14px;
	border-radius: var(--th-radius-sm);
	background: var(--th-bg);
	font-size: .84rem;
	color: var(--th-body);
}

.th-owned {
	padding: 14px 16px;
	border-radius: var(--th-radius-sm);
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	color: #065f46;
	font-size: .9rem;
	font-weight: 600;
	margin-bottom: 16px;
}

/* Content sections */

.th-product__sections { display: grid; gap: clamp(32px, 4vw, 52px); margin-top: clamp(32px, 4vw, 52px); }
.th-block { scroll-margin-top: calc(var(--th-header-h) + 20px); }
.th-block__title { font-size: 1.4rem; margin-bottom: 18px; }

.th-tabs {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	padding-bottom: 2px;
	margin-bottom: 26px;
	border-bottom: 1px solid var(--th-line);
	scrollbar-width: none;
}

.th-tabs::-webkit-scrollbar { display: none; }

.th-tabs a {
	padding: .7rem 1rem;
	border-bottom: 2px solid transparent;
	color: var(--th-body);
	font-size: .93rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--th-fast), border-color var(--th-fast);
}

.th-tabs a:hover, .th-tabs a.is-active { color: var(--th-primary); border-color: var(--th-primary); }

.th-feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.th-feature-item {
	display: flex;
	gap: 13px;
	padding: 16px 18px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	background: var(--th-surface);
}

.th-feature-item__icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--th-primary-soft);
	color: var(--th-primary);
}

.th-feature-item strong { display: block; color: var(--th-ink); font-size: .96rem; }
.th-feature-item p { margin: 3px 0 0; font-size: .87rem; }

.th-steps { counter-reset: th-step; list-style: none; padding: 0; display: grid; gap: 14px; }

.th-steps li {
	counter-increment: th-step;
	position: relative;
	padding: 14px 18px 14px 56px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	background: var(--th-surface);
}

.th-steps li::before {
	content: counter(th-step);
	position: absolute;
	left: 16px;
	top: 13px;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--th-gradient);
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
}

.th-req-list { list-style: none; padding: 0; display: grid; gap: 10px; }

.th-req-list li {
	position: relative;
	padding-left: 28px;
	font-size: .95rem;
}

.th-req-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .3em;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--th-primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.th-changelog { display: grid; gap: 18px; }

.th-changelog__item {
	padding: 18px 20px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	background: var(--th-surface);
}

.th-changelog__version { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.th-changelog__version strong { font-size: 1rem; color: var(--th-ink); }
.th-changelog__version time { font-size: .84rem; color: var(--th-muted); }
.th-changelog ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .93rem; }

/* Reviews */

.th-reviews__summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 26px;
	padding: 22px 24px;
	margin-bottom: 26px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	background: var(--th-bg);
}

.th-reviews__score { font-size: 2.6rem; font-weight: 800; color: var(--th-ink); line-height: 1; }
.th-reviews__bars { flex: 1; min-width: 220px; display: grid; gap: 6px; }
.th-reviews__bar { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--th-muted); }
.th-reviews__bar span:first-child { width: 42px; }

.th-reviews__track { flex: 1; height: 7px; border-radius: 4px; background: var(--th-line); overflow: hidden; }
.th-reviews__fill { display: block; height: 100%; background: var(--th-star); }

/* ================================================== 4. Account dashboard */

.th-account { padding-block: clamp(28px, 4vw, 48px); }

.woocommerce-account .woocommerce-MyAccount-navigation {
	float: none;
	width: auto;
}

.woocommerce-account .woocommerce-MyAccount-content {
	float: none;
	width: auto;
}

.th-account__layout {
	display: grid;
	grid-template-columns: 268px minmax(0, 1fr);
	gap: clamp(22px, 3vw, 40px);
	align-items: start;
}

@media (max-width: 900px) { .th-account__layout { grid-template-columns: 1fr; } }

.th-account__nav {
	padding: 18px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	background: var(--th-surface);
	box-shadow: var(--th-shadow-xs);
	position: sticky;
	top: calc(var(--th-header-h) + 20px);
}

.th-account__user { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 12px; border-bottom: 1px solid var(--th-line-soft); }
.th-account__user img { border-radius: 50%; }
.th-account__user strong { display: block; color: var(--th-ink); font-size: .96rem; }
.th-account__user span { font-size: .82rem; color: var(--th-muted); }

.th-account__nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.th-account__nav a {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: .68rem .8rem;
	border-radius: var(--th-radius-sm);
	color: var(--th-body);
	font-size: .93rem;
	font-weight: 500;
	text-decoration: none;
	transition: background var(--th-fast), color var(--th-fast);
}

.th-account__nav a:hover { background: var(--th-bg); color: var(--th-ink); }

.th-account__nav .is-active > a,
.th-account__nav .woocommerce-MyAccount-navigation-link.is-active > a {
	background: var(--th-primary-soft);
	color: var(--th-primary-dark);
	font-weight: 600;
}

.th-account__panel {
	padding: clamp(20px, 3vw, 30px);
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	background: var(--th-surface);
	box-shadow: var(--th-shadow-xs);
}

.th-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }

.th-stat-card {
	padding: 18px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	background: var(--th-bg);
}

.th-stat-card__value { font-size: 1.7rem; font-weight: 800; color: var(--th-ink); line-height: 1.1; }
.th-stat-card__label { font-size: .84rem; color: var(--th-muted); }

.th-purchase {
	display: flex;
	gap: 16px;
	padding: 16px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	background: var(--th-surface);
	align-items: center;
}

.th-purchase + .th-purchase { margin-top: 12px; }
.th-purchase__media { flex: 0 0 96px; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--th-line-soft); }
.th-purchase__media img { width: 100%; height: 100%; object-fit: cover; }
.th-purchase__body { flex: 1; min-width: 0; }
.th-purchase__body h3 { margin: 0 0 4px; font-size: 1rem; }
.th-purchase__body h3 a { color: var(--th-ink); text-decoration: none; }
.th-purchase__meta { font-size: .84rem; color: var(--th-muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.th-purchase__actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
	.th-purchase { flex-direction: column; align-items: stretch; }
	.th-purchase__media { flex: none; width: 100%; }
}

/* ============================================ 5. Cart, checkout, notices */

.woocommerce-notices-wrapper:empty { display: none; }

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	list-style: none;
	margin: 0 0 22px;
	padding: 14px 18px;
	border-radius: var(--th-radius-sm);
	border: 1px solid var(--th-line);
	background: var(--th-bg);
	font-size: .93rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.woocommerce-message { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.woocommerce-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.woocommerce-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.woocommerce-message .button, .woocommerce-info .button { margin-left: auto; }

.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	padding: .78em 1.5em;
	border: 1px solid transparent;
	border-radius: var(--th-radius-sm);
	background: var(--th-ink);
	color: #fff;
	font: inherit;
	font-size: .93rem;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	cursor: pointer;
	transition: filter var(--th-fast), transform var(--th-fast);
}

.woocommerce .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce #respond input#submit:hover { background: #1e293b; color: #fff; }

.woocommerce .button.alt,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce #respond input#submit.alt {
	background: var(--th-gradient);
	box-shadow: var(--th-shadow-brand);
}

.woocommerce .button.alt:hover { filter: brightness(1.06); }

.th-cart-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: clamp(22px, 3vw, 40px);
	align-items: start;
}

@media (max-width: 900px) { .th-cart-layout { grid-template-columns: 1fr; } }

.woocommerce table.shop_table {
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	background: var(--th-surface);
}

.woocommerce table.shop_table th { background: var(--th-bg); font-size: .84rem; text-transform: uppercase; letter-spacing: .05em; }
.woocommerce table.shop_table td { vertical-align: middle; }
.woocommerce table.shop_table img { width: 68px; border-radius: 8px; }

.woocommerce .cart_totals,
.woocommerce-checkout-review-order {
	padding: 22px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius);
	background: var(--th-surface);
	box-shadow: var(--th-shadow-sm);
	position: sticky;
	top: calc(var(--th-header-h) + 20px);
}

.woocommerce form .form-row { margin: 0 0 16px; padding: 0; }
.woocommerce form .form-row label { display: block; }
.woocommerce-checkout .col2-set { display: grid; grid-template-columns: 1fr; gap: 0; }

.select2-container--default .select2-selection--single {
	height: auto;
	padding: .45rem .3rem;
	border-color: var(--th-line);
	border-radius: var(--th-radius-sm);
}

/* Downloads table */

.woocommerce-table--order-downloads td { font-size: .92rem; }

.th-download-row { display: flex; align-items: center; gap: 10px; }

/* Product gallery overrides */

/*
 * float:none is the important one. WooCommerce's own woocommerce-layout.css
 * carries `.woocommerce div.product div.images { float: left; width: 48% }`
 * (inside a min-width:768px media query), which is correct for WooCommerce's
 * two-column template and wrong here: this theme lays the product page out
 * with its own grid and expects the gallery to be an ordinary block at the top
 * of the main column. Left floated, everything after it — the action buttons,
 * the section tabs, the whole Overview — wraps into a narrow column beside the
 * image instead of sitting below it.
 *
 * Specificity note: WooCommerce's selector is (0,3,2); adding the
 * .woocommerce-product-gallery class here makes this (0,4,2), so it wins
 * without needing !important. Media queries add no specificity, so a rule
 * outside one still beats a rule inside one.
 */
.woocommerce div.product div.images.woocommerce-product-gallery {
	float: none;
	width: 100%;
	margin-bottom: 0;
	/* The zoom trigger below is absolutely positioned. Guaranteeing a
	   containing block here is what keeps it pinned to the image's corner
	   instead of escaping to the nearest positioned ancestor — which, with the
	   float removed, is the page. */
	position: relative;
}

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper { border-radius: var(--th-radius); overflow: hidden; }

/* The zoom trigger is WooCommerce's; restyle it to match the theme's chrome. */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	background: var(--th-surface);
	border: 1px solid var(--th-line);
	box-shadow: var(--th-shadow-sm);
	box-sizing: border-box;
}

.woocommerce div.product div.images .woocommerce-product-gallery__trigger::before { top: 10px; left: 10px; border-color: var(--th-ink); }
.woocommerce div.product div.images .woocommerce-product-gallery__trigger::after { top: 20px; left: 23px; background: var(--th-ink); }
.woocommerce div.product div.images .flex-control-thumbs { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.woocommerce div.product div.images .flex-control-thumbs li { width: auto; float: none; margin: 0; }
.woocommerce div.product div.images .flex-control-thumbs img { border-radius: var(--th-radius-sm); border: 1px solid var(--th-line); }

/* Reviews list */

.woocommerce #reviews #comments ol.commentlist { padding: 0; }

.woocommerce #reviews #comments ol.commentlist li {
	margin-bottom: 16px;
	padding: 18px 20px;
	border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	background: var(--th-surface);
}

.woocommerce #reviews #comments ol.commentlist li img.avatar {
	position: static;
	float: left;
	width: 44px;
	border: 0;
	border-radius: 50%;
	padding: 0;
	margin-right: 14px;
	background: none;
}

.woocommerce #reviews #comments ol.commentlist li .comment-text { margin: 0; padding: 0; border: 0; overflow: hidden; }
