/* Tabelle legali leggibili senza overflow sui telefoni. */
@media (max-width: 600px) {
  .legal-table {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .legal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .legal-table tbody,
  .legal-table tr {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .legal-table tbody tr {
    margin: var(--space-md) 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: white;
  }

  .legal-table td {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: minmax(6rem, 34%) minmax(0, 1fr);
    gap: var(--space-sm);
    width: auto;
    min-width: 0;
    padding: var(--space-sm);
    overflow-wrap: anywhere;
    word-break: break-word;
    border-bottom: 1px solid var(--color-border);
  }

  .legal-table td::before {
    color: var(--color-primary);
    font-weight: 600;
  }

  .legal-table td:last-child {
    border-bottom: 0;
  }

  .legal-table tbody tr:hover td {
    background: transparent;
  }

  html[lang="it"] .legal-table td:nth-child(1)::before { content: "Cookie"; }
  html[lang="it"] .legal-table td:nth-child(2)::before { content: "Tipologia"; }
  html[lang="it"] .legal-table td:nth-child(3)::before { content: "Finalità"; }
  html[lang="it"] .legal-table td:nth-child(4)::before { content: "Durata"; }

  html[lang="en"] .legal-table td:nth-child(1)::before { content: "Cookie"; }
  html[lang="en"] .legal-table td:nth-child(2)::before { content: "Type"; }
  html[lang="en"] .legal-table td:nth-child(3)::before { content: "Purpose"; }
  html[lang="en"] .legal-table td:nth-child(4)::before { content: "Duration"; }

  html[lang="de"] .legal-table td:nth-child(1)::before { content: "Cookie"; }
  html[lang="de"] .legal-table td:nth-child(2)::before { content: "Typ"; }
  html[lang="de"] .legal-table td:nth-child(3)::before { content: "Zweck"; }
  html[lang="de"] .legal-table td:nth-child(4)::before { content: "Dauer"; }

  html[lang="fr"] .legal-table td:nth-child(1)::before { content: "Cookie"; }
  html[lang="fr"] .legal-table td:nth-child(2)::before { content: "Type"; }
  html[lang="fr"] .legal-table td:nth-child(3)::before { content: "Finalité"; }
  html[lang="fr"] .legal-table td:nth-child(4)::before { content: "Durée"; }

  html[lang="es"] .legal-table td:nth-child(1)::before { content: "Cookie"; }
  html[lang="es"] .legal-table td:nth-child(2)::before { content: "Tipo"; }
  html[lang="es"] .legal-table td:nth-child(3)::before { content: "Finalidad"; }
  html[lang="es"] .legal-table td:nth-child(4)::before { content: "Duración"; }

  html[lang="zh"] .legal-table td:nth-child(1)::before { content: "Cookie"; }
  html[lang="zh"] .legal-table td:nth-child(2)::before { content: "类型"; }
  html[lang="zh"] .legal-table td:nth-child(3)::before { content: "用途"; }
  html[lang="zh"] .legal-table td:nth-child(4)::before { content: "持续时间"; }

  html[lang="ja"] .legal-table td:nth-child(1)::before { content: "Cookie"; }
  html[lang="ja"] .legal-table td:nth-child(2)::before { content: "種類"; }
  html[lang="ja"] .legal-table td:nth-child(3)::before { content: "目的"; }
  html[lang="ja"] .legal-table td:nth-child(4)::before { content: "期間"; }
}

/* A 390 px le etichette tradotte non devono sottrarre spazio ai valori. */
@media (max-width: 420px) {
  .legal-table td {
    display: block;
  }

  .legal-table td::before {
    display: block;
    margin-bottom: 0.25rem;
  }

  .legal-table td strong,
  .legal-table td a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .footer__bottom,
  .footer__copyright,
  .footer__legal,
  .cookie-banner,
  .cookie-banner__inner,
  .cookie-banner__actions {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .footer__legal,
  .cookie-banner__actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer__legal {
    gap: var(--space-sm) var(--space-md);
  }

  .footer__legal a {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .cookie-banner__btn {
    flex: 1 1 8rem;
    min-width: 0;
    white-space: normal;
  }
}
