/* ==========================================================================
   Withdrawal notice — shared across every product type module.
   Owned/enqueued by Withdrawal_Notice itself (includes/class-withdrawal-notice.php)
   so it loads regardless of which module actually rendered it.
   ========================================================================== */

.wdmcc-withdrawal-notice {
	border: 1px solid #f0c36d;
	background: #fff8e6;
	border-radius: 4px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wdmcc-withdrawal-notice__text {
	font-size: 0.85em;
	color: #6b5416;
	margin: 0;
}

/* ==========================================================================
   Price summary — itemised breakdown shown before add-to-cart.
   Rendered by Price_Summary (includes/class-price-summary.php); values are
   updated live by each module's own script.
   ========================================================================== */

.wdmcc-price-summary {
	border: 1px solid #e3e3e3;
	border-radius: 4px;
	background: #fafafa;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wdmcc-price-summary__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	font-size: 0.9em;
	line-height: 1.4;
}

.wdmcc-price-summary__label {
	color: #555;
}

.wdmcc-price-summary__value {
	white-space: nowrap;
	text-align: right;
}

.wdmcc-price-summary__row--total {
	border-top: 1px solid #ddd;
	margin-top: 4px;
	padding-top: 8px;
	font-size: 1.05em;
	font-weight: 700;
}

.wdmcc-price-summary__row--total .wdmcc-price-summary__label {
	color: inherit;
}

/* ==========================================================================
   Configurator controls — option cards, Yes/No pills, quantity steppers.
   Rendered by Option_Card (includes/class-option-card.php). Shared because the
   same questions (curtain weights, pack counts) appear in more than one
   product type and must not drift apart visually.
   ========================================================================== */

.wdmcc-toggle-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 0.25rem;
}

.wdmcc-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 400;
	padding: 0.4rem 0.9rem;
	border: 1px solid #d8d8d8;
	border-radius: 999px;
	cursor: pointer;
	margin: 0;
	transition: border-color 0.15s, background 0.15s;
}

.wdmcc-pill:hover {
	border-color: var(--wdmcc-accent, #2c6e49);
}

.wdmcc-pill.is-selected {
	border-color: var(--wdmcc-accent, #2c6e49);
	background: color-mix(in srgb, var(--wdmcc-accent, #2c6e49) 10%, transparent);
	font-weight: 600;
}

.wdmcc-pill input[type="radio"] {
	margin: 0;
}

/* A pill carrying a price or a note under its label (sewing options). */
.wdmcc-pill--stacked {
	align-items: flex-start;
	border-radius: 8px;
	padding: 0.6rem 0.9rem;
}

.wdmcc-pill__text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	text-align: left;
}

.wdmcc-pill__detail {
	font-size: 0.82em;
	opacity: 0.75;
	font-weight: 400;
}

.wdmcc-option-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 0.7rem;
}

.wdmcc-option-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.35rem;
	padding: 0.6rem;
	border: 2px solid #e2e2e2;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 400;
	margin: 0;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.wdmcc-option-card:hover {
	border-color: var(--wdmcc-accent, #2c6e49);
}

.wdmcc-option-card.is-selected {
	border-color: var(--wdmcc-accent, #2c6e49);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--wdmcc-accent, #2c6e49) 20%, transparent);
}

.wdmcc-option-card.is-selected::after {
	content: "✓";
	position: absolute;
	top: 6px;
	right: 6px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--wdmcc-accent, #2c6e49);
	color: #fff;
	font-size: 11px;
	line-height: 18px;
	text-align: center;
}

/* Visually hidden but still focusable/keyboard-operable — the card is the
   visual control, the native input stays in the accessibility tree. */
.wdmcc-option-card__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wdmcc-option-card__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 4px;
	background: #f4f4f4;
}

.wdmcc-option-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wdmcc-option-card__label {
	font-size: 0.85em;
	line-height: 1.25;
}

.wdmcc-option-card__price {
	font-size: 0.8em;
	opacity: 0.75;
}

/* Admin-entered detail under an option (thread colour code, spool length…). */
.wdmcc-option-card__desc {
	font-size: 0.75em;
	line-height: 1.35;
	opacity: 0.7;
}

.wdmcc-qty-field {
	margin-top: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.wdmcc-stepper {
	display: flex;
	align-items: center;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	overflow: hidden;
	width: fit-content;
}

.wdmcc-stepper__btn {
	background: #f5f5f5;
	border: none;
	color: #333;
	cursor: pointer;
	font-size: 1.3em;
	line-height: 1;
	width: 40px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	-webkit-user-select: none;
	user-select: none;
}

.wdmcc-stepper__btn:hover { background: #e8e8e8; }

.wdmcc-stepper__input {
	-moz-appearance: textfield;
	appearance: textfield;
	background: #fff;
	border: none;
	font-size: 1em;
	height: 44px;
	outline: none;
	padding: 0 8px;
	text-align: center;
	width: 70px;
}

.wdmcc-stepper__input::-webkit-outer-spin-button,
.wdmcc-stepper__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Product description preview above the configurator (Description_Preview). */
.wdmcc-desc-preview {
	margin: 0 0 1.25rem;
}

.wdmcc-desc-preview__text {
	margin: 0;
	font-size: 0.95em;
	line-height: 1.55;
	opacity: 0.9;
}

/* The fade only makes sense when text was actually cut off. It is painted on
   top of the last line, so the paragraph keeps its normal flow height. */
.wdmcc-desc-preview--truncated .wdmcc-desc-preview__text {
	position: relative;
}

.wdmcc-desc-preview--truncated .wdmcc-desc-preview__text::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1.6em;
	pointer-events: none;
	background: linear-gradient(
		to bottom,
		transparent,
		var( --wdmcc-page-bg, #fff )
	);
}

.wdmcc-desc-preview__more {
	display: inline-block;
	margin-top: 0.35rem;
	font-size: 0.9em;
	text-decoration: underline;
	cursor: pointer;
}

/* Matching thread option — product types 1, 3 and 4 (Matching_Thread). */
.wdmcc-thread {
	margin: 1rem 0;
	padding: 0.85rem 1rem;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
}

.wdmcc-thread__toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	cursor: pointer;
	font-weight: 400;
}

.wdmcc-thread__toggle input[type="checkbox"] {
	margin: 0;
	flex-shrink: 0;
}

.wdmcc-thread__title {
	flex: 1 1 auto;
}

/* The price sits in its own element rather than inside the label text, so it
   never picks up the stray padding a translated "( %s )" used to introduce. */
.wdmcc-thread__price {
	flex-shrink: 0;
	font-weight: 600;
}

.wdmcc-thread__price .woocommerce-Price-amount {
	margin: 0;
	padding: 0;
}

.wdmcc-thread__details[hidden] {
	display: none;
}

.wdmcc-thread__info {
	margin: 0.6rem 0 0;
	font-size: 0.85em;
	line-height: 1.45;
	opacity: 0.8;
}
