/* Blocs éditoriaux WeGeek. Chargé seulement sur les pages qui les utilisent, et dans l'éditeur. */

.wg-price, .wg-quick {
	margin-block: 2em;
	border: 1px solid var(--line, #ddd7eb);
	border-radius: var(--radius, 12px);
	background: var(--bg, #fff);
	color: var(--ink, #171321);
	font-family: var(--font, Manrope, system-ui, sans-serif);
	font-size: 16px;
	line-height: 1.5;
}
.wg-price p, .wg-quick p, .wg-price ul, .wg-quick dl { margin: 0; padding: 0; }
.wg-price li::before, .wg-quick li::before { content: none !important; }

.wg-kicker { color: var(--link, #6435e8); font-size: 13px; line-height: 19px; font-weight: 800; }

.wg-block-empty {
	padding: 16px 20px;
	border: 1px dashed #6435e8;
	border-radius: 8px;
	color: #625d70;
	font: 600 14px/1.5 Manrope, system-ui, sans-serif;
}

/* Prix et disponibilité */

.wg-price { overflow: hidden; }
.wg-price-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--line, #ddd7eb);
	background: var(--surface, #f7f5fc);
}
.wg-price-head .wg-kicker { width: 100%; }
.wg-price-product { font-size: 21px; line-height: 27px; font-weight: 800; letter-spacing: -.015em; }
.wg-pill {
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--violet, #6435e8);
	color: #fff;
	font-size: 12px;
	line-height: 18px;
	font-weight: 800;
}

.wg-price-grid { display: grid; }
.wg-price-cell { display: grid; gap: 6px; align-content: start; padding: 18px 20px; }
.wg-price-cell + .wg-price-cell { border-top: 1px solid var(--line, #ddd7eb); }
.wg-price-label { color: var(--muted, #625d70); font-size: 13px; line-height: 19px; font-weight: 700; }
.wg-price-value { font-size: 20px; line-height: 26px; font-weight: 800; letter-spacing: -.015em; }

.wg-countdown {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--link, #6435e8);
	font-size: 14px;
	font-weight: 800;
}
.wg-countdown::before {
	content: "";
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--violet, #6435e8);
	box-shadow: 0 0 0 3px var(--tag-bg, #ede7ff);
}

.wg-price-list { list-style: none; display: grid; gap: 6px; }
.wg-price-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-size: 15px; }
.wg-price-list span { color: var(--muted, #625d70); font-weight: 600; }
.wg-price-list strong { font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }

.wg-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.wg-chips li { margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--surface, #f7f5fc); font-size: 14px; font-weight: 600; }

.wg-price-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	padding: 16px 20px;
	border-top: 1px solid var(--line, #ddd7eb);
}
.wg-price-foot .button,
.wg-price .button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 18px;
	border-radius: 8px;
	background: var(--violet, #6435e8);
	color: #fff !important;
	font-weight: 700;
	text-decoration: none !important;
}
.wg-price .button:hover { background: var(--violet-hover, #5126c5); }
.wg-price .button .icon { width: 18px; height: 18px; }
.wg-note { color: var(--muted, #625d70); font-size: 12px; line-height: 17px; font-weight: 500; }

@media (min-width: 768px) {
	.wg-price-grid { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
	.wg-price-cell + .wg-price-cell { border-top: 0; border-left: 1px solid var(--line, #ddd7eb); }
}

/* Fiche rapide */

.wg-quick { display: grid; gap: 16px; padding: 18px; }
.wg-quick-media {
	display: grid;
	place-items: center;
	width: 100%;
	max-width: 180px;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 8px;
	background: var(--surface, #f7f5fc);
}
.wg-quick-media img { width: 100%; height: 100%; object-fit: contain; border-radius: 0 !important; }
.wg-quick-body { display: grid; gap: 4px; align-content: start; min-width: 0; }
.wg-quick-name { font-size: 20px; line-height: 26px; font-weight: 800; letter-spacing: -.015em; }

.wg-quick-specs { display: grid; gap: 0 20px; margin-top: 10px !important; }
.wg-quick-specs > div { display: flex; justify-content: space-between; gap: 12px; padding-block: 7px; border-bottom: 1px solid var(--line, #ddd7eb); font-size: 14px; line-height: 20px; }
.wg-quick-specs dt { color: var(--muted, #625d70); font-weight: 600; }
.wg-quick-specs dd { margin: 0; font-weight: 700; text-align: right; }

.wg-quick-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.wg-quick-price { font-size: 14px; color: var(--muted, #625d70); font-weight: 600; }
.wg-quick-price strong { color: var(--ink, #171321); font-size: 20px; font-weight: 800; }

.wg-quick-review, .wg-quick-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 6px 16px 6px 6px;
	border-radius: 999px;
	background: var(--tag-bg, #ede7ff);
	color: var(--tag-fg, #6435e8) !important;
	font-size: 15px;
	font-weight: 800;
	text-decoration: none !important;
}
.wg-quick-link { padding: 10px 16px; }
.wg-quick-review:hover, .wg-quick-link:hover { background: var(--violet, #6435e8); color: #fff !important; }
.wg-quick-review .seal { position: static; width: 40px; height: 40px; transform: rotate(-10deg); filter: none; --seal-text: transparent; }
.wg-quick-review strong { margin-left: 6px; }
.wg-quick-review small { font-size: 11px; opacity: .75; }
.wg-quick-link .icon { width: 16px; height: 16px; }

@media (min-width: 600px) {
	.wg-quick { grid-template-columns: 160px minmax(0, 1fr); gap: 22px; padding: 20px; }
	.wg-quick--text { grid-template-columns: minmax(0, 1fr); }
	.wg-quick-specs { grid-template-columns: 1fr 1fr; }
}

/* Chiffres clés */

.wg-stats { margin-block: 2em; padding: 20px; border-radius: var(--radius, 12px); background: var(--tag-bg, #ede7ff); color: var(--ink, #171321); font-family: var(--font, Manrope, system-ui, sans-serif); }
.wg-stats p, .wg-stats dl { margin: 0; }
.wg-stats .wg-kicker { margin-bottom: 12px; }
.wg-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.wg-stats-grid--1 { grid-template-columns: 1fr; }
/* Le chiffre s'affiche au-dessus de son libellé (dt reste en premier pour les lecteurs d'écran). */
.wg-stats-grid > div { display: grid; align-content: start; }
.wg-stats-grid dd { order: -1; }
.wg-stats-grid dt:empty { display: none; }
.wg-stats-grid dd { margin: 0; color: var(--violet, #6435e8); font-size: 34px; line-height: 38px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.wg-stats-grid dt { margin-top: 6px; font-size: 14px; line-height: 20px; font-weight: 600; }
.wg-stats .wg-note { margin-top: 14px; }

.wg-stats--dark { background: var(--night, #171321); color: #f3f1f8; }
.wg-stats--dark .wg-kicker { color: #cbbcff; }
.wg-stats--dark .wg-stats-grid dd { color: #fff; }
.wg-stats--dark .wg-stats-grid dt, .wg-stats--dark .wg-note { color: #b4aec4; }
[data-theme="dark"] .wg-stats:not(.wg-stats--dark) .wg-stats-grid dd { color: var(--link, #b49dff); }

@media (min-width: 768px) {
	.wg-stats { padding: 24px 28px; }
	.wg-stats-grid { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
	.wg-stats-grid > div + div { padding-left: 20px; border-left: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
	.wg-stats-grid dd { font-size: 44px; line-height: 48px; }
}

/* Bon plan */

.wg-deal {
	margin-block: 2em;
	overflow: hidden;
	border: 2px solid var(--violet, #6435e8);
	border-radius: var(--radius, 12px);
	background: var(--bg, #fff);
	color: var(--ink, #171321);
	font-family: var(--font, Manrope, system-ui, sans-serif);
	font-size: 16px;
	line-height: 1.5;
}
.wg-deal p, .wg-deal ul { margin: 0; padding: 0; }
.wg-deal li::before { content: none !important; }

.wg-deal-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
	padding: 10px 18px;
	background: var(--violet, #6435e8);
	color: #fff;
}
.wg-deal-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.wg-deal-kicker .icon { width: 18px; height: 18px; }
.wg-deal-until { font-size: 13px; font-weight: 600; opacity: .9; }
.wg-deal-ended { display: none; padding: 2px 10px; border-radius: 999px; background: #fff; color: #171321; font-size: 12px; font-weight: 800; }

.wg-deal-product { display: flex; align-items: center; gap: 14px; padding: 16px 18px 4px; }
.wg-deal-product img { flex: none; width: 64px; height: 64px; border-radius: 8px !important; object-fit: contain; background: var(--surface, #f7f5fc); }
.wg-deal-name { font-size: 19px; line-height: 25px; font-weight: 800; letter-spacing: -.015em; }

.wg-deal-offers { list-style: none; display: grid; gap: 10px; padding: 14px 18px 4px !important; }
.wg-deal-offer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px 16px;
	margin: 0 !important;
	padding: 12px 14px;
	border: 1px solid var(--line, #ddd7eb);
	border-radius: 10px;
}
.wg-deal-offer.is-best { border-color: var(--violet, #6435e8); background: color-mix(in srgb, var(--tag-bg, #ede7ff) 45%, transparent); }

.wg-deal-merchant { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.wg-deal-merchant img { width: auto; height: 28px; max-width: 120px; object-fit: contain; border-radius: 0 !important; }
[data-theme="dark"] .wg-deal-merchant img { padding: 3px 6px; border-radius: 6px !important; background: #fff; }
.wg-deal-merchant-name { font-size: 16px; font-weight: 800; }
.wg-deal-best { padding: 2px 8px; border-radius: 999px; background: var(--violet, #6435e8); color: #fff; font-size: 11px; line-height: 16px; font-weight: 800; }

.wg-deal-price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 4px 8px; }
.wg-deal-price strong { font-size: 22px; line-height: 26px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.wg-deal-price del { color: var(--muted, #625d70); font-size: 14px; white-space: nowrap; }
.wg-deal-discount { padding: 1px 7px; border-radius: 6px; background: var(--success, #167044); color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; }

.wg-deal-code {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	justify-self: start;
	min-height: 40px;
	padding: 6px 12px;
	border: 1.5px dashed var(--violet, #6435e8);
	border-radius: 8px;
	background: transparent;
	color: var(--ink, #171321);
	font: 800 15px/1 var(--font, Manrope, system-ui, sans-serif);
	letter-spacing: .04em;
	cursor: pointer;
}
.wg-deal-code:hover { background: var(--tag-bg, #ede7ff); }
.wg-deal-code-label { color: var(--muted, #625d70); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.wg-deal-code .icon { width: 16px; height: 16px; color: var(--link, #6435e8); }

.wg-deal .wg-deal-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	grid-column: 1 / -1;
	min-height: 46px;
	padding: 10px 18px;
	border-radius: 8px;
	background: var(--violet, #6435e8);
	color: #fff !important;
	font-size: 16px;
	font-weight: 800;
	text-decoration: none !important;
}
.wg-deal .wg-deal-btn:hover { background: var(--violet-hover, #5126c5); }
.wg-deal .wg-deal-btn .icon { width: 18px; height: 18px; }
.wg-deal-offer:not(.is-best) .wg-deal-btn { background: var(--ink, #171321); }
.wg-deal-offers:has(> :only-child) .wg-deal-btn,
.wg-deal-offer:not(.is-best) .wg-deal-btn:hover { background: var(--violet, #6435e8); }
.wg-deal .wg-note { padding: 10px 18px 14px; }

.wg-deal.is-expired { border-color: var(--line, #ddd7eb); }
.wg-deal.is-expired .wg-deal-head { background: var(--muted, #625d70); }
.wg-deal.is-expired .wg-deal-until { display: none; }
.wg-deal.is-expired .wg-deal-ended { display: inline-block; }
.wg-deal.is-expired .wg-deal-offers { opacity: .55; }
.wg-deal.is-expired .wg-deal-btn { background: var(--disabled-bg, #e3dfeb) !important; color: var(--muted, #625d70) !important; pointer-events: none; }
.wg-deal.is-expired .wg-deal-code { pointer-events: none; }

/* Petit écran : marchand sur sa ligne, puis prix, code et bouton. */
@media (max-width: 639px) {
	.wg-deal-merchant { grid-column: 1 / -1; }
	.wg-deal-price { justify-content: flex-start; }
}
@media (min-width: 640px) {
	.wg-deal-offer { grid-template-columns: minmax(120px, 1fr) auto auto auto; gap: 12px 18px; }
	.wg-deal-offer:not(:has(.wg-deal-code)) { grid-template-columns: minmax(120px, 1fr) auto auto; }
	.wg-deal .wg-deal-btn { grid-column: auto; min-width: 150px; }
}

/* Cours de bourse */

.wg-stock {
	margin-block: 2em;
	border: 1px solid var(--line, #ddd7eb);
	border-radius: var(--radius, 12px);
	background: var(--bg, #fff);
	color: var(--ink, #171321);
	font-family: var(--font, Manrope, system-ui, sans-serif);
	font-size: 16px;
	line-height: 1.5;
	overflow: hidden;
}
.wg-stock p, .wg-stock dl, .wg-stock dd { margin: 0; padding: 0; }

.wg-stock-move { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-stock-move.is-up { color: var(--success, #167044); }
.wg-stock-move.is-down { color: var(--error, #b42318); }
.wg-stock-move.is-flat { color: var(--muted, #625d70); }
.wg-stock-move.is-up::before, .wg-stock-move.is-down::before {
	content: "";
	display: inline-block;
	width: 9px;
	height: 7px;
	margin-right: 5px;
	vertical-align: .1em;
	background: currentColor;
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.wg-stock-move.is-down::before { clip-path: polygon(0 0, 100% 0, 50% 100%); }

.wg-stock-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 12px 20px;
	border-bottom: 1px solid var(--line, #ddd7eb);
	background: var(--surface, #f7f5fc);
}
.wg-stock-head .wg-kicker { display: inline-flex; align-items: center; gap: 8px; }
.wg-stock-head .wg-kicker .icon { width: 18px; height: 18px; }
.wg-stock-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted, #625d70); font-size: 13px; line-height: 19px; font-weight: 600; }
.wg-stock.is-open .wg-stock-status::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--success, #167044);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--success, #167044) 22%, transparent);
}

.wg-stock-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px 20px;
	padding: 18px 20px;
}
.wg-stock-name { font-size: 21px; line-height: 27px; font-weight: 800; letter-spacing: -.015em; }
.wg-stock-ticker { color: var(--muted, #625d70); font-size: 13px; line-height: 19px; font-weight: 700; letter-spacing: .02em; }
.wg-stock-quote { text-align: right; }
.wg-stock-price { font-size: 30px; line-height: 34px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-stock-quote .wg-stock-move { margin-top: 2px; font-size: 15px; }
.wg-stock-abs { margin-left: 4px; font-weight: 600; }

.wg-stock-chart { grid-column: 1 / -1; grid-row: 2; display: grid; gap: 4px; min-width: 0; color: var(--muted, #625d70); }
.wg-stock-chart[hidden] { display: none; }
.wg-stock-chart.is-up { color: var(--success, #167044); }
.wg-stock-chart.is-down { color: var(--error, #b42318); }
.wg-stock-chart-label { color: var(--muted, #625d70); font-size: 12px; line-height: 16px; font-weight: 700; }
.wg-stock-chart-label .wg-stock-move { margin-left: 4px; }
.wg-stock-plot { position: relative; height: 64px; }
.wg-stock-spark { display: block; width: 100%; height: 100%; overflow: visible; }
.wg-stock-dot {
	position: absolute;
	right: 0;
	width: 9px;
	height: 9px;
	margin: -4.5px -4.5px 0 0;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 3px var(--bg, #fff), 0 0 0 5px color-mix(in srgb, currentColor 30%, transparent);
}
.wg-stock-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wg-stock-area { fill: currentColor; opacity: .1; }

.wg-stock-perf { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line, #ddd7eb); }
.wg-stock-perf > div { display: grid; align-content: start; gap: 2px; padding: 12px 20px; }
.wg-stock-perf > div[hidden] { display: none; }
.wg-stock-perf > div + div { border-left: 1px solid var(--line, #ddd7eb); }
.wg-stock-perf > div:nth-child(3):not(:only-child) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line, #ddd7eb); }
.wg-stock-perf > div:only-child { grid-column: 1 / -1; }
.wg-stock-perf dt { color: var(--muted, #625d70); font-size: 13px; line-height: 19px; font-weight: 600; }
.wg-stock-perf dd[data-f="range"] { font-size: 15px; }
.wg-stock-perf dd { font-size: 17px; line-height: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.wg-stock .wg-note { padding: 10px 20px 14px; border-top: 1px solid var(--line, #ddd7eb); }

.wg-stock.is-loading .wg-stock-main { min-height: 150px; }
.wg-stock.is-loading .wg-stock-perf { display: none; }

@media (min-width: 640px) {
	.wg-stock-main { grid-template-columns: minmax(0, 1fr) minmax(120px, 200px) auto; gap: 24px; padding: 20px 24px; }
	.wg-stock-main { grid-template-columns: minmax(0, 1fr) minmax(140px, 220px) auto; }
	.wg-stock-chart { grid-column: auto; grid-row: auto; }
	.wg-stock-plot { height: 52px; }
	.wg-stock-head, .wg-stock-perf > div, .wg-stock .wg-note { padding-inline: 24px; }
	.wg-stock-perf { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
	.wg-stock-perf > div:nth-child(3):not(:only-child) { grid-column: auto; border-top: 0; border-left: 1px solid var(--line, #ddd7eb); }
	.wg-stock-perf > div:only-child { grid-column: auto; }
	.wg-stock.is-loading .wg-stock-main { min-height: 96px; }
}

/* Version compacte : une ligne entre deux paragraphes */

.wg-stock--compact {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 6px 12px;
	padding: 10px 16px;
	border-radius: var(--radius-sm, 8px);
	background: var(--surface, #f7f5fc);
	font-size: 15px;
	line-height: 22px;
}
.wg-stock--compact .wg-stock-badge { display: inline-flex; padding: 5px; border-radius: 6px; background: var(--tag-bg, #ede7ff); color: var(--link, #6435e8); }
.wg-stock--compact .wg-stock-badge .icon { width: 16px; height: 16px; }
.wg-stock--compact .wg-stock-id { display: flex; flex-direction: column; min-width: 0; }
.wg-stock--compact .wg-stock-name { font-size: 15px; line-height: 21px; }
.wg-stock--compact .wg-stock-ticker { font-size: 12px; line-height: 17px; }
.wg-stock--compact .wg-stock-quote { display: flex; flex-direction: column; align-items: flex-end; }
.wg-stock--compact .wg-stock-price { font-size: 17px; line-height: 22px; letter-spacing: -.02em; }
.wg-stock--compact .wg-stock-quote .wg-stock-move { font-size: 14px; line-height: 19px; }
.wg-stock--compact .wg-stock-since { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line, #ddd7eb); color: var(--muted, #625d70); font-size: 13px; font-weight: 600; text-align: right; }
.wg-stock--compact .wg-stock-since[hidden] { display: none; }
.wg-stock--compact.is-loading .wg-stock-price:empty::after { content: "…"; }
@media (min-width: 640px) {
	.wg-stock--compact { display: flex; flex-wrap: wrap; gap: 4px 14px; }
	.wg-stock--compact .wg-stock-id { flex-direction: row; align-items: baseline; gap: 10px; }
	.wg-stock--compact .wg-stock-quote { flex-direction: row; align-items: baseline; gap: 10px; margin-left: auto; }
	.wg-stock--compact .wg-stock-since { padding: 0 0 0 14px; border-top: 0; border-left: 1px solid var(--line, #ddd7eb); text-align: left; }
}
