/* Twist Gifting picker.
   Fonts match the site: Helvetica; section titles 20px bold #3a3a3a (as the YITH option titles);
   help text 14px #666; buttons and labels 15px #111.
   Buttons use the approved Teabags / Loose Leaf style: black outline, black fill and a tick when chosen.
   Blend cards keep thin neutral lines (brief 3e: no blend colours). */

.twg,
.twg-chosen,
.twg-stepbar {
	--twg-font: helvetica, Arial, sans-serif;
	--twg-ink: #111;
	--twg-text: #3a3a3a;
	--twg-muted: #666;
	--twg-line: #d9d9d9;
	--twg-line-soft: #ececec;
	font-family: var(--twg-font);
	font-weight: 400;
	color: var(--twg-text);
}

.twg {
	margin: 0 0 24px;
}

.twg *,
.twg-chosen *,
.twg-stepbar * {
	box-sizing: border-box;
}

.twg p,
.twg h3,
.twg-chosen p,
.twg-chosen h4 {
	margin: 0;
	font-family: var(--twg-font);
	letter-spacing: 0;
	text-transform: none;
}

.twg-preview-note {
	font-size: 14px;
	line-height: 21px;
	color: var(--twg-muted);
	border: 1px dashed var(--twg-line);
	padding: 8px 12px;
	margin-bottom: 16px !important;
}

/* Step bar at the top of the journey */
.twg-stepbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	list-style: none;
	margin: 0 0 24px !important;
	padding: 14px 0 !important;
	border-top: 1px solid var(--twg-line);
	border-bottom: 1px solid var(--twg-line);
}

.twg-stepbar li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
	font-family: var(--twg-font);
	font-size: 15px;
	line-height: 22px;
	color: var(--twg-ink);
}

.twg-stepbar li::before {
	display: none !important;
}

/* One numbered circle, used in the step bar and in front of every step title. */
html body.twg-active .twg-step-num {
	display: inline-flex !important;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin: 0 10px 0 0;
	padding: 0;
	border-radius: 50%;
	background: #111;
	color: #fff !important;
	font-family: helvetica, Arial, sans-serif !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
}

html body.twg-active .twg-stepbar .twg-step-num {
	margin: 0;
}

/* Every step title (Format, Choose your blends, Personalisation, Gift wrap) uses the same type. */
html body.twg-active .twg-numbered {
	display: flex !important;
	align-items: center;
	font-family: helvetica, Arial, sans-serif !important;
	font-size: 20px !important;
	font-weight: 700 !important;
	line-height: 26px !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: #3a3a3a !important;
}

html body.twg-active table.variations label.twg-numbered {
	margin: 0 !important;
}

/* The theme adds a colon after variation labels; the other step titles have none. */
html body.twg-active table.variations label.twg-numbered::after {
	content: none !important;
	display: none !important;
}

/* Short help line under the caddy Format title, same style as the other help text. */
html body.twg-active .twg-format-help {
	margin: 6px 0 10px !important;
	font-family: helvetica, Arial, sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 21px;
	letter-spacing: 0;
	text-transform: none;
	color: #666;
}

/* Short description "how it works" list: same black number circles as the step bar and step titles. */
html body.twg-active .twg-short-description p {
	margin: 0 0 12px;
}

html body.twg-active .twg-short-description ol.twg-how {
	margin: 0 0 12px !important;
	padding: 0 !important;
	list-style: none !important;
	counter-reset: twg-how;
}

html body.twg-active .twg-short-description ol.twg-how li {
	position: relative;
	margin: 0 0 10px !important;
	padding: 0 0 0 36px !important;
	list-style: none !important;
	counter-increment: twg-how;
	font-size: 16px;
	line-height: 26px;
}

html body.twg-active .twg-short-description ol.twg-how li::before {
	content: counter(twg-how);
	position: absolute;
	left: 0;
	top: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #111;
	color: #fff;
	font-family: helvetica, Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	line-height: 26px;
	text-align: center;
}

