/* SGAMLY – pagina offerta (cartellino prezzo, storico, barra mobile)
 * I colori vengono dal tema (variabili in style.css), così la pagina resta coerente col resto del sito. */

.sg-offerta,
.sg-sticky {
	--sg-tag: #FFD84D;
	--sg-tag-ink: #16213D;
	--sg-display: "Bricolage Grotesque", var(--font);
}

.sg-offerta { padding-bottom: 12px; }

/* Barra superiore */
.sg-offerta .sg-topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 20px; margin-bottom: 16px; }
.sg-offerta .sg-topbar .breadcrumbs { padding-top: 0; }
.sg-offerta .sg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-offerta .sg-action {
	display: inline-flex; align-items: center; gap: 6px; margin: 0;
	padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
	background: var(--card); color: var(--text);
	font: 600 .85rem/1.2 var(--font); cursor: pointer;
}
.sg-offerta .sg-action:hover { border-color: var(--muted); color: var(--text); }
.sg-offerta .sg-action svg { width: 16px; height: 16px; flex: none; }

/* Scheda */
.sg-offerta .sg-offer { display: grid; grid-template-columns: 1fr; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 860px) { .sg-offerta .sg-offer { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }

.sg-offerta .sg-offer__media { position: relative; display: flex; align-items: center; justify-content: center; min-height: 260px; padding: 28px; background: #fff; }
.sg-offerta .sg-offer__media img { max-height: 420px; width: auto; object-fit: contain; margin: 0 auto; }
.sg-offerta .sg-ph { font-size: 5rem; }
.sg-offerta .sg-badge { position: absolute; top: 14px; left: 14px; z-index: 1; padding: 6px 11px; border-radius: 999px; font: 800 .8rem/1.2 var(--font); background: var(--accent); color: #fff; }
.sg-offerta .sg-badge--low { background: var(--ok); color: #04200f; }
.sg-offerta .sg-badge--alt { background: var(--accent-2); color: #1a1300; }
.sg-offerta .expired .sg-offer__media img { filter: grayscale(1); opacity: .6; }

.sg-offerta .sg-offer__body { padding: 26px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.sg-offerta .sg-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: .875rem; color: var(--muted); }
.sg-offerta .sg-meta a:hover { color: var(--accent); }
.sg-offerta .sg-store { font-weight: 700; color: var(--text); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.sg-offerta .sg-meta time { display: inline-flex; align-items: center; gap: 5px; }

.sg-offerta .sg-title { margin: 0; font: 700 clamp(1.4rem, 3vw, 2rem)/1.2 var(--sg-display); letter-spacing: -.01em; max-width: 34ch; }

/* Cartellino prezzo */
.sg-offerta .sg-price { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.sg-offerta .sg-price__tag {
	position: relative; display: inline-flex; align-items: baseline; gap: 2px;
	padding: 10px 22px 10px 30px; background: var(--sg-tag); color: var(--sg-tag-ink);
	font: 800 2.4rem/1 var(--sg-display); letter-spacing: -.02em;
	clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 50%);
}
.sg-offerta .sg-price__tag::before { content: ""; position: absolute; left: 12px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--card); }
.sg-offerta .sg-price__tag small { font-size: 1.2rem; font-weight: 700; }
.sg-offerta .sg-price__old { display: flex; flex-direction: column; line-height: 1.3; }
.sg-offerta .sg-price__old del { color: var(--muted); font-size: 1.05rem; }
.sg-offerta .sg-price__save { color: var(--accent); font-weight: 700; font-size: .95rem; }

.sg-offerta .notice { margin: 0; }

/* Bottoni */
.sg-offerta .sg-cta,
.sg-sticky .sg-cta {
	display: flex; align-items: center; justify-content: center;
	padding: 16px 22px; border-radius: 999px; border: 0;
	background: var(--accent); color: #fff;
	font: 800 1.05rem/1.2 var(--font); text-align: center;
	transition: transform .15s ease, box-shadow .15s ease;
}
.sg-offerta .sg-cta:hover, .sg-sticky .sg-cta:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(255, 61, 110, .35); }
.sg-offerta .sg-cta-note { margin: -8px 0 0; font-size: .8rem; color: var(--muted); }
.sg-offerta .sg-tg { align-self: stretch; }
@media (min-width: 860px) {
	.sg-offerta .sg-cta, .sg-offerta .sg-tg { align-self: flex-start; min-width: 300px; }
}

.sg-offerta .sg-admin-warning { margin: 20px 0 0; padding: 10px 14px; border: 2px dashed var(--accent-2); border-radius: 10px; color: var(--muted); font-size: .9rem; }

/* Sezioni */
.sg-offerta .sg-section { margin: 20px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.sg-offerta .sg-section > summary,
.sg-offerta .sg-section > h2 {
	display: flex; justify-content: space-between; align-items: center;
	margin: 0; padding: 18px 24px; color: var(--text);
	font: 700 1.15rem/1.3 var(--sg-display); list-style: none; cursor: pointer;
}
.sg-offerta .sg-section > h2 { cursor: default; }
.sg-offerta .sg-section > summary::-webkit-details-marker { display: none; }
.sg-offerta .sg-section > summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
.sg-offerta .sg-section[open] > summary::after { transform: rotate(-135deg); }
.sg-offerta .sg-section__body { padding: 0 24px 22px; max-width: 75ch; }
.sg-offerta .sg-section__body > *:last-child { margin-bottom: 0; }

/* Storico prezzo */
.sg-offerta .sg-history { padding: 0 24px 22px; }
.sg-offerta .sg-history__chart { overflow-x: auto; }
.sg-offerta .sg-history svg { display: block; width: 100%; min-width: 480px; height: auto; }
.sg-offerta .sg-grid-lines line { stroke: var(--line); stroke-width: 1; }
.sg-offerta .sg-axis-text text { fill: var(--muted); font: 11px var(--font); }
.sg-offerta .sg-line { fill: none; stroke: var(--sg-tag); stroke-width: 2.5; stroke-linejoin: round; }
.sg-offerta .sg-dot { fill: var(--accent); }
.sg-offerta .sg-history__stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.sg-offerta .sg-history__stats strong { color: var(--text); }

/* Disclaimer */
.sg-offerta .sg-disclaimer { margin: 24px 0 0; padding: 14px 18px; border-left: 4px solid var(--sg-tag); background: var(--bg-2); border-radius: 0 10px 10px 0; font-size: .82rem; color: var(--muted); }

/* Barra fissa mobile */
.sg-sticky {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
	background: var(--bg-2); border-top: 1px solid var(--line); color: var(--text);
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	transform: translateY(110%); transition: transform .25s;
}
.sg-sticky.is-visible { transform: none; }
.sg-sticky b { font: 800 1.3rem var(--sg-display); }
.sg-sticky del { font-size: .85rem; color: var(--muted); margin-left: 6px; }
.sg-sticky .sg-cta { padding: 12px 18px; font-size: .95rem; }
@media (min-width: 860px) { .sg-sticky { display: none; } }

.sg-offerta :focus-visible, .sg-sticky :focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sg-offerta *, .sg-sticky, .sg-sticky * { transition: none !important; } }

/* ---------- Coupon ---------- */
.sg-coupon .sg-price__tag--long { font-size: 1.5rem; padding-top: 14px; padding-bottom: 14px; }
.sg-coupon .sg-price__save { color: var(--text); }
.sg-coupon .sg-coupon__scad { color: var(--muted); font-size: .9rem; }
.sg-coupon .sg-coupon__code { margin: 0; max-width: 460px; border-width: 2px; }
.sg-coupon .sg-coupon__code .code { padding: 16px; font-size: 1.25rem; }
.sg-coupon .sg-coupon__code button { padding: 0 22px; font-size: 1rem; }
.sg-coupon .sg-offer__media .sg-ph { font-size: 6rem; }
