/* RungiModels - Accessori nel carrello
   Font: Cal Sans (SIL Open Font License, vedi views/fonts/OFL-Cal-Sans.txt) */
@font-face {
  font-family: 'Cal Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/cal-sans-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.rungiacc-box {
  /* colori: cambiali qui */
  --rungiacc-text: #111517;
  --rungiacc-bg: #f1f3f2;
  --rungiacc-checked-bg: #E3F1CC;
  --rungiacc-checked-text: #111517;
  --rungiacc-tick: #ffffff;

  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  flex: 0 0 100%;
  margin: 1.25rem 0px 0px;
}

.rungiacc-item {
  border: 0;
  border-radius: 16px;
  background: var(--rungiacc-bg);
  color: var(--rungiacc-text);
  transition: background-color .15s ease, color .15s ease;
}

/* il colore segue la casella anche senza JavaScript (:has); .is-checked resta per i browser vecchi */
.rungiacc-item:has(input:checked) {
  background: var(--rungiacc-checked-bg);
  color: var(--rungiacc-checked-text);
}

.rungiacc-item.is-checked {
  background: var(--rungiacc-checked-bg);
  color: var(--rungiacc-checked-text);
}

.rungiacc-item:has(input:not(:checked)) {
  background: var(--rungiacc-bg);
  color: var(--rungiacc-text);
}

.rungiacc-item .rungiacc-row {
  box-sizing: border-box; /* width:100% + padding non deve superare il riquadro */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  width: 100%;
  min-height: 4.5rem;
  margin: 0;
  padding: 1.25rem 1.5rem;
  cursor: default;
  font-family: 'Cal Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  color: inherit;
}

/* casella grande, disegnata a mano: stessa resa su ogni browser */
.rungiacc-item input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: static;
  flex: none;
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
  box-shadow: inset 0 0 0 2px #b9c2c0;
  opacity: 1;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.rungiacc-item input[type="checkbox"]:checked {
  background-color: var(--rungiacc-tick);
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111517' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.rungiacc-item input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--rungiacc-tick);
  outline-offset: 2px;
}

/* nome e prezzo vicini, allineati a sinistra */
.rungiacc-name {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 400;
  color: inherit;
}

.rungiacc-price {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 600;
  color: inherit;
}

.rungiacc-price {
  white-space: nowrap;
}

/* nome dell'accessorio: sottolineato, porta alla scheda del prodotto (nuova scheda del browser) */
.rungiacc-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rungiacc-link:hover,
.rungiacc-link:focus {
  color: inherit;
  text-decoration-thickness: 2px;
}

/* riquadro stretto (colonna del prodotto su tablet, telefono): il prezzo scende sotto il nome.
   Si guarda la larghezza del riquadro, non quella dello schermo. */
.rungiacc-item {
  container-type: inline-size;
}

@container (max-width: 520px) {
  .rungiacc-item .rungiacc-row {
    flex-wrap: wrap;
    padding: 1.1rem 1.25rem;
    gap: .35rem 1rem;
  }
  .rungiacc-name {
    flex: 1 1 calc(100% - 2.65rem);
  }
  .rungiacc-price {
    flex: 1 1 100%;
    padding-left: 2.65rem;
    box-sizing: border-box;
  }
}

/* stessa cosa per i browser vecchi senza container query */
@media (max-width: 480px) {
  .rungiacc-item .rungiacc-row {
    flex-wrap: wrap;
    padding: 1.1rem 1.25rem;
    gap: .35rem 1rem;
  }
  .rungiacc-name {
    flex: 1 1 calc(100% - 2.65rem);
  }
  .rungiacc-price {
    flex: 1 1 100%;
    padding-left: 2.65rem;
    box-sizing: border-box;
  }
}
