/**
 * themefour-Extra Product Options-addon — front-end styles.
 *
 * Deliberately minimal: EPO keeps its own look; we only add the wrapper,
 * the hidden-totals behaviour, the admin notice and the editor placeholder.
 * Everything is scoped to .themefour-epo-addon* so nothing leaks.
 */

/* ---------- Wrapper ---------- */
.themefour-epo-addon {
	--themefour-epo-addon-radius: 14px;
	position: relative;
	display: block;
	min-width: 0;
}

.themefour-epo-addon .tc-extra-product-options {
	margin-bottom: 0;
}

/* "Fields only" layout: the totals box must stay in the DOM (EPO reads its
   hidden inputs), so it is hidden visually instead of being removed. */
.themefour-epo-addon__totals--hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
}

/* ---------- Admin-only notice ---------- */
.themefour-epo-addon-notice {
	margin: 0 0 1em;
	padding: 12px 16px;
	border: 1px solid #f0c36d;
	border-inline-start-width: 4px;
	border-radius: 10px;
	background: #fff8e5;
	color: #4a3b12;
	font-size: 14px;
	line-height: 1.7;
}

.themefour-epo-addon-notice small {
	display: block;
	opacity: .7;
}

/* ---------- Elementor editor placeholder ---------- */
.themefour-epo-addon-placeholder {
	--ph-accent: #6d5dfc;
	--ph-bg: linear-gradient(135deg, rgba(109, 93, 252, .08), rgba(34, 211, 238, .06));
	padding: 18px 20px;
	border: 1px dashed color-mix(in srgb, var(--ph-accent) 45%, transparent);
	border-radius: 16px;
	background: var(--ph-bg);
	color: #1f2033;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.7;
}

.themefour-epo-addon-placeholder--warning {
	--ph-accent: #e09b17;
	--ph-bg: linear-gradient(135deg, rgba(224, 155, 23, .09), rgba(255, 255, 255, 0));
}

.themefour-epo-addon-placeholder--error {
	--ph-accent: #e5484d;
	--ph-bg: linear-gradient(135deg, rgba(229, 72, 77, .09), rgba(255, 255, 255, 0));
}

.themefour-epo-addon-placeholder__head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.themefour-epo-addon-placeholder__icon {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--ph-accent) 14%, #fff);
	color: var(--ph-accent);
}

.themefour-epo-addon-placeholder__badge {
	margin-inline-start: auto;
	padding: 2px 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--ph-accent) 14%, #fff);
	color: var(--ph-accent);
	font-size: 12px;
	font-weight: 600;
}

.themefour-epo-addon-placeholder__msg {
	margin: 10px 0 8px;
}

.themefour-epo-addon-placeholder__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0 0 12px;
	font-size: 12.5px;
}

.themefour-epo-addon-placeholder__meta div {
	display: flex;
	gap: 6px;
}

.themefour-epo-addon-placeholder__meta dt {
	opacity: .6;
}

.themefour-epo-addon-placeholder__meta dd {
	margin: 0;
	font-weight: 600;
}

.themefour-epo-addon-placeholder__skeleton {
	display: grid;
	gap: 8px;
}

.themefour-epo-addon-placeholder__skeleton i {
	display: block;
	height: 38px;
	border-radius: 10px;
	background: linear-gradient(90deg, rgba(0, 0, 0, .05) 25%, rgba(0, 0, 0, .09) 37%, rgba(0, 0, 0, .05) 63%);
	background-size: 400% 100%;
	animation: themefour-epo-addon-shimmer 1.6s ease infinite;
}

.themefour-epo-addon-placeholder__skeleton i:nth-child(2) {
	width: 72%;
}

.themefour-epo-addon-placeholder__skeleton i:nth-child(3) {
	width: 48%;
}

@keyframes themefour-epo-addon-shimmer {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
	.themefour-epo-addon-placeholder__skeleton i {
		animation: none;
	}
}

/* ---------- Required-option errors (added by frontend.js) ---------- */
.themefour-epo-addon .themefour-epo-addon__invalid {
	border-radius: 10px;
	box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.35);
	transition: box-shadow 0.2s ease;
}

.themefour-epo-addon .themefour-epo-addon__error {
	display: block;
	margin-top: 4px;
	color: #d92d20;
	font-size: 0.875em;
}

/* ---------- Several widgets for one product (since 1.1.0) ---------- */

/* A widget that received no form and no totals box (added by frontend.js). */
.themefour-epo-addon.themefour-epo-addon--empty,
.elementor-widget-themefour-epo-addon.themefour-epo-addon-widget--empty {
	display: none !important;
}

/* Clones wait here, hidden from EPO's start-up scan, until EPO begins.
   EPO keeps its containers invisible until then anyway; this only
   neutralises the flex layout EPO gives the helper class. */
.themefour-epo-addon__pending {
	display: block !important;
}

/* Every slot is a full EPO container: keep spacing consistent. */
.themefour-epo-addon--slot .tc-extra-product-options {
	margin-bottom: 0;
}

/* ---------- Narrow columns (since 1.1.2) ----------
   In Elementor flex containers a widget without an explicit width shrinks
   to its content. Option lists wrap to their container, so the widget must
   take the column's width; Elementor's own "Width" setting still overrides
   this (its selectors are more specific). */
.elementor-widget-themefour-epo-addon {
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.themefour-epo-addon {
	width: 100%;
	max-width: 100%;
	min-width: 0;
}