html body.twg-active .twg-short-description ol.twg-how strong {
	font-weight: 700;
	color: #3a3a3a;
}

/* Picker heading */
.twg-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}

.twg .twg-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 22px;
	color: var(--twg-text);
}

.twg-counter {
	flex: none;
	min-width: 48px;
	padding: 3px 10px;
	border: 1px solid #111;
	border-radius: 999px;
	font-size: 15px;
	line-height: 20px;
	text-align: center;
	color: var(--twg-ink);
}

.twg .twg-help {
	font-size: 14px;
	line-height: 21px;
	color: var(--twg-muted);
	margin-bottom: 18px;
}

.twg .twg-step {
	font-size: 15px;
	font-weight: 700;
	line-height: 22px;
	color: var(--twg-text);
	margin: 0 0 8px;
}

/* Tea types and blends: approved button style */
.twg-cats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
	gap: 8px;
	margin-bottom: 20px;
}

.twg-blends {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
	margin-bottom: 8px;
}

.twg-blends.is-empty {
	display: block;
}

.twg .twg-blends-prompt {
	padding: 14px 16px;
	border: 1px dashed var(--twg-line);
	border-radius: 8px;
	font-size: 14px;
	line-height: 21px;
	color: var(--twg-muted);
}

.twg-cat,
.twg-blend {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 10px 14px;
	border: 1px solid #111;
	border-radius: 8px;
	background: #fff;
	box-shadow: rgba(0, 0, 0, 0.18) 0 1px 0 0, rgba(0, 0, 0, 0.1) 0 6px 14px 0;
	font-family: var(--twg-font);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.3;
	text-align: center;
	color: #111;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.twg-cat:hover,
.twg-blend:hover {
	background: #f4f4f4;
}

.twg-cat.is-active,
.twg-cat.is-active:hover,
.twg-blend.is-selected,
.twg-blend.is-selected:hover {
	background: #111;
	color: #fff;
}

.twg-blend.is-selected .twg-blend-name::after {
	content: " \2713";
}

.twg-cat.has-picks::after {
	content: "";
	position: absolute;
	top: 7px;
	right: 7px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #111;
}

.twg-cat.is-active.has-picks::after {
	background: #fff;
}

.twg-cat:focus-visible,
.twg-blend:focus-visible,
.twg-minus:focus-visible,
.twg-slot-remove:focus-visible,
.twg-clear:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

.twg-badge {
	position: absolute;
	top: -9px;
	left: -9px;
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	border: 1px solid #111;
	border-radius: 999px;
	background: #fff;
	color: #111;
	font-family: var(--twg-font);
	font-size: 13px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
}

.twg-blend.is-unavailable {
	color: var(--twg-muted);
	border-style: dashed;
	cursor: not-allowed;
}

.twg-minus {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 26px;
	height: 26px;
	border: 1px solid #111;
	border-radius: 50%;
	background: #fff;
	font-family: var(--twg-font);
	font-size: 17px;
	line-height: 23px;
	text-align: center;
	color: #111;
	cursor: pointer;
}

.twg-minus:hover {
	background: #111;
	color: #fff;
}

.twg .twg-note {
	min-height: 18px;
	font-size: 15px;
	line-height: 22px;
	color: var(--twg-ink);
	margin: 4px 0 12px;
}

/* Chosen blends */
.twg-chosen {
	margin: 8px 0 0;
}

.twg-chosen--aside {
	margin: 28px 0 0;
}

.twg-chosen .twg-chosen-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 22px;
	margin-bottom: 12px;
	color: var(--twg-text);
}

