/* ORIENS — welcome popup + points programme.
   Loaded on every front-end page; the points blocks only ever render inside
   WooCommerce templates, so their rules simply go unused elsewhere. */

/* =========================================================================
   Welcome popup
   ====================================================================== */

.oriens-welcome[hidden] { display: none !important; }

.oriens-welcome {
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ow-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(21, 23, 27, 0.62);
	opacity: 0;
	transition: opacity 0.5s var(--ease, ease);
}

.ow-dialog {
	position: relative;
	display: grid;
	grid-template-columns: 46% 54%;
	width: min(920px, 100%);
	max-height: calc(100vh - 48px);
	background: var(--bg, #f6f3ec);
	box-shadow: 0 40px 120px -40px rgba(21, 23, 27, 0.6);
	overflow: hidden;
	opacity: 0;
	transform: translateY(18px) scale(0.985);
	transition: opacity 0.6s var(--ease, ease), transform 0.6s var(--ease, ease);
}

.oriens-welcome.is-open .ow-backdrop { opacity: 1; }
.oriens-welcome.is-open .ow-dialog { opacity: 1; transform: none; }

.ow-media {
	background-size: cover;
	background-position: center;
	min-height: 420px;
}

.ow-body {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0;
	padding: 48px 46px;
	overflow-y: auto;
}

.ow-brand {
	font-family: var(--font-serif, Georgia, serif);
	font-size: 15px;
	letter-spacing: 0.42em;
	text-transform: uppercase;
	color: var(--ink, #15171b);
	margin-bottom: 26px;
}

.ow-eyebrow {
	margin: 0 0 4px;
	font-family: var(--font-serif, Georgia, serif);
	font-size: 22px;
	line-height: 1.3;
	color: var(--ink-soft, #43474e);
}

.ow-headline {
	margin: 0;
	font-family: var(--font-serif, Georgia, serif);
	font-size: clamp(46px, 6vw, 72px);
	line-height: 1.02;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--ink, #15171b);
	/* Cormorant defaults to old-style figures, which turns "15%" into "I5%"
	   at this size. The discount has to read as a number at a glance. */
	font-variant-numeric: lining-nums;
	font-feature-settings: "lnum" 1;
}

.ow-headline-sm { font-size: clamp(34px, 4.4vw, 50px); }

.ow-sub {
	margin: 2px 0 0;
	font-family: var(--font-serif, Georgia, serif);
	font-size: clamp(24px, 2.6vw, 32px);
	line-height: 1.2;
	color: var(--ink, #15171b);
}

.ow-copy {
	margin: 18px 0 0;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 14px;
	line-height: 1.65;
	color: var(--ink-soft, #43474e);
	max-width: 34em;
}

.ow-form { margin: 24px 0 0; }
.ow-hp { position: absolute; left: -9999px; }

.ow-form input[type="email"] {
	width: 100%;
	padding: 15px 16px;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 14px;
	color: var(--ink, #15171b);
	background: transparent;
	border: 1px solid var(--ink, #15171b);
	border-radius: 0;
	outline-offset: 2px;
}

.ow-form input[type="email"]::placeholder { color: var(--ink-mute, #7c7f86); }

/* The browser default focus ring is bright blue — visible, but wrong against
   this palette. Keep the same weight, in the brand's gold. */
.ow-form input[type="email"]:focus-visible,
.opp-form input[type="number"]:focus-visible {
	outline: 2px solid var(--gold-deep, #96793f);
}

.ow-submit:focus-visible,
.ow-dismiss:focus-visible,
.ow-close:focus-visible,
.ow-code:focus-visible,
.opp-apply:focus-visible,
.opp-clear:focus-visible {
	outline: 2px solid var(--gold-deep, #96793f);
	outline-offset: 2px;
}

.ow-submit {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 15px 16px;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 13px;
	letter-spacing: 0.06em;
	text-align: center;
	color: #fff;
	background: var(--ink, #15171b);
	border: 1px solid var(--ink, #15171b);
	border-radius: 0;
	cursor: pointer;
	transition: background 0.35s var(--ease, ease), color 0.35s var(--ease, ease);
}

.ow-submit:hover { background: var(--gold-deep, #96793f); border-color: var(--gold-deep, #96793f); color: #fff; }
.ow-submit[disabled] { opacity: 0.55; cursor: default; }
a.ow-shop { text-decoration: none; }

.ow-error {
	margin: 10px 0 0;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 12.5px;
	color: var(--danger, #a4442f);
}

.ow-dismiss {
	display: block;
	margin: 18px auto 0;
	padding: 0;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 13.5px;
	color: var(--ink-soft, #43474e);
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	cursor: pointer;
}

.ow-dismiss:hover { color: var(--ink, #15171b); }

.ow-foot {
	margin: 20px 0 0;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 11.5px;
	color: var(--ink-mute, #7c7f86);
}

.ow-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	background: none;
	border: 0;
	cursor: pointer;
	color: var(--ink, #15171b);
	z-index: 2;
}

.ow-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.ow-close:hover { color: var(--gold-deep, #96793f); }

/* Claimed state ---------------------------------------------------------- */

.ow-code {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	width: 100%;
	margin: 22px 0 0;
	padding: 16px;
	background: rgba(185, 153, 92, 0.09);
	border: 1px dashed var(--gold, #b9995c);
	cursor: pointer;
}

.ow-code-value {
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 21px;
	letter-spacing: 0.18em;
	color: var(--ink, #15171b);
}

.ow-code-hint {
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-mute, #7c7f86);
}

.ow-code.is-copied { border-style: solid; }

@media (max-width: 860px) {
	.oriens-welcome { padding: 0; align-items: flex-end; }
	.ow-dialog {
		grid-template-columns: 1fr;
		/* 上面是图，下面是内容；第二行 minmax(0,1fr) 才允许它被压缩，
		   否则 grid 子项撑到内容高度，max-height 形同虚设，底部
		   「Unsubscribe anytime.」会被切掉且滚不到。 */
		grid-template-rows: auto minmax(0, 1fr);
		width: 100%;
		max-width: 100%;
		max-height: 92svh;
	}
	.ow-media { min-height: 140px; }
	.ow-body {
		min-height: 0;          /* 让 overflow-y:auto 真正生效 */
		overflow-y: auto;
		padding: 28px 22px 30px;
	}
	.ow-brand { margin-bottom: 14px; }
	.ow-headline { font-size: clamp(38px, 11vw, 52px); }
	.ow-eyebrow { font-size: 19px; }
	.ow-copy { margin-top: 14px; }
	.ow-form { margin-top: 18px; }
	.ow-foot { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.ow-backdrop, .ow-dialog { transition: none; }
}

/* Recall button — the closed-but-unspent offer, parked in .float-stack ----- */

.ow-recall[hidden] { display: none !important; }

.ow-recall {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	/* Matches .float-btn so it queues with WhatsApp and back-to-top. */
	width: 50px;
	height: 50px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--gold, #b9995c);
	/* Ink on gold measures 6.7:1; white on the same gold is only 2.7:1 and
	   fails WCAG AA at this size. */
	color: var(--ink, #15171b);
	box-shadow: 0 12px 28px -10px rgba(21, 23, 27, 0.5);
	cursor: pointer;
	transition: background 0.3s var(--ease, ease), transform 0.3s var(--ease, ease);
}

.ow-recall:hover { background: var(--gold-pale, #e4d5b4); transform: translateY(-3px); }
.ow-recall:focus-visible { outline: 2px solid var(--ink, #15171b); outline-offset: 3px; }

.ow-recall-num {
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	font-variant-numeric: lining-nums;
}

.ow-recall-word {
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 9px;
	letter-spacing: 0.12em;
	line-height: 1;
}

/* Standalone by default; .in-stack is added once JS has parked it in
   .float-stack, where the stack's own flex layout takes over. */
.ow-recall {
	position: fixed;
	right: 22px;
	bottom: 26px;
	z-index: 700;
}

.ow-recall.in-stack { position: static; right: auto; bottom: auto; }

@media (prefers-reduced-motion: reduce) {
	.ow-recall { transition: none; }
	.ow-recall:hover { transform: none; }
}

/* =========================================================================
   Points — cart panel
   ====================================================================== */

.oriens-points-panel {
	margin: 0 0 22px;
	padding: 20px 22px;
	background: var(--bg-soft, #efeade);
	border: 1px solid var(--line, #e3dccd);
}

.opp-lead {
	margin: 0 0 8px;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 11.5px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gold-deep, #96793f);
}

.opp-balance {
	margin: 0 0 12px;
	font-family: var(--font-serif, Georgia, serif);
	font-size: 20px;
	line-height: 1.35;
	color: var(--ink, #15171b);
}

.opp-balance .amount { font-family: inherit; }

.opp-note {
	margin: 10px 0 0;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 12.5px;
	line-height: 1.6;
	color: var(--ink-soft, #43474e);
}

.opp-note a { color: var(--gold-deep, #96793f); }
.opp-earn { color: var(--ink-mute, #7c7f86); }

.opp-form {
	display: flex;
	gap: 8px;
	align-items: stretch;
	margin: 0;
	flex-wrap: wrap;
}

.opp-form input[type="number"] {
	flex: 1 1 120px;
	min-width: 0;
	padding: 11px 12px;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 14px;
	background: #fff;
	border: 1px solid var(--line, #e3dccd);
	border-radius: 0;
}

.opp-apply,
.opp-clear {
	padding: 11px 20px;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	background: var(--ink, #15171b);
	border: 1px solid var(--ink, #15171b);
	border-radius: 0;
	cursor: pointer;
	transition: background 0.3s var(--ease, ease);
}

.opp-apply:hover,
.opp-clear:hover { background: var(--gold-deep, #96793f); border-color: var(--gold-deep, #96793f); }

.opp-clear {
	color: var(--ink, #15171b);
	background: transparent;
}

.opp-clear:hover { color: #fff; }
.opp-applied { margin-top: 0; }

/* =========================================================================
   Points — My Account
   ====================================================================== */

.oriens-points-account .opa-balance {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 0;
}

.opa-number {
	font-family: var(--font-serif, Georgia, serif);
	font-size: clamp(44px, 6vw, 64px);
	line-height: 1;
	color: var(--ink, #15171b);
}

.opa-label {
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ink-mute, #7c7f86);
}

.opa-worth,
.opa-rule,
.opa-empty {
	margin: 10px 0 0;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 13.5px;
	color: var(--ink-soft, #43474e);
}

.opa-rule { color: var(--ink-mute, #7c7f86); font-size: 12.5px; }

.opa-history {
	width: 100%;
	margin: 28px 0 0;
	border-collapse: collapse;
	font-family: var(--font-sans, Arial, sans-serif);
	font-size: 13px;
}

.opa-history th,
.opa-history td {
	padding: 12px 10px;
	text-align: left;
	border-bottom: 1px solid var(--line, #e3dccd);
}

.opa-history th {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-mute, #7c7f86);
	font-weight: 400;
}

.opa-history td.is-up { color: var(--gold-deep, #96793f); }
.opa-history td.is-down { color: var(--danger, #a4442f); }
.opa-history th:last-child,
.opa-history td:last-child,
.opa-history th:nth-child(3),
.opa-history td:nth-child(3) { text-align: right; }

@media (max-width: 600px) {
	.opa-history th:nth-child(2),
	.opa-history td:nth-child(2) { max-width: 40vw; }
}
