/* ColixShop - base comune. I colori arrivano da theme.css.php */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --testo-tenue: color-mix(in srgb, var(--c-testo) 68%, var(--c-sfondo));
  --linea: color-mix(in srgb, var(--c-testo) 14%, transparent);
  --ok: #1e7a46;
  --errore: #b3261e;
  --r-piccolo: 6px;
  --r-medio: 12px;
  --spazio: clamp(1rem, 3vw, 1.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--c-testo);
  background: var(--c-sfondo);
  font-stretch: 100%;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 .6em; font-stretch: 112%; font-weight: 800; }
h1 { font-size: clamp(1.75rem, 4vw, 2.44rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--c-accento); outline-offset: 2px; }

.salta { position: absolute; left: -999px; top: 0; background: var(--c-accento); color: var(--c-su-accento); padding: .5rem 1rem; z-index: 99; }
.salta:focus { left: 0; }
.nascosto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2;
  padding: .7rem 1.15rem; min-height: 44px;
  border: 2px solid currentColor; border-radius: var(--r-piccolo);
  background: transparent; color: var(--c-testo);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.btn:hover { background: color-mix(in srgb, var(--c-testo) 7%, transparent); }
.btn-primario { background: var(--c-primario); border-color: var(--c-primario); color: var(--c-su-primario); }
.btn-primario:hover { background: color-mix(in srgb, var(--c-primario) 85%, #000); }
.btn-grande { padding: .9rem 1.6rem; font-size: 1.05rem; }
.btn-piccolo { padding: .35rem .7rem; min-height: 34px; font-size: .85rem; border-width: 1.5px; }
.btn-pericolo { color: var(--errore); }
.btn .ico { width: 18px; height: 18px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* Moduli */
.modulo { display: grid; gap: 1rem; }
.campo { display: grid; gap: .3rem; min-width: 0; }
.campo label { font-weight: 600; font-size: .9rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--c-testo);
  padding: .65rem .75rem; min-height: 44px;
  border: 1.5px solid color-mix(in srgb, var(--c-testo) 28%, transparent);
  border-radius: var(--r-piccolo); background: var(--c-sfondo);
}
input:focus, select:focus, textarea:focus { border-color: var(--c-testo); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accento) 55%, transparent); }
input[readonly] { background: var(--c-superficie); }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; flex: none; margin-top: .15rem; accent-color: var(--c-primario); }
.spunta { display: flex; align-items: flex-start; gap: .55rem; font-size: .95rem; cursor: pointer; }
.aiuto { color: var(--testo-tenue); font-size: .85rem; }
.due, .tre { display: grid; gap: 1rem; }
@media (min-width: 560px) {
  .due { grid-template-columns: 1fr 1fr; }
  .tre { grid-template-columns: 1fr 2fr 1fr; }
}

/* Avvisi */
.avviso { padding: .8rem 1rem; border-radius: var(--r-piccolo); margin-bottom: .75rem; border-left: 4px solid var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--c-sfondo)); }
.avviso-errore { border-left-color: var(--errore); background: color-mix(in srgb, var(--errore) 8%, var(--c-sfondo)); }

/* Tabelle */
.tabella-scorre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }

.chip-punto { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; flex: none; }

.dialogo { border: 0; border-radius: var(--r-medio); padding: 1.5rem; max-width: 26rem; color: var(--c-testo); background: var(--c-sfondo); }
.dialogo::backdrop { background: rgba(0, 0, 0, .45); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