.twg-slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.twg-chosen--aside .twg-slots {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.twg--single .twg-slots,
.twg-chosen--aside.twg-chosen--single .twg-slots {
	grid-template-columns: minmax(0, 1fr);
}

.twg-slot {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--twg-line);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.twg-chosen--single .twg-slot.is-filled {
	flex-direction: row;
	align-items: stretch;
}

.twg-chosen--single .twg-slot.is-filled .twg-slot-img {
	flex: 0 0 38%;
	aspect-ratio: auto;
	min-height: 150px;
	border-bottom: 0;
	border-right: 1px solid var(--twg-line-soft);
}

.twg-slot.is-empty {
	min-height: 110px;
	align-items: center;
	justify-content: center;
	border-color: var(--twg-line-soft);
	background: #fafafa;
}

.twg-slot-num {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 1;
	min-width: 26px;
	height: 26px;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-family: var(--twg-font);
	font-size: 13px;
	line-height: 26px;
	text-align: center;
}

.twg-slot.is-empty .twg-slot-num {
	background: #fff;
	color: #111;
	border: 1px solid #111;
	line-height: 24px;
}

.twg-slot .twg-slot-empty {
	font-size: 14px;
	line-height: 21px;
	color: var(--twg-muted);
}

.twg-slot-img {
	aspect-ratio: 4 / 3;
	border-bottom: 1px solid var(--twg-line-soft);
	background: #fafafa;
}

.twg-slot-img img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	border-radius: 0 !important;
}

.twg-slot-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 10px 12px 12px;
}

.twg-chosen .twg-slot-name {
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	color: var(--twg-text);
}

.twg-chosen .twg-slot-caf {
	font-size: 14px;
	line-height: 21px;
	color: var(--twg-muted);
}

