/* =============================================================
   MARKETING · popup, ribbon, announcement, countdown
   ============================================================= */

/* -----------------------------
 * Announcement bar (sopra topbar)
 * --------------------------- */
.tc-announce {
	background: var(--salviaD);
	color: var(--cream);
	padding: 7px 38px 7px 14px;
	text-align: center;
	position: relative;
	font-family: var(--mono);
	font-size: 10.5px;
	line-height: 1.35;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.tc-announce a { color: inherit; text-decoration: none; }
.tc-announce a:hover { color: var(--gold); }
.tc-announce__close {
	position: absolute; right: 8px; top: 50%;
	transform: translateY(-50%);
	width: 28px; height: 28px;
	border-radius: 50%;
	color: var(--cream);
	font-size: 18px;
	opacity: 0.7;
	transition: opacity 180ms, background 180ms;
}
.tc-announce__close:hover { opacity: 1; background: rgba(253,251,247, 0.15); }
.tc-announce.is-closed { display: none; }

/* -----------------------------
 * Newsletter popup
 * --------------------------- */
.tc-popup {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.tc-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(44, 42, 36, 0.7);
	backdrop-filter: blur(4px);
	animation: tcFadeIn 260ms ease;
}
.tc-popup__card {
	position: relative;
	z-index: 1;
	background: var(--cream);
	border-radius: var(--r-lg);
	padding: 48px 40px;
	max-width: 480px;
	width: 100%;
	text-align: center;
	box-shadow: 0 40px 80px -30px rgba(44,42,36,0.5);
	animation: tcPopIn 360ms cubic-bezier(.2,.7,.2,1);
}
.tc-popup__close {
	position: absolute; top: 14px; right: 14px;
	width: 36px; height: 36px;
	border-radius: 50%;
	background: var(--paper-2);
	font-size: 20px;
	color: var(--ink);
	transition: background 180ms;
}
.tc-popup__close:hover { background: var(--sabbia); }
.tc-popup__tag {
	display: inline-block;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 6px 14px;
	background: var(--gold);
	color: var(--cream);
	border-radius: 999px;
	margin-bottom: 20px;
}
.tc-popup__title {
	font-family: var(--serif);
	font-size: clamp(32px, 4vw, 44px);
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin: 0 0 14px;
	font-weight: 400;
	color: var(--ink);
}
.tc-popup__text {
	font-size: 15px;
	line-height: 1.55;
	color: var(--ink-2);
	margin: 0 0 24px;
}
.tc-popup__form {
	display: flex;
	gap: 8px;
	align-items: center;
	border: 1px solid var(--ink);
	border-radius: 999px;
	padding: 4px 4px 4px 20px;
	margin-bottom: 12px;
}
.tc-popup__form input {
	flex: 1;
	background: transparent;
	border: 0;
	padding: 12px 0;
	font-family: var(--sans);
	font-size: 15px;
	color: var(--ink);
}
.tc-popup__form input:focus { outline: none; }
.tc-popup__form button {
	padding: 10px 22px;
	background: var(--ink);
	color: var(--cream);
	border-radius: 999px;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	transition: background 180ms;
	border: 0;
	cursor: pointer;
}
.tc-popup__form button:hover { background: var(--salviaD); }
.tc-popup__small {
	font-size: 11px;
	color: var(--mute);
	margin: 0;
}
.tc-popup__small a { color: var(--salviaD); text-decoration: underline; }

/* Thank-you: discount code block */
.tc-popup__code {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	background: var(--paper-2);
	border: 2px dashed var(--salviaD);
	border-radius: var(--r-md);
	margin: 20px 0 14px;
}
.tc-popup__code .mono {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mute);
	display: block;
}
.tc-popup__code strong {
	font-family: var(--serif);
	font-size: 28px;
	color: var(--salviaD);
	letter-spacing: 0.02em;
	flex: 1;
	text-align: center;
}
.tc-popup__copy {
	padding: 10px 18px;
	background: var(--ink);
	color: var(--cream);
	border: 0;
	border-radius: 999px;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 180ms;
}
.tc-popup__copy:hover { background: var(--salviaD); }
@media (max-width: 480px) {
	.tc-popup__code { flex-direction: column; align-items: stretch; gap: 10px; }
	.tc-popup__code strong { font-size: 24px; }
}
@media (max-width: 480px) {
	.tc-popup__card { padding: 32px 24px; }
	.tc-popup__form { flex-direction: column; gap: 8px; padding: 8px; border-radius: var(--r-md); }
	.tc-popup__form button { width: 100%; }
}

