/**
 * Woo Product Customizer — product page styles.
 */

.wpc-customizer {
	--wpc-border: #e0e0e0;
	--wpc-muted: #6b6b6b;
	--wpc-accent: #2f6f4f;
	--wpc-bg: #fafafa;
	--wpc-panel-bg: #eef6f1;

	margin: 0 0 1.75em;
	display: grid;
	gap: 14px;
}

@media (min-width: 900px) {
	.wpc-customizer:has(.wpc-preview) {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: start;
	}

	.wpc-customizer:has(.wpc-preview) .wpc-preview {
		position: sticky;
		top: 1.5em;
	}

	.wpc-customizer:has(.wpc-preview) .wpc-summary {
		grid-column: 1 / -1;
	}
}

/* ---------------------------------------------------------- Preview stage */

.wpc-preview__views {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin-bottom: 0.75em;
}

.wpc-view-btn {
	background: transparent;
	border: 1px solid var(--wpc-border);
	border-radius: 999px;
	padding: 0.35em 0.9em;
	font-size: 0.85em;
	cursor: pointer;
	color: inherit;
}

.wpc-view-btn.is-active {
	background: var(--wpc-accent);
	border-color: var(--wpc-accent);
	color: #fff;
}

.wpc-preview__stage {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--wpc-border);
	border-radius: 8px;
	background: var(--wpc-bg);
	touch-action: none;
	min-height: 180px;
}

.wpc-preview__base {
	display: block;
	width: 100%;
	height: auto;
}

.wpc-preview__layers {
	position: absolute;
	inset: 0;
}

.wpc-preview__hint {
	margin: 0.6em 0 0;
	font-size: 0.8em;
	color: var(--wpc-muted);
}

.wpc-layer {
	position: absolute;
	display: flex;
	align-items: center;
	transform-origin: center center;
}

.wpc-layer.is-draggable {
	cursor: move;
	outline: 1px dashed rgba(0, 0, 0, 0.25);
}

.wpc-layer.is-draggable:hover,
.wpc-layer.is-active {
	outline: 1px solid var(--wpc-accent);
}

.wpc-layer img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

.wpc-layer__text {
	display: flex;
	align-items: center;
	width: 100%;
	line-height: 1.15;
	white-space: pre-wrap;
	word-break: break-word;
	pointer-events: none;
}

.wpc-handle {
	position: absolute;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--wpc-accent);
	opacity: 0;
	transition: opacity 0.15s;
}

.wpc-layer:hover .wpc-handle,
.wpc-layer.is-active .wpc-handle {
	opacity: 1;
}

.wpc-handle--resize {
	right: -7px;
	bottom: -7px;
	cursor: nwse-resize;
}

.wpc-handle--rotate {
	left: 50%;
	top: -22px;
	margin-left: -7px;
	cursor: grab;
}

/* --------------------------------------------------------------- Fields */

.wpc-fields__title {
	margin: 0 0 0.75em;
	font-size: 1.05em;
}

