/* ============================================================================
   cartellino-skin.css — pelle del tema «Cartellino» (spec restyling 2026-09-23 §4.2)
   Caricato DOPO app.css di ciascuna app: ciò che i token non esprimono (bordi 2 px,
   ombre piene, il cartellino del prezzo, il timbro) e le classi `ct-*` riusabili.
   Solo Web e MAUI; Management non lo carica.
   ========================================================================== */

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  background-color: var(--paper);
  background-size: 6px 6px;          /* --bg-pattern è un puntinato: senza size sarebbe un'unica sfumatura */
}
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.02em; }
::selection { background: var(--tag); color: var(--tag-ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
/* FocusOnNavigate di Blazor porta il fuoco sul titolo (tabindex="-1") a ogni navigazione: è un
   aiuto per i lettori di schermo, non un comando da evidenziare. Sul box il titolo compariva
   incorniciato di arancione già prima del tema. */
h1:focus, [tabindex="-1"]:focus { outline: none; }

/* L'icona del ThemeToggle ha colori scritti in linea (viola/ambra) che il componente condivide con
   Management: qui li si riporta all'inchiostro solo per Web e MAUI. */
.theme-toggle-btn i { color: var(--ink) !important; }

/* ── Contenitori principali: bordo d'inchiostro e ombra piena ─────────────── */
.card, .deal-card, .travel-card, .voucher-card, .property-card, .vehicle-card,
.favorite-card, .filter-card, .ct-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
}
@media (hover: hover) {
  .deal-card, .travel-card, .voucher-card, .property-card, .vehicle-card, .ct-card--lift {
    transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
  }
  .deal-card:hover, .travel-card:hover, .voucher-card:hover, .property-card:hover,
  .vehicle-card:hover, .ct-card--lift:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hard-lg);
  }
}

/* Bordo a scontrino sotto un contenitore (usa il colore di fondo del contenitore) */
.ct-receipt-edge { position: relative; }
.ct-receipt-edge::after {
  content: ''; position: absolute; left: -2px; right: -2px; bottom: -9px; height: 9px;
  background:
    linear-gradient(-45deg, transparent 5px, var(--surface) 5px) 0 0 / 10px 9px,
    linear-gradient(45deg, transparent 5px, var(--surface) 5px) 0 0 / 10px 9px;
}

/* ── Il cartellino del prezzo ─────────────────────────────────────────────── */
.ct-price-tag {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--tag); color: var(--tag-ink);
  border: 2px solid var(--ink);
  padding: 3px 10px 3px 17px;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%);
  transform: rotate(-3deg);
  font-family: var(--font-sans); line-height: 1;
}
.ct-price-tag::before {           /* il foro */
  content: ''; position: absolute; left: 6px; top: 50%;
  width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink);
}
.ct-price-tag__now { font-weight: 900; font-size: 22px; letter-spacing: -0.03em; }
.ct-price-tag__was { font-family: var(--font-mono); font-size: 11px; text-decoration: line-through; opacity: 0.75; }
.ct-price-tag--sm .ct-price-tag__now { font-size: 17px; }
.ct-price-tag--lg .ct-price-tag__now { font-size: 34px; }
.ct-price-tag.is-sold { background: var(--surface-sunk); color: var(--ink-muted); }

/* ── Il timbro ────────────────────────────────────────────────────────────── */
.ct-stamp {
  position: absolute; z-index: 3; left: 50%; bottom: 10px;
  transform: translateX(-50%) rotate(-10deg);
  font-family: var(--font-sans); font-weight: 900; font-size: 20px; letter-spacing: 0.16em;
  text-transform: uppercase; white-space: nowrap;
  color: var(--danger);
  border: 3px double var(--danger); border-radius: 6px;
  padding: 3px 12px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  pointer-events: none;
}
.ct-stamp__note { display: block; font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: 0.08em; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .ct-stamp { animation: ct-stamp-in 0.35s var(--ease-spring) both; }
  @keyframes ct-stamp-in { from { transform: translateX(-50%) rotate(-10deg) scale(1.6); opacity: 0; } }
}

/* ── Nastrino, pillole, schede segmentate ─────────────────────────────────── */
.ct-ribbon {
  position: absolute; top: 8px; left: 0; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px 3px 7px;
  clip-path: polygon(0 0, 100% 0, 88% 50%, 100% 100%, 0 100%);
}
.ct-ribbon--error { background: var(--danger); color: var(--on-danger); }
.ct-ribbon--flash { background: var(--brand); color: var(--on-brand); }