.twg-chosen .twg-slot-desc {
	font-size: 14px;
	line-height: 21px;
	color: var(--twg-muted);
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.twg-slot-remove,
.twg-clear {
	align-self: flex-start;
	margin-top: 4px;
	font-family: var(--twg-font);
	font-size: 14px;
	line-height: 21px;
	color: var(--twg-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.twg-clear {
	display: inline-block;
	margin-top: 12px;
	font-size: 15px;
}

/* Replace the Mix and Match grid and reset link with the picker (picker products only). */
html body.twg-active.twg-ready form.mnm_form .mnm_child_products,
html body.twg-active.twg-ready form.mnm_form .mnm_reset {
	display: none !important;
}

/* First paint: no flash of the long standard grid. "twg-js" is set in the page head; the grid stays hidden
   from the start, and the options area stays invisible (keeping some space) until the picker is ready.
   "twg-fallback" (picker failed or never started) shows the standard controls again. */
html.twg-js:not(.twg-fallback) body.twg-active form.mnm_form .mnm_child_products,
html.twg-js:not(.twg-fallback) body.twg-active form.mnm_form .mnm_reset {
	display: none !important;
}

/* Quick View popups (related products) keep their standard grid: the picker only runs on the page's own form. */
html.twg-js body.twg-active .quickview-wrap form.mnm_form .mnm_child_products,
html body.twg-active.twg-ready .quickview-wrap form.mnm_form .mnm_child_products {
	display: grid !important;
}

/* WooCommerce sets an inline visibility on the caddy Clear link; keep it hidden while loading too. */
html.twg-js:not(.twg-fallback) body.twg-active:not(.twg-ready) form.variations_form .reset_variations {
	visibility: hidden !important;
}

html.twg-js:not(.twg-fallback) body.twg-active:not(.twg-ready) form.mnm_form,
html.twg-js:not(.twg-fallback) body.twg-active:not(.twg-ready) form.variations_form {
	position: relative;
	min-height: 480px;
	visibility: hidden;
}

html.twg-js:not(.twg-fallback) body.twg-active:not(.twg-ready) form.mnm_form::before,
html.twg-js:not(.twg-fallback) body.twg-active:not(.twg-ready) form.variations_form::before {
	content: "Loading your gift options\2026";
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	visibility: visible;
	font-family: helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 21px;
	color: #666;
}

/* Step-by-step flow: later steps stay hidden until the step above is complete. */
html body.twg-active .twg-step-hidden {
	display: none !important;
}

@keyframes twg-step-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

html body.twg-active .twg-step-enter {
	animation: twg-step-in 0.35s ease-out both;
}

html body.twg-active .twg-continue-wrap {
	margin: 16px 0 8px;
}

html body.twg-active .twg-continue {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 160px;
	height: 50px;
	padding: 0 28px;
	border: 1px solid #111;
	border-radius: 8px;
	background: #111;
	box-shadow: rgba(0, 0, 0, 0.18) 0 1px 0 0, rgba(0, 0, 0, 0.1) 0 6px 14px 0;
	font-family: helvetica, Arial, sans-serif;
	font-size: 15px;
	font-weight: 400;
	line-height: 1;
	color: #fff;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

html body.twg-active .twg-continue:hover {
	background: #333;
}

html body.twg-active .twg-numbered:focus:not(:focus-visible) {
	outline: none;
}

html body.twg-active .twg-continue:focus-visible,
html body.twg-active .twg-numbered:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

html body.twg-active .twg-continue-note {
	margin: 8px 0 0;
	font-family: helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 21px;
	color: #b00020;
}

html body.twg-active .twg-continue-note:empty {
	margin: 0;
}

/* Keyboard access to the YITH option buttons (Format, Gift wrap). The site CSS hides the real inputs with
   display:none, which also takes them out of the Tab order. Keep them focusable but invisible; clicks still go
   to the full-size label. */
html body.twg-active .yith-wapo-addon .radio-button-container,
html body.twg-active .yith-wapo-addon .checkbox-button-container {
	position: relative !important;
}

html body.twg-active .yith-wapo-addon .radio-button-container > .radiobutton,
html body.twg-active .yith-wapo-addon .checkbox-button-container > .checkbox-button {
	display: block !important;
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	pointer-events: none !important;
}

html body.twg-active .yith-wapo-addon .radio-button-container:has(input:focus-visible),
html body.twg-active .yith-wapo-addon .checkbox-button-container:has(input:focus-visible) {
	outline: 2px solid #111;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	html body.twg-active .twg-step-enter {
		animation: none;
	}
}

/* Variable products: the picker replaces the Blend dropdown row. */
html body.twg-active table.variations tr.twg-hidden-row,
html body.twg-active .twg-hidden-row {
	display: none !important;
}

/* Personalisation block: the second field repeated the block's help text on top of the input (brief 3a.iii). */
html body.twg-active #yith-wapo-container .yith-wapo-addon-type-text .yith-wapo-option > p.description {
	display: none !important;
}

/* Required add-ons (Format has no default): message shown when Add to basket is pressed without a choice. */
html body.twg-active .yith-wapo-addon .twg-required-note {
	margin: 10px 0 0;
	font-family: helvetica, Arial, sans-serif;
	font-size: 15px;
	font-weight: 400;
	line-height: 22px;
	color: #b00020;
}

html body.twg-active .yith-wapo-addon.twg-needs-answer .radio-button-container,
html body.twg-active .yith-wapo-addon.twg-needs-answer .checkbox-button-container {
	border-color: #b00020 !important;
}

/* Price and box status moved to just above Add to basket. */
html body.twg-active .twg-price-last {
	width: 100%;
	flex: 0 0 100%;
	margin: 8px 0 16px;
}

html body.twg-active .twg-before {
	margin: 0 0 24px;
}

@media (max-width: 991px) {
	.twg-cats,
	.twg-blends,
	.twg-slots {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.twg-blends.is-empty {
		display: block;
	}

	.twg--single .twg-slots {
		grid-template-columns: minmax(0, 1fr);
	}

	.twg-chosen .twg-slot-desc {
		-webkit-line-clamp: 3;
	}

	.twg-stepbar {
		gap: 8px 14px;
	}
}

@media (max-width: 360px) {
	.twg-cat,
	.twg-blend {
		font-size: 14px;
		padding: 8px;
	}
}