.wpc-fields {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wpc-field {
	margin: 0 0 1.1em;
}

.wpc-field:has(> .wpc-item) {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
}

.wpc-field--hidden {
	display: none !important;
}

/* ------------------------------------------------------------ Item cards */

.wpc-item {
	display: flex;
	align-items: flex-start;
	gap: 0.9em;
	padding: 1.15em 1.3em;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(16, 24, 17, 0.05);
}

.wpc-item__icon {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(47, 111, 79, 0.12);
	color: var(--wpc-accent);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpc-item__glyph {
	font-weight: 700;
	font-size: 1.05em;
	line-height: 1;
}

.wpc-item__body {
	flex: 1;
	min-width: 0;
}

.wpc-item__title {
	margin: 0 0 0.2em;
	font-size: 1.02em;
	font-weight: 700;
}

.wpc-item__desc {
	margin: 0 0 0.8em;
	font-size: 0.85em;
	color: var(--wpc-muted);
}

.wpc-field--half {
	flex: 1 1 calc(50% - 0.6em);
	min-width: 160px;
}

.wpc-field--full {
	flex: 1 1 100%;
}

.wpc-field__label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3em;
}

.wpc-field__desc {
	margin: 0 0 0.4em;
	font-size: 0.85em;
	color: var(--wpc-muted);
}

/* Higher specificity so it wins over the plain .wpc-field__label/__desc
   rules above on a label/paragraph that carries both classes. */
.wpc-field__label.wpc-item__title {
	margin: 0 0 0.2em;
	font-weight: 700;
}

.wpc-field__desc.wpc-item__desc {
	margin: 0 0 0.8em;
}

.wpc-field__error {
	display: none;
	margin: 0.35em 0 0;
	font-size: 0.85em;
	color: #b3261e;
}

.wpc-input {
	width: 100%;
	padding: 0.6em 0.7em;
	border: 1px solid var(--wpc-border);
	border-radius: 6px;
	background: #fff;
	font: inherit;
}

.wpc-counter {
	display: block;
	margin-top: 0.25em;
	font-size: 0.78em;
	color: var(--wpc-muted);
	text-align: right;
}

.wpc-number-wrap {
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.wpc-unit {
	color: var(--wpc-muted);
	font-size: 0.9em;
}

.wpc-radios,
.wpc-checkboxes {
	display: grid;
	gap: 0.4em;
}

.wpc-radio,
.wpc-checkbox {
	display: flex;
	align-items: center;
	gap: 0.5em;
	cursor: pointer;
}

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

.wpc-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
}

.wpc-swatch {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3em;
	cursor: pointer;
	padding: 0.3em;
	border: 2px solid transparent;
	border-radius: 8px;
	font-size: 0.8em;
	text-align: center;
	max-width: 92px;
}

.wpc-swatch input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.wpc-swatch:has(input:checked) {
	border-color: var(--wpc-accent);
	background: rgba(47, 111, 79, 0.06);
}

.wpc-swatch__chip {
	display: block;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.wpc-swatches--image img {
	width: 62px;
	height: 62px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

/* The "Custom" swatch: a real colour picker standing in for a chip. */
.wpc-swatch__custom-picker {
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 50%;
	cursor: pointer;
	background: none;
}

.wpc-swatch__custom-picker::-webkit-color-swatch-wrapper {
	padding: 0;
	border-radius: 50%;
}

.wpc-swatch__custom-picker::-webkit-color-swatch {
	border: none;
	border-radius: 50%;
}

.wpc-swatch__custom-picker::-moz-color-swatch {
	border: none;
	border-radius: 50%;
}

/* A number field offering a choice of units (e.g. cm or inch). */
.wpc-unit-select {
	max-width: 6.5em;
}

/* --------------------------------------------------------------- Upload */

.wpc-upload__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.wpc-upload__drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3em;
	padding: 1.4em 1em;
	border: 2px dashed var(--wpc-border);
	border-radius: 8px;
	background: var(--wpc-bg);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.wpc-upload__drop.is-over {
	border-color: var(--wpc-accent);
	background: rgba(47, 111, 79, 0.06);
}

.wpc-upload__icon {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(47, 111, 79, 0.1);
	color: var(--wpc-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.2em;
}

.wpc-upload__hint {
	font-weight: 600;
}

.wpc-upload__rules {
	font-size: 0.78em;
	color: var(--wpc-muted);
}

.wpc-upload__preview {
	display: flex;
	align-items: center;
	gap: 0.7em;
	padding: 0.6em;
	border: 1px solid var(--wpc-border);
	border-radius: 8px;
}

.wpc-upload__thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 4px;
	background: var(--wpc-bg);
}

.wpc-upload__name {
	flex: 1;
	font-size: 0.9em;
	word-break: break-all;
}

.wpc-upload__remove {
	background: none;
	border: 0;
	color: #b3261e;
	cursor: pointer;
	text-decoration: underline;
	font-size: 0.85em;
	padding: 0;
}

.wpc-upload__progress {
	margin-top: 0.5em;
	height: 4px;
	background: var(--wpc-border);
	border-radius: 999px;
	overflow: hidden;
}

.wpc-upload__progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--wpc-accent);
	transition: width 0.2s;
}

/* -------------------------------------------------------- Style controls */

.wpc-align-btn {
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--wpc-border);
	background: #fff;
	border-radius: 8px;
	cursor: pointer;
	color: var(--wpc-muted);
}

.wpc-align-btn.is-active {
	background: rgba(47, 111, 79, 0.1);
	border-color: var(--wpc-accent);
	color: var(--wpc-accent);
}

/* -------------------------------------------------------- Price summary */

