/* Paradigm Product Add-ons: product page. Picks up Elementor kit colours/fonts when the theme defines them. */
.ppa {
	--ppa-accent: var(--e-global-color-accent, #d70073);
	--ppa-ink: var(--e-global-color-primary, #121212);
	--ppa-text: var(--e-global-color-text, #2a2a2a);
	--ppa-muted: #6b6b6b;
	--ppa-line: #d4d4d4;
	--ppa-soft: #ebebeb;
	--ppa-panel: #f7f7f7;
	--ppa-tint: color-mix(in srgb, var(--ppa-accent) 5%, #fff);
	--ppa-ring: color-mix(in srgb, var(--ppa-accent) 20%, transparent);
	--ppa-radius: 8px;
	container-type: inline-size;
	margin: 1.5em 0 1.25em;
	width: 100%;
	font-size: 15px;
	line-height: 1.55;
	color: var(--ppa-text);
}
.ppa *, .ppa *::before, .ppa *::after { box-sizing: border-box; }
.ppa-field { margin: 0 0 18px; }
.ppa-field[hidden] { display: none !important; }

/* Section headings */
.ppa .ppa-heading {
	margin: 32px 0 16px;
	padding: 0 0 10px;
	border-bottom: 1px solid var(--ppa-soft);
	font-family: var(--e-global-typography-primary-font-family), sans-serif;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ppa-ink);
}
.ppa > .ppa-type-heading:first-child .ppa-heading { margin-top: 4px; }
.ppa-type-heading .ppa-desc { margin: -6px 0 0; }

/* Labels and help text */
.ppa .ppa-label { display: block; margin: 0 0 6px; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--ppa-ink); }
.ppa .required { margin-left: 2px; color: var(--ppa-accent); text-decoration: none; border: 0; }
.ppa-desc { margin: -2px 0 8px; font-size: 13px; line-height: 1.55; color: var(--ppa-muted); }
.ppa-desc p { margin: 0 0 4px; }
.ppa-desc p:last-child { margin-bottom: 0; }

/* Text inputs, selects, textareas */
.ppa input.ppa-in:not([type=checkbox], [type=radio]),
.ppa select.ppa-in,
.ppa textarea.ppa-in {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--ppa-line);
	border-radius: var(--ppa-radius);
	background-color: #fff;
	box-shadow: none;
	color: var(--ppa-ink);
	font: inherit;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	line-height: 1.4;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.ppa select.ppa-in {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 42px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px;
	cursor: pointer;
}
.ppa textarea.ppa-in { min-height: 110px; resize: vertical; line-height: 1.5; }
.ppa .ppa-in::placeholder { color: #9a9a9a; opacity: 1; }
.ppa input.ppa-in:not([type=checkbox], [type=radio]):hover,
.ppa select.ppa-in:hover,
.ppa textarea.ppa-in:hover { border-color: #b3b3b3; }
.ppa input.ppa-in:not([type=checkbox], [type=radio]):focus,
.ppa select.ppa-in:focus,
.ppa textarea.ppa-in:focus { outline: none; border-color: var(--ppa-accent); box-shadow: 0 0 0 3px var(--ppa-ring); }
.ppa .ppa-in:user-invalid { border-color: #c62828; }
.ppa input.ppa-qty { max-width: 140px; }

/* Checkboxes and radios */
.ppa input.ppa-in[type=checkbox],
.ppa input.ppa-in[type=radio] { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ppa-accent); cursor: pointer; }
.ppa-choices { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.ppa .ppa-choice { display: inline-flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 15px; font-weight: 400; line-height: 1.45; color: var(--ppa-text); cursor: pointer; }

/* Agreement: one bordered row that lights up once ticked */
.ppa-terms { max-height: 180px; overflow: auto; margin: 0 0 10px; padding: 10px 14px; border: 1px solid var(--ppa-soft); border-radius: var(--ppa-radius); background: var(--ppa-panel); }
.ppa-type-agreement .ppa-choice { display: flex; width: 100%; padding: 13px 16px; border: 1px solid var(--ppa-line); border-radius: var(--ppa-radius); background: #fff; transition: border-color .15s ease, background-color .15s ease; }
.ppa-type-agreement .ppa-choice:hover { border-color: #b3b3b3; }
.ppa-type-agreement .ppa-choice:has(input:checked) { border-color: var(--ppa-accent); background: var(--ppa-tint); }

/* Linked products (extras added as their own cart lines) */
.ppa-type-linked { margin-bottom: 12px; }
.ppa-linked {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) auto;
	gap: 4px 16px;
	align-items: center;
	padding: 14px 16px;
	border: 1px solid var(--ppa-line);
	border-radius: 12px;
	background: #fff;
	transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.ppa-linked:hover { border-color: #b3b3b3; }
.ppa-linked.is-selected { border-color: var(--ppa-accent); background: var(--ppa-tint); box-shadow: inset 0 0 0 1px var(--ppa-accent); }
.ppa-thumb { display: block; align-self: start; }
.ppa-thumb img { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--ppa-panel); }
.ppa-linked .ppa-label { margin: 0 0 3px; font-size: 15px; }
.ppa-linked .ppa-desc { margin: 0 0 6px; }
.ppa-linked-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; font-size: 13px; }
.ppa-linked-price { font-size: 15px; font-weight: 700; color: var(--ppa-ink); }
.ppa-linked-price small { font-size: 12px; font-weight: 400; color: var(--ppa-muted); }
.ppa .ppa-linked-meta a { color: var(--ppa-accent); text-decoration: none; }
.ppa .ppa-linked-meta a:hover { text-decoration: underline; }
.ppa-linked-control { text-align: right; white-space: nowrap; }

/* "Add" toggle */
.ppa .ppa-linked-control .ppa-choice { align-items: center; gap: 8px; padding: 8px 16px 8px 12px; border: 1px solid var(--ppa-line); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 600; color: var(--ppa-ink); transition: border-color .15s ease, color .15s ease; }
.ppa .ppa-linked-control .ppa-choice:hover { border-color: var(--ppa-accent); }
.ppa .ppa-linked-control .ppa-choice input { margin: 0; }
.ppa .ppa-linked.is-selected .ppa-linked-control .ppa-choice { border-color: var(--ppa-accent); color: var(--ppa-accent); }

/* Quantity pickers */
.ppa select.ppa-link { display: inline-block; width: auto; min-width: 76px; min-height: 42px; padding: 8px 34px 8px 14px; background-position: right 10px center; background-size: 14px; }
.ppa .ppa-qty-label { display: block; margin: 0 0 4px; font-size: 12px; font-weight: 400; color: var(--ppa-muted); text-align: left; }
.ppa-sizes { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.ppa-size { display: inline-flex; align-items: center; gap: 8px; }
.ppa-size label { margin: 0; font-size: 14px; font-weight: 600; color: var(--ppa-ink); }
/* Variation pickers (sizes) sit on their own row so the description keeps its width */
.ppa-linked:has(.ppa-sizes) { grid-template-columns: 72px minmax(0, 1fr); }
.ppa-linked:has(.ppa-sizes) .ppa-linked-control { grid-column: 2; margin-top: 8px; text-align: left; }

/* Running total */
.ppa-totals { margin: 24px 0 20px; padding: 14px 18px; border-radius: 12px; background: var(--ppa-panel); }
.ppa-total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--ppa-muted); }
.ppa-total-row strong { font-weight: 600; color: var(--ppa-ink); }
.ppa-total-row + .ppa-total-row { margin-top: 6px; padding-top: 8px; border-top: 1px solid #e3e3e3; }
.ppa-grand { font-size: 16px; font-weight: 600; color: var(--ppa-ink); }
.ppa .ppa-grand strong { font-family: var(--e-global-typography-primary-font-family), sans-serif; font-size: 22px; font-weight: 700; }

@container (max-width: 460px) {
	.ppa-linked, .ppa-linked:has(.ppa-sizes) { grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; padding: 12px; }
	.ppa-thumb img { width: 56px; height: 56px; }
	.ppa-linked-control { grid-column: 2; margin-top: 8px; text-align: left; }
	.ppa-linked:has(.ppa-sizes) .ppa-linked-control { grid-column: 1 / -1; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--ppa-soft); }
	.ppa-sizes { gap: 8px 14px; }
	.ppa select.ppa-link { min-width: 66px; padding-right: 30px; background-position: right 9px center; }
}

/* Match the theme's variation dropdowns to the fields below them on products that use add-ons */
.woocommerce div.product form.cart:has(.ppa) table.variations select {
	min-height: 46px;
	border: 1px solid #d4d4d4;
	border-radius: 8px;
	background-color: #fff;
	color: #121212;
	font-size: 16px;
}