@keyframes tcFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tcPopIn {
	from { opacity: 0; transform: scale(0.96) translateY(10px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* -----------------------------
 * Side ribbon (flag sticky al bordo)
 * --------------------------- */
.tc-ribbon {
	position: fixed;
	top: 42%;
	z-index: 100;
	display: block;
	margin: 0;
	padding: 0;
}
.tc-ribbon--right { right: 0; left: auto; }
.tc-ribbon--left  { left: 0;  right: auto; }

/* Tab comune */
.tc-ribbon__tab {
	display: block;
	background: var(--salviaD);
	color: var(--cream);
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	border: 0;
	cursor: pointer;
	writing-mode: vertical-rl;
	padding: 22px 12px;
	margin: 0;
	transition: background 180ms, padding 180ms, box-shadow 180ms;
	line-height: 1;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.tc-ribbon__tab:hover,
.tc-ribbon__tab:focus-visible { background: var(--ink); outline: none; }

/* RIGHT: tab aggrappata al bordo destro, rounded a SINISTRA (interno pagina) */
.tc-ribbon--right .tc-ribbon__tab {
	border-radius: 12px 0 0 12px;
	box-shadow: -6px 6px 18px -8px rgba(44,42,36, 0.4);
}
.tc-ribbon--right .tc-ribbon__tab:hover { padding-right: 14px; }

/* LEFT: tab aggrappata al bordo sinistro, rounded a DESTRA (interno pagina) */
.tc-ribbon--left .tc-ribbon__tab {
	border-radius: 0 12px 12px 0;
	box-shadow: 6px 6px 18px -8px rgba(44,42,36, 0.4);
	/* testo naturale top-to-bottom, niente rotate: il border-radius va applicato a livello fisico */
}
.tc-ribbon--left .tc-ribbon__tab:hover { padding-left: 14px; }

.tc-ribbon__panel {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 340px;
	background: var(--cream);
	border: 1px solid var(--line-soft);
	border-radius: var(--r-md);
	padding: 24px;
	z-index: 2;
}
.tc-ribbon--right .tc-ribbon__panel {
	right: calc(100% + 14px);
	left: auto;
	box-shadow: -12px 12px 40px -15px rgba(44,42,36, 0.35);
}
.tc-ribbon--left .tc-ribbon__panel {
	left: calc(100% + 14px);
	right: auto;
	box-shadow: 12px 12px 40px -15px rgba(44,42,36, 0.35);
}
.tc-ribbon__panel[hidden] { display: none; }
.tc-ribbon__close {
	position: absolute; top: 10px; right: 10px;
	width: 28px; height: 28px;
	font-size: 18px;
	color: var(--mute);
	background: transparent;
	border: 0;
	cursor: pointer;
}
.tc-ribbon__close:hover { color: var(--ink); }
.tc-ribbon__title {
	font-family: var(--serif);
	font-size: 22px;
	line-height: 1.2;
	margin: 0 0 10px;
	font-weight: 400;
	color: var(--ink);
}
.tc-ribbon__detail {
	font-size: 13px;
	line-height: 1.5;
	color: var(--ink-2);
	margin: 0 0 14px;
}
.tc-ribbon__cta {
	display: inline-block;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 10px 20px;
	background: var(--ink);
	color: var(--cream);
	border-radius: 999px;
	text-decoration: none;
	transition: background 180ms;
}
.tc-ribbon__cta:hover { background: var(--salviaD); color: var(--cream); }
@media (max-width: 640px) {
	.tc-ribbon { top: auto; bottom: 100px; }
	.tc-ribbon__panel {
		width: min(290px, calc(100vw - 70px));
		top: auto;
		bottom: 0;
		transform: none;
	}
	.tc-ribbon--right .tc-ribbon__panel { right: calc(100% + 10px); bottom: -10px; }
	.tc-ribbon--left  .tc-ribbon__panel { left: calc(100% + 10px); bottom: -10px; }
}

/* -----------------------------
 * Free shipping progress bar
 * --------------------------- */
.tc-shipping-bar {
	position: sticky;
	bottom: 0;
	background: var(--cream);
	border-top: 1px solid var(--line-soft);
	padding: 10px 20px;
	z-index: 50;
	box-shadow: 0 -4px 16px -8px rgba(44,42,36,0.15);
}
.tc-shipping-bar p {
	text-align: center;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink);
	margin: 0 0 6px;
}
.tc-shipping-bar strong { color: var(--salviaD); font-weight: 500; }
.tc-shipping-bar__track {
	height: 4px;
	background: var(--paper-2);
	border-radius: 999px;
	overflow: hidden;
	max-width: 480px;
	margin: 0 auto;
}
.tc-shipping-bar__fill {
	height: 100%;
	background: linear-gradient(90deg, var(--salviaD), var(--gold));
	transition: width 400ms cubic-bezier(.2,.7,.2,1);
}

/* -----------------------------
 * Countdown (ordine in giornata)
 * --------------------------- */
.tc-countdown {
	position: fixed;
	top: 90px;
	right: 20px;
	z-index: 50;
	background: var(--ink);
	color: var(--cream);
	padding: 12px 42px 12px 18px;
	border-radius: var(--r-md);
	box-shadow: 0 8px 24px -10px rgba(44,42,36,0.5);
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	display: flex;
	align-items: center;
	gap: 12px;
	animation: tcSlideIn 400ms var(--ease);
	max-width: 320px;
}
.tc-countdown.is-closed { display: none !important; }
.tc-countdown__text { max-width: 160px; line-height: 1.3; color: color-mix(in oklch, var(--cream) 85%, transparent); }
.tc-countdown__time {
	font-family: var(--serif);
	font-size: 22px;
	letter-spacing: 0;
	color: var(--gold);
	font-variant-numeric: tabular-nums;
	text-transform: none;
}
.tc-countdown__close {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	background: transparent;
	border: 0;
	color: var(--cream);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 180ms;
	border-radius: 50%;
}
.tc-countdown__close:hover { opacity: 1; background: rgba(253,251,247,0.1); }
@keyframes tcSlideIn {
	from { transform: translateX(20px); opacity: 0; }
	to   { transform: translateX(0); opacity: 1; }
}
/* Tablet: più compatto ma ancora visibile, top-right */
@media (max-width: 820px) {
	.tc-countdown {
		top: 70px;
		right: 12px;
		left: auto;
		max-width: calc(100vw - 24px);
		padding: 10px 36px 10px 14px;
		font-size: 10px;
	}
	.tc-countdown__text { max-width: 140px; }
	.tc-countdown__time { font-size: 18px; }
}
/* Mobile piccolo: sparisce del tutto (non deve bloccare il CTA "Aggiungi al carrello") */
@media (max-width: 480px) {
	.tc-countdown { display: none !important; }
}

/* -----------------------------
 * Social proof toast
 * --------------------------- */
.tc-toast {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 50;
	background: var(--cream);
	border: 1px solid var(--line-soft);
	border-radius: var(--r-md);
	padding: 14px 18px 14px 16px;
	box-shadow: 0 12px 32px -12px rgba(44,42,36,0.25);
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 320px;
	animation: tcSlideUp 400ms var(--ease);
}
.tc-toast__icon {
	width: 36px; height: 36px;
	border-radius: 50%;
	background: var(--salvia);
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
}
.tc-toast__body { font-size: 12px; line-height: 1.4; color: var(--ink); }
.tc-toast__body strong { color: var(--salviaD); font-weight: 500; }
.tc-toast__body small { display: block; color: var(--mute); font-size: 10px; margin-top: 2px; }
@keyframes tcSlideUp {
	from { transform: translateY(20px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}
@media (max-width: 640px) {
	.tc-toast { left: 12px; right: 12px; max-width: none; bottom: 12px; }
}

/* -----------------------------
 * Trust badges strip
 * --------------------------- */
.tc-trust {
	padding: 28px 0;
	background: var(--paper-2);
	border-top: 1px dashed var(--line-soft);
	border-bottom: 1px dashed var(--line-soft);
}
.tc-trust__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}
.tc-trust__item {
	text-align: center;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink);
}
@media (max-width: 820px) { .tc-trust__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tc-trust__grid { grid-template-columns: 1fr; } }