.wpc-summary {
	display: flex;
	align-items: flex-start;
	gap: 0.9em;
	border-radius: 14px;
	padding: 1.1em 1.3em;
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 24, 17, 0.05);
}

.wpc-summary__icon {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(47, 111, 79, 0.12);
	color: var(--wpc-accent);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpc-summary__body {
	flex: 1;
	min-width: 0;
}

.wpc-summary__lines {
	list-style: none;
	margin: 0 0 0.6em;
	padding: 0;
	font-size: 0.9em;
}

.wpc-summary__lines li {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding: 0.15em 0;
	color: var(--wpc-muted);
}

.wpc-summary__total {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding-top: 0.6em;
	border-top: 1px solid var(--wpc-border);
	font-weight: 700;
}

.wpc-cart-preview {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

/* --------------------------------------------------- Start Customize */

.wpc-wrap {
	margin: 1.2em 0 1.8em;
}

.wpc-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wpc-start {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 1.1em 1.3em;
	border: 0;
	border-radius: 16px;
	background: var(--wpc-accent, #2f6f4f);
	color: #fff;
	text-align: left;
	cursor: pointer;
	transition: filter 0.15s;
}

.wpc-start:hover {
	filter: brightness(1.05);
}

.wpc-start__icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpc-start__text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15em;
}

.wpc-start__title {
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.2;
}

.wpc-start__subtitle {
	font-size: 0.85em;
	font-weight: 400;
	opacity: 0.85;
}

.wpc-start__arrow {
	flex: 0 0 auto;
	display: flex;
	transition: transform 0.2s;
}

.wpc-start__arrow svg {
	transform: rotate(180deg);
}

.wpc-start[aria-expanded="true"] .wpc-start__arrow svg {
	transform: rotate(0deg);
}

.wpc-customizer {
	margin-top: 0;
	padding: 14px;
	border: 0;
	border-radius: 16px;
	background: var(--wpc-panel-bg, #eef6f1);
}

/* ------------------------------------------------------- Estimate panel */

.wpc-quote-note {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 1.1em 1.2em;
	border: 1px solid #f0d6ae;
	border-radius: 14px;
	background: #fdf6ec;
}

.wpc-quote-note__icon {
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #d98324;
	color: #fff;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	font-size: 14px;
}

.wpc-quote-note p {
	margin: 0;
	font-size: 0.9em;
	line-height: 1.6;
	color: #5c4a30;
}

.wpc-actions-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.wpc-preview-open,
.wpc-add-to-quote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	flex: 1 1 auto;
	padding: 0.9em 1.2em;
	border-radius: 10px;
	font-size: 1em;
	font-weight: 700;
	cursor: pointer;
	border: 2px solid var(--wpc-accent, #2f6f4f);
}

.wpc-btn__icon {
	display: flex;
	flex: 0 0 auto;
}

.wpc-preview-open {
	background: #fff;
	color: var(--wpc-accent, #2f6f4f);
	flex-grow: 0;
	min-width: 130px;
}

.wpc-add-to-quote {
	background: var(--wpc-accent, #2f6f4f);
	color: #fff;
}

.wpc-preview-open:hover:not(:disabled) {
	background: rgba(47, 111, 79, 0.08);
}

.wpc-add-to-quote:hover:not(:disabled) {
	filter: brightness(1.08);
}

.wpc-add-to-quote:disabled {
	opacity: 0.65;
	cursor: wait;
}

.wpc-quote-hint {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	margin: 0;
	padding: 0.7em 1em;
	border-radius: 999px;
	background: #eef0ee;
	font-size: 0.82em;
	text-align: center;
	color: var(--wpc-muted, #6b6b6b);
}

.wpc-quote-hint__icon {
	flex: 0 0 auto;
	display: flex;
	opacity: 0.75;
}

.wpc-quote-panel__error {
	display: none;
	margin: 0.7em 0 0;
	font-size: 0.88em;
	color: #b3261e;
	text-align: center;
}

/* -------------------------------------------------------- Preview modal */

body.wpc-modal-open {
	overflow: hidden;
}

.wpc-modal {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.wpc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

.wpc-modal__box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 22px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.wpc-modal__title {
	margin: 0 0 14px;
	font-size: 1.15em;
}

.wpc-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: #f1f1f1;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #333;
}

.wpc-modal__close:hover {
	background: #e2e2e2;
}

.wpc-modal__hint {
	margin: 12px 0 16px;
	font-size: 0.82em;
	color: var(--wpc-muted, #6b6b6b);
	text-align: center;
}

.wpc-modal__done {
	display: block;
	width: 100%;
	padding: 0.85em;
	border: 0;
	border-radius: 6px;
	background: var(--wpc-accent, #2f6f4f);
	color: #fff;
	font-weight: 700;
	font-size: 1em;
	cursor: pointer;
}

@media (max-width: 600px) {
	.wpc-actions-row {
		flex-direction: column;
	}

	.wpc-preview-open {
		width: 100%;
	}
}

/* ------------------------------------------------------- Section headings */

.wpc-section-body {
	margin-top: 0.9em;
	display: flex;
	flex-wrap: wrap;
	column-gap: 1.4em;
}

/* A thin divider between, e.g., Size and Colour under one section. */
.wpc-section-body > .wpc-field--half:not(:last-child) {
	padding-right: 1.4em;
	border-right: 1px solid var(--wpc-border);
}

@media (max-width: 480px) {
	.wpc-field--half {
		flex: 1 1 100%;
	}

	.wpc-section-body > .wpc-field--half:not(:last-child) {
		padding-right: 0;
		border-right: 0;
	}
}

/* -------------------------------------------------- Font / Text Style */

/* Font, Text Style, Text Colour and Text Size share one card in a
   compact 2×2 grid, with a thin divider between the two columns —
   the same pattern as "Product Colour and Size" below it. */
.wpc-style-panel {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(16, 24, 17, 0.05);
	padding: 1.15em 1.3em;
}

.wpc-style-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: 1.4em;
	row-gap: 1.3em;
}

.wpc-style-grid--single {
	grid-template-columns: 1fr;
}

.wpc-style-grid .wpc-style-cell:nth-child(odd):not(:last-child) {
	padding-right: 1.4em;
	border-right: 1px solid var(--wpc-border);
}

@media (max-width: 360px) {
	.wpc-style-grid {
		grid-template-columns: 1fr;
	}

	.wpc-style-grid .wpc-style-cell:nth-child(odd):not(:last-child) {
		padding-right: 0;
		border-right: 0;
	}
}

.wpc-style-cell {
	display: flex;
	align-items: flex-start;
	gap: 0.7em;
	min-width: 0;
}

.wpc-style-cell__icon {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(47, 111, 79, 0.12);
	color: var(--wpc-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.95em;
}

.wpc-style-cell__body {
	flex: 1;
	min-width: 0;
}

.wpc-style-cell__title {
	margin: 0 0 0.5em;
	font-size: 0.9em;
	font-weight: 600;
}

.wpc-font-select {
	cursor: pointer;
}

/* Bold / Italic / Underline toggle buttons. */
.wpc-bius {
	display: flex;
	gap: 0.5em;
}

.wpc-bius-btn {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--wpc-border);
	background: #fff;
	border-radius: 8px;
	cursor: pointer;
	color: var(--wpc-muted);
	font-size: 1em;
	line-height: 1;
}

.wpc-bius-btn--b {
	font-weight: 800;
}

.wpc-bius-btn--i {
	font-style: italic;
}

.wpc-bius-btn--u {
	text-decoration: underline;
}

.wpc-bius-btn.is-active {
	background: rgba(47, 111, 79, 0.1);
	border-color: var(--wpc-accent);
	color: var(--wpc-accent);
}

/* Text Colour: a real colour picker dressed up as a compact dropdown —
   a swatch, an invisible <input type="color"> on top of it, and a
   chevron for the dropdown affordance. */
.wpc-color-dropdown {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	height: 38px;
	padding: 0 0.7em;
	border: 1px solid var(--wpc-border);
	border-radius: 8px;
	background: #fff;
}

.wpc-color-dropdown__swatch {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 1px solid var(--wpc-border);
	flex: 0 0 auto;
}

.wpc-color-dropdown__chevron {
	display: flex;
	color: var(--wpc-muted);
	flex: 0 0 auto;
}

.wpc-color-dropdown .wpc-style__color {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	opacity: 0;
	cursor: pointer;
}

/* Text Size: a native dropdown of preset sizes with a "px" suffix. */
.wpc-size-dropdown {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
}

.wpc-size-dropdown .wpc-select {
	min-width: 72px;
}

.wpc-size-dropdown__unit {
	color: var(--wpc-muted);
	font-size: 0.9em;
}