.ct-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  font-family: var(--font-mono); font-size: 12px; white-space: nowrap;
  padding: 5px 12px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink);
  cursor: pointer;
}
.ct-chip.is-on { background: var(--ink); color: var(--tag); }
.ct-chip--danger.is-on { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
@media (max-width: 639.98px) { .ct-chip { min-height: 44px; } }

.ct-seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--surface); }
.ct-seg > button, .ct-seg > a {
  padding: 7px 14px; font-weight: 700; font-size: 13px; color: var(--ink);
  background: none; border: 0; border-right: 1.5px solid var(--ink); cursor: pointer; text-decoration: none;
}
.ct-seg > :last-child { border-right: 0; }
.ct-seg > .is-on { background: var(--ink); color: var(--tag); }
/* Scuro: l'inchiostro diventa crema e il giallo sopra scendeva a 1,37:1. La voce attiva diventa il
   cartellino stesso (giallo, testo scuro), come nel binario. */
html[data-theme="dark"] .ct-chip.is-on:not(.ct-chip--danger),
html[data-theme="dark"] .ct-seg > .is-on { background: var(--tag); color: var(--tag-ink); border-color: var(--tag); }

/* ── Bottoni ──────────────────────────────────────────────────────────────── */
.ct-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 8px 16px; border-radius: 9px; border: 2px solid var(--ink);
  font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
}
.ct-btn--brand { background: var(--brand); color: var(--on-brand); }
.ct-btn--ghost { background: var(--surface); color: var(--ink); }
.ct-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-primary {
  background: var(--brand); color: var(--on-brand);
  border: 2px solid var(--ink); box-shadow: var(--shadow-hard-sm);
}
.btn-primary:hover { background: var(--brand-hover); color: var(--on-brand); }
/* «btn-accent» (34 usi negli stati vuoti e di errore) non aveva nessuna regola: il browser lo
   disegnava come un bottone di sistema grigio. Prende la forma del bottone principale. */
.btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 8px 16px; border-radius: 9px; cursor: pointer; font-weight: 700;
  background: var(--brand); color: var(--on-brand);
  border: 2px solid var(--ink); box-shadow: var(--shadow-hard-sm);
}
.btn-accent:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-accent:active { transform: translate(2px, 2px); box-shadow: none; }

/* ── Stato vuoto delle liste ───────────────────────────────────────────────── */
/* EmptyState è condiviso con Management, che non carica questo foglio: lì resta com'era. Qui prende
   il bordo d'inchiostro tratteggiato (un «cartellino vuoto») invece del riquadro grigio arrotondato. */
.empty-state {
  background: var(--surface);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: none;
  padding: 40px 20px;
}
.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--tag); color: var(--tag-ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
  font-size: 1.75rem;
  margin-bottom: 18px;
}
.empty-state-title { color: var(--ink); font-weight: 800; }
.empty-state-action { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ── Segnali «live» ───────────────────────────────────────────────────────── */
.ct-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--danger);
}
.ct-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .ct-live-dot { animation: ct-pulse 1.4s ease-in-out infinite; }
  @keyframes ct-pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
}

/* ── Testo sugli accenti (revisione del 23-09) ───────────────────────────────── */
/* Home: sui fondi rosso-errore l'inchiostro arrivava a 3,6:1 in chiaro. --on-danger è bianco in chiaro
   e scuro in scuro; sul verde del risparmio il #0f1a12 scritto a mano scendeva a 3,4:1. */
.rd .rd-pill:not(.save):not(.coupon), .rd-feat-badge, .rd-feat-cta, .rd-tab.on.t-error .cnt,
.rd-tag.hot, .rd-m-feat-badge { color: var(--on-danger); }
.rd .rd-pill.save { color: var(--on-save); }

/* Tema scuro: gli accenti diventano chiari (arancio, verde, rosso, azzurro) e il testo bianco che i fogli
   esistenti ci scrivono sopra scende a 2,3-3,1:1. Qui diventa inchiostro scuro. Elenco generato dalle
   regole con `color: white|#fff` su `background` d'accento in unified-theme, components e layouts. */
html[data-theme="dark"] :is(
  .btn-danger,
  .badge-price-error,
  .badge-discount,
  .btn-deal,
  .btn-travel,
  .badge-exclusive,
  .btn-copy,
  .btn-voucher,
  .filter-btn.active,
  .badge-type.badge-deal,
  .badge-type.badge-travel,
  .badge-price-dropped,
  .btn-favorite-action:not(.btn-favorite-action--sold),
  .filter-btn.price-dropped.active,
  .destination-card .price-badge,
  .btn-property,
  .btn-vehicle,
  .cg-chip--filter.is-active,
  .cg-vibe.is-active,
  .cg-vibe--toggle.is-active,
  .cg-tab.is-active,
  .cg-cta,
  .store-detail-section-count,
  .logo-icon,
  .menu-logo i
) { color: #16130d; }
