/**
 * WooCancel — scoped front-end styles for the [woocancel] cancel page.
 * Everything is nested under .woocancel so it can never leak into the host theme.
 * Theme-agnostic: inherits the theme font + accent; only neutral structure and
 * status colours are hard-coded. Keep it small.
 */
.woocancel {
	/* Accent adapts to the host site automatically: Elementor global colours → block-theme
	   preset → neutral fallback. woocancel.js refines this to the theme's actual link colour. */
	--wc-accent: var(--e-global-color-accent, var(--e-global-color-primary, var(--wp--preset--color--primary, #2b6cb0)));
	--wc-danger: #b3261e;
	--wc-danger-bg: #fdecea;
	--wc-danger-text: #5c1813;
	--wc-success: #1e7d34;
	--wc-success-bg: #e9f6ec;
	--wc-success-text: #14532d;
	--wc-info: #0b5cad;
	--wc-info-bg: #e7f1fb;
	--wc-info-text: #0b3b6f;
	--wc-warn: #b26a00;
	--wc-warn-bg: #fff4e5;
	--wc-warn-text: #6b3b00;
	--wc-border: #d8dadc;
	--wc-radius: 8px;
	--wc-gap: 16px;
	--wc-gap-sm: 8px;
	--wc-maxw: 560px;
	--wc-fs: 16px;
	--wc-tap: 44px;
	max-width: var(--wc-maxw);
	margin-inline: auto;
	/* Font is inherited from the theme; structure + size are WooCancel's. */
	font: inherit;
	font-size: var(--wc-fs);
	line-height: 1.5;
	color: #1d2327;
	/* One consistent card for every state (lookup, order view, list, notices…). */
	background: #fff;
	border: 1px solid var(--wc-border);
	border-radius: var(--wc-radius);
	padding: 28px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.woocancel > * + * { margin-top: var(--wc-gap); }
.woocancel h2 { margin: 0 0 4px; font-size: 1.4em; }

/* ---- content sections (inside the single card) ---- */
.woocancel-order > * + *,
.woocancel-myorders > * + * { margin-top: var(--wc-gap); }

/* ---- breadcrumb / back ---- */
.woocancel-breadcrumb { font-size: .85em; margin-bottom: 12px; }
.woocancel-back { margin-top: var(--wc-gap); }

/* ---- items list ---- */
.woocancel-items { list-style: none; margin: 0; padding: 0; }
.woocancel-items li {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: var(--wc-gap-sm);
	padding-block: 10px;
	border-bottom: 1px solid var(--wc-border);
}
.woocancel-item-name { font-weight: 500; }
.woocancel-price { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.woocancel-price small { color: #646970; font-weight: 400; }
.woocancel-qty-field { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.woocancel-qty { width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.woocancel-qty-max { color: #646970; }

/* ---- order total ---- */
.woocancel-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	border-top: 2px solid var(--wc-border);
	padding-top: var(--wc-gap-sm);
	font-weight: 600;
}
.woocancel-amount { font-size: 1.15em; font-variant-numeric: tabular-nums; }

/* ---- controls ---- */
.woocancel input,
.woocancel select,
.woocancel button {
	font: inherit;
	font-size: var(--wc-fs);
	min-height: var(--wc-tap);
}
.woocancel input[type="email"],
.woocancel input[type="text"],
.woocancel input[type="number"],
.woocancel select {
	padding: 8px 10px;
	border: 1px solid var(--wc-border);
	border-radius: 6px;
	background: #fff;
	max-width: 100%;
}
.woocancel input:focus-visible,
.woocancel select:focus-visible,
.woocancel button:focus-visible,
.woocancel a:focus-visible {
	outline: 2px solid var(--wc-accent);
	outline-offset: 2px;
}
.woocancel label { display: inline-flex; flex-direction: column; gap: 4px; }
.woocancel-reason { display: block; }
.woocancel-reason select { width: 100%; max-width: 22rem; }
.woocancel-reason-other { margin-top: var(--wc-gap-sm); width: 100%; max-width: 22rem; }
.woocancel .description { color: #646970; font-size: .9em; }

/* ---- buttons (scoped + !important on the primary so the theme can't flatten the main CTA) ---- */
.woocancel-actions { display: flex; flex-wrap: wrap; gap: var(--wc-gap); margin-top: var(--wc-gap); }
.woocancel .woocancel-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	min-height: var(--wc-tap);
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: none;
}
.woocancel .woocancel-btn--primary {
	background: var(--wc-accent) !important;
	color: #fff !important;
	border-color: var(--wc-accent) !important;
}
.woocancel .woocancel-btn--primary:hover { filter: brightness(.94); }
.woocancel .woocancel-btn--danger { background: #fff; color: var(--wc-danger); border-color: var(--wc-danger); font-weight: 500; }
.woocancel .woocancel-btn--danger:hover { background: var(--wc-danger-bg); }
.woocancel .woocancel-btn--ghost { background: transparent; color: var(--wc-accent); border-color: var(--wc-border); }
.woocancel .woocancel-btn[aria-disabled="true"],
.woocancel .woocancel-btn:disabled { opacity: .6; cursor: progress; }
.woocancel-form[aria-busy="true"] { cursor: progress; }

/* ---- notices ---- */
.woocancel-notice {
	display: flex;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 6px;
	border-left: 4px solid;
}
.woocancel-notice::before { font-weight: 700; flex: 0 0 auto; }
.woocancel-error   { background: var(--wc-danger-bg);  border-color: var(--wc-danger);  color: var(--wc-danger-text); }
.woocancel-error::before   { content: "!"; }
.woocancel-success { background: var(--wc-success-bg); border-color: var(--wc-success); color: var(--wc-success-text); }
.woocancel-success::before { content: "\2713"; } /* ✓ */
.woocancel-info    { background: var(--wc-info-bg);    border-color: var(--wc-info);    color: var(--wc-info-text); }
.woocancel-info::before    { content: "i"; font-style: italic; }
.woocancel-warning { background: var(--wc-warn-bg);    border-color: var(--wc-warn);    color: var(--wc-warn-text); }
.woocancel-warning::before { content: "!"; }
.woocancel-notice:focus-visible { outline: 2px solid var(--wc-accent); outline-offset: 2px; }

/* ---- my-account order list ---- */
.woocancel-orderlist { list-style: none; margin: 0; padding: 0; }
.woocancel-orderlist li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: var(--wc-gap-sm);
	padding-block: 10px;
	border-bottom: 1px solid var(--wc-border);
}

/* ---- language picker (top bar, every screen) ---- */
.woocancel-topbar { display: flex; justify-content: flex-end; margin: 0 0 var(--wc-gap); }
.woocancel-langpicker { position: relative; display: inline-block; }
.woocancel-langpicker > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid #e6e8eb; border-radius: 9px; background: #fff; font-size: 14px; font-weight: 600; color: #1d2327; }
.woocancel-langpicker > summary::-webkit-details-marker { display: none; }
.woocancel-langpicker > summary:hover { border-color: #c7ccd2; }
.woocancel-langpicker > summary:focus-visible { outline: 3px solid #bcd6ff; outline-offset: 2px; }
.woocancel-chev { transition: transform .15s ease; color: #5b6470; }
.woocancel-langpicker[open] .woocancel-chev { transform: rotate(180deg); }
.woocancel-flag { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); vertical-align: middle; flex: none; }
.woocancel-langmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; box-shadow: 0 12px 34px rgba(20,30,50,.14); padding: 6px; max-height: 360px; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; min-width: 260px; }
.woocancel-langitem { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: #1d2327; font-size: 14px; white-space: nowrap; }
.woocancel-langitem:hover { background: #f2f4f7; }
.woocancel-langitem.is-active { background: #eef6ff; font-weight: 700; }
@media (max-width: 520px) { .woocancel-langmenu { grid-template-columns: 1fr; min-width: 200px; } }

/* ---- contact block ---- */
.woocancel-contact { margin-top: var(--wc-gap); }

/* visually-hidden helper (only if the theme lacks one) */
.woocancel .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	clip: rect(0 0 0 0); clip-path: inset(50%);
	overflow: hidden; white-space: nowrap;
}

/* ---- mobile ---- */
@media (max-width: 480px) {
	.woocancel { padding: 18px; }
	.woocancel-items li { grid-template-columns: 1fr; align-items: start; }
	.woocancel-price { text-align: left; }
	.woocancel-actions { flex-direction: column; }
	.woocancel-actions .woocancel-btn { width: 100%; }
	.woocancel-orderlist li { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
	.woocancel *, .woocancel *::before { transition: none !important; animation: none !important; }
}
