/* ==========================================================================
   Italy Service Boat — Gruppo checkout
   Pagine: carrello.html, checkout.html, conferma-ordine.html
   Prefisso classi: .ck-
   ========================================================================== */

/* ---------- Indicatore passi (Carrello › Checkout › Conferma) ---------- */
.ck-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 10px;
  list-style: none;
  margin-top: 28px;
  font-size: 14px;
  color: var(--text-3);
}

.ck-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ck-steps li + li::before {
  content: "\203A";
  margin-right: 10px;
  font-size: 18px;
  line-height: 1;
  color: var(--text-3);
}

.ck-steps a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
}

.ck-step-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8e8ed;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.ck-steps .is-current {
  color: var(--text);
  font-weight: 600;
}

.ck-steps .is-current .ck-step-num {
  background: var(--accent);
  color: #fff;
}

.ck-steps .is-done {
  color: var(--text-2);
}

.ck-steps .is-done .ck-step-num {
  background: var(--success);
  color: #fff;
}

/* ---------- Layout a due colonne con riepilogo sticky ---------- */
.ck-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 40px;
  align-items: start;
}

.ck-aside {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

/* ---------- Righe carrello ---------- */
.ck-head,
.ck-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 110px 140px 110px 44px;
  gap: 16px;
  align-items: center;
}

.ck-head {
  padding: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
}

.ck-head .ck-col-unit,
.ck-head .ck-col-total {
  text-align: right;
}

.ck-head .ck-col-qty {
  text-align: center;
}

.ck-rows {
  list-style: none;
}

.ck-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.ck-thumb {
  --art-bg: var(--bg-alt);
  display: block;
  width: 96px;
  height: 96px;
  padding: 10px;
  border-radius: 18px;
  background: var(--art-bg);
  flex-shrink: 0;
}

.ck-thumb svg,
.ck-thumb img {
  width: 100%;
  height: 100%;
}

/* Foto reali dal catalogo WooCommerce: il fondo bianco si fonde con la cornice grigia */
.ck-thumb img {
  object-fit: contain;
  mix-blend-mode: multiply;
}

.ck-name {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.ck-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-2);
}

.ck-meta + .ck-meta {
  margin-top: 6px;
}

.ck-col-unit,
.ck-col-total {
  text-align: right;
}

.ck-col-qty {
  display: flex;
  justify-content: center;
}

.ck-unit {
  font-size: 15px;
  color: var(--text-2);
}

.ck-line-total {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

/* Su desktop l'etichetta resta disponibile agli screen reader (l'intestazione
   .ck-head è aria-hidden) ma è nascosta solo visivamente; su mobile diventa inline. */
.ck-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  font-size: 12px;
  color: var(--text-3);
}

.ck-remove {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  transition: background var(--t), color var(--t);
}


.ck-remove .icon {
  width: 20px;
  height: 20px;
}

/* Etichetta testuale "Rimuovi": su desktop resta la sola icona (colonna stretta,
   con aria-label/title); sotto 834px, dove la card non ha intestazioni, diventa visibile. */
.ck-remove-label {
  display: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.ck-rows-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding-top: 20px;
}

/* ---------- Card riepilogo ---------- */
.ck-summary {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
}

.ck-summary h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.ck-summary .summary-row {
  padding: 8px 0;
}

.ck-vat {
  margin-top: -2px;
  font-size: 13px;
  color: var(--text-3);
  text-align: right;
}

/* barra spedizione gratuita */
.ck-ship {
  margin-top: 18px;
}

.ck-ship-text {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.ck-ship-track {
  height: 6px;
  border-radius: 3px;
  background: #e0e0e5;
  overflow: hidden;
}

.ck-ship-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), #1aa3b5);
  transition: width 0.6s var(--ease-out);
}

.ck-ship.is-complete .ck-ship-fill {
  background: var(--success);
}

.ck-ship.is-complete .ck-ship-text {
  color: var(--success);
  font-weight: 500;
}

/* righe compatte nel riepilogo checkout */
.ck-summary-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  max-height: 340px;
  overflow: auto;
}

.ck-summary-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.ck-summary-item .ck-thumb {
  width: 56px;
  height: 56px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
}

.ck-summary-item .ck-name {
  font-size: 14px;
}

.ck-summary-item .ck-meta {
  margin-top: 2px;
  font-size: 12px;
}

.ck-summary-item .ck-line-total {
  font-size: 14px;
}

/* ---------- Stato vuoto ---------- */
.ck-empty {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px) 0;
  text-align: center;
}

.ck-empty [data-art] {
  width: min(100%, 240px);
  margin: 0 auto 8px;
}

.ck-empty .lead {
  margin-top: 12px;
}

