/* ==========================================================
   GEST PRO – assets/css/modules-modal.css
   Modal "Configura i moduli" per ogni card prodotto.
   ========================================================== */

/* ── Bottone nella card ──────────────────────────────────── */
.card-modules-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--f-body);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--c-text-muted);
  background: transparent;
  border: 1px solid var(--c-base-alt);
  border-radius: var(--r-xl);
  padding: 0.45em 1.1em;
  cursor: pointer;
  transition: var(--tr);
  white-space: nowrap;
}
.card-modules-btn:hover {
  border-color: var(--c-accent);
  color: var(--c-accent-dark);
  background: rgba(0, 194, 203, 0.06);
}
.card-modules-btn i { font-size: 0.8rem; }

/* ── Footer card: "Scopri" a sx, "Configura" a dx ───────── */
.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Modal configuratore ─────────────────────────────────── */
.modules-modal .lp-modal-box {
  max-width: 500px;
}

/* Header prodotto */
.modules-modal-product {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent-dark);
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 0.2rem;
}
.modules-modal-title {
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--c-mid);
  line-height: 1.2;
}

/* ── Sezione moduli base ─────────────────────────────────── */
.modules-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent-dark);
  margin-bottom: 0.55rem;
}

/* Lista moduli – scroll se lunga */
.modules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--c-accent) var(--c-base-alt);
}
.modules-list::-webkit-scrollbar { width: 4px; }
.modules-list::-webkit-scrollbar-track { background: var(--c-base-alt); border-radius: 2px; }
.modules-list::-webkit-scrollbar-thumb { background: var(--c-accent); border-radius: 2px; }

/* Riga singolo modulo */
.module-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--c-base);
  border: 1px solid var(--c-base-alt);
  border-radius: var(--r-md);
  padding: 0.6rem 0.9rem;
  transition: border-color 0.2s;
}

/* Modulo base: non selezionabile */
.module-row.module-base {
  cursor: default;
  opacity: 0.85;
}
.module-row.module-base .module-check {
  color: var(--c-accent-dark);
  font-size: 0.8rem;
}

/* Modulo aggiuntivo: selezionabile */
.module-row.module-extra {
  cursor: pointer;
}
.module-row.module-extra:hover {
  border-color: rgba(0, 194, 203, 0.4);
}
.module-row.module-extra.selected {
  border-color: var(--c-accent);
  background: rgba(0, 194, 203, 0.04);
}

.module-info { flex: 1; }
.module-name {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--c-text-dark);
  line-height: 1.3;
}
.module-desc {
  font-size: 0.76rem;
  color: var(--c-text-muted);
  margin-top: 0.1rem;
}

/* Prezzo modulo aggiuntivo */
.module-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.module-row.selected .module-price { color: var(--c-accent-dark); }

/* Checkbox custom */
.module-cb {
  width: 18px; height: 18px;
  border: 2px solid var(--c-base-alt);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--tr);
  font-size: 0.7rem;
  color: transparent;
}
.module-row.selected .module-cb {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-mid);
}

/* ── Separatore tra base e aggiuntivi ────────────────────── */
.modules-divider {
  border: none;
  border-top: 1px solid var(--c-base-alt);
  margin: 1rem 0;
}

/* ── Totale ──────────────────────────────────────────────── */
.modules-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.75rem 0 0;
}
.modules-total-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-text-muted);
}
.modules-total-amount {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--c-mid);
}
.modules-total-amount span {
  font-family: var(--f-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--c-text-muted);
}

/* ── Footer ──────────────────────────────────────────────── */
.modules-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.modules-modal-note {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: 0.35em;
}

@media (max-width: 600px) {
  .modules-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .modules-modal-footer .lp-modal-btn {
    text-align: center;
    justify-content: center;
  }
  .card-footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