/* ---------- Blocchi form checkout ---------- */
.ck-block {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

/* ---------- Ospite oppure account: due strade, la scelta attiva evidenziata ---------- */
.ck-who {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ck-who-logged {
  grid-template-columns: minmax(0, 1fr);
}

.ck-who-opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.ck-who-opt strong {
  font-size: 16px;
}

.ck-who-opt span {
  color: var(--text-2);
}

.ck-who-opt.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

a.ck-who-opt strong {
  color: var(--accent);
}

.ck-who-links {
  margin-top: 4px;
}

@media (hover: hover) and (pointer: fine) {
  a.ck-who-opt:hover {
    border-color: var(--accent);
    background: var(--bg-alt);
  }
}

@media (max-width: 560px) {
  .ck-who {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Sconto riservato nel riepilogo */
.ck-discount-row span:last-child {
  color: var(--accent);
  font-weight: 600;
}

.ck-block + .ck-block {
  margin-top: 20px;
}

.ck-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ck-block-head h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ck-block-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.ck-block .form {
  gap: 16px;
}

.ck-payments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Il wrapper titolo+descrizione è uno <span>: style.css gli applica il grigio
   --text-2 (.radio-card span). Ripristiniamo il colore principale sul wrapper e
   sul titolo; la descrizione interna resta grigia grazie alla regola condivisa. */
.ck-payments .radio-card > span {
  flex: 1;
  color: var(--text);
}

.ck-payments .radio-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.ck-payments .icon-slot {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ck-payments .radio-card strong .icon {
  width: 20px;
  height: 20px;
  color: var(--text-2);
}

.ck-secure {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

.ck-secure .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--success);
}

.ck-req {
  color: var(--danger);
  margin-left: 2px;
}

.ck-form-note {
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- Conferma ordine ---------- */
.ck-check {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  box-shadow: 0 12px 40px rgba(29, 157, 85, 0.3);
}

.ck-check .icon {
  width: 44px;
  height: 44px;
  stroke-width: 2.5;
}

.ck-order-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 24px;
  margin-top: 20px;
  font-size: 15px;
  color: var(--text-2);
}

.ck-order-meta strong {
  color: var(--text);
  font-weight: 600;
}

.ck-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: #fff3e0;
  color: var(--warning);
  font-size: 13px;
  font-weight: 600;
}

.ck-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.ck-status.is-ok {
  background: #e6f6ec;
  color: var(--success);
}

.ck-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.ck-card-grid .ck-block + .ck-block {
  margin-top: 0;
}

.ck-block h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

.ck-address {
  font-style: normal;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
}

.ck-address strong {
  color: var(--text);
  font-weight: 600;
}

.ck-notes {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-line;
}

.ck-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ck-rows-order .ck-row {
  grid-template-columns: 72px minmax(0, 1fr) 120px;
  padding: 16px 0;
}

.ck-rows-order .ck-thumb {
  width: 72px;
  height: 72px;
  padding: 8px;
  border-radius: 14px;
}

.ck-rows-order .ck-row:first-child {
  padding-top: 0;
}

.ck-order-totals {
  margin-top: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1068px) {
  .ck-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .ck-aside {
    position: static;
  }

  .ck-head,
  .ck-row {
    grid-template-columns: 80px minmax(0, 1fr) 96px 130px 96px 40px;
    gap: 12px;
  }

  .ck-thumb {
    width: 80px;
    height: 80px;
  }
}

/* Su mobile le righe diventano card impilate */
@media (max-width: 834px) {
  .ck-head {
    display: none;
  }

  .ck-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  /* La terza colonna è "auto": ospita solo il bottone Rimuovi (icona + etichetta),
     nella stessa riga delle quantità. */
  .ck-row {
    grid-template-columns: 80px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb info info"
      "thumb unit unit"
      "qty qty remove"
      "total total total";
    gap: 10px 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
  }

  .ck-col-thumb {
    grid-area: thumb;
  }

  .ck-col-info {
    grid-area: info;
  }

  .ck-col-unit {
    grid-area: unit;
    text-align: left;
  }

  .ck-col-qty {
    grid-area: qty;
    justify-content: flex-start;
  }

  .ck-col-total {
    grid-area: total;
    align-self: center;
  }

  .ck-col-remove {
    grid-area: remove;
    justify-self: end;
    align-self: center;
  }

  /* Su mobile il cestino diventa un bottone a pillola con etichetta visibile */
  .ck-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    height: 36px;
    padding: 0 12px 0 10px;
    border-radius: var(--radius-pill);
  }

  .ck-remove .icon {
    width: 16px;
    height: 16px;
  }

  .ck-remove-label {
    display: inline;
  }

  .ck-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0 8px 0 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    display: inline;
  }

  .ck-rows-order .ck-row {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas:
      "thumb info"
      "thumb total";
    padding: 14px;
  }

  .ck-rows-order .ck-row:first-child {
    padding-top: 14px;
  }

  .ck-rows-order .ck-col-total {
    text-align: left;
  }

  .ck-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ck-block {
    padding: 22px;
  }

  .ck-summary {
    padding: 22px;
  }
}

@media (max-width: 480px) {
  .ck-steps {
    font-size: 13px;
    gap: 4px 6px;
  }

  .ck-steps li + li::before {
    margin-right: 6px;
  }

  .ck-thumb {
    width: 72px;
    height: 72px;
    padding: 8px;
    border-radius: 14px;
  }

  .ck-row {
    grid-template-columns: 72px minmax(0, 1fr) auto;
  }

  .ck-block {
    padding: 18px;
  }

  .ck-rows-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Stampa (conferma ordine) ---------- */
@media print {
  #site-header,
  #site-footer,
  .wa-fab,
  .cookie,
  .toast,
  .drawer,
  .overlay,
  .ck-no-print {
    display: none !important;
  }

  body {
    color: #000;
    font-size: 12pt;
  }

  main {
    padding-top: 0;
    min-height: 0;
  }

  .hero {
    margin-top: 0;
    padding: 16px 0;
    background: #fff;
  }

  .hero-content {
    max-width: none;
  }

  .ck-check {
    box-shadow: none;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
  }

  .ck-check .icon {
    width: 24px;
    height: 24px;
  }

  .display {
    font-size: 24pt;
  }

  .subhead {
    font-size: 13pt;
  }

  .section,
  .section-tight {
    padding-block: 12px;
  }

  .ck-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ck-block {
    border-color: #bbb;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .ck-thumb {
    background: var(--bg-alt);
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

/* ---------- Stati hover solo per puntatori che possono passare sopra (mouse/trackpad): sul touch non restano 'appiccicati' dopo il tap ---------- */
@media (hover: hover) and (pointer: fine) {
  .ck-remove:hover {
    background: #fde8e8;
    color: var(--danger);
  }

}
