/* ============================================================================
   AKKATT - Checkout Modal (wizard 2 step: dati/indirizzo -> riepilogo/pagamento)
   ============================================================================ */

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.checkout-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.checkout-modal__panel {
  position: relative;
  width: min(100%, 32rem);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

/* Voci del menu profilo (Il mio profilo, Ordini, Assistenza) usano una variante piu' larga,
   pensata per contenuti a due colonne come il form anagrafico + libretto indirizzi. */
.checkout-modal__panel--wide {
  width: min(100%, 44rem);
}

/* Il partial _ProfileContent.cshtml porta gia' i propri margini/padding (pagina standalone
   /Profile): dentro la modale il pannello li fornisce gia', quindi si azzerano per evitare
   spaziature doppie. */
.checkout-modal__panel .profile-page {
  max-width: none;
  margin: 0;
  padding: 0;
}

.checkout-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkout-stepper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.checkout-stepper__line {
  position: absolute;
  top: 16px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--border);
}

.checkout-stepper__progress {
  position: absolute;
  top: 16px;
  left: 30px;
  height: 2px;
  background: var(--primary);
  width: 0%;
  transition: width 0.25s ease;
}

.checkout-step-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.checkout-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.checkout-step-item.active .checkout-step-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.checkout-step-item.completed .checkout-step-dot {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.checkout-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.checkout-step-item.active .checkout-step-label {
  color: var(--primary);
}

.checkout-order-summary {
  margin: 0 0 1.5rem;
  border: 1px solid #75e8db;
  border-radius: 14px;
  background: var(--primary-light, #ccfbf1);
  color: #0f766e;
  overflow: hidden;
}

.checkout-order-summary__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.checkout-order-summary__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.checkout-order-summary__chevron {
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.checkout-order-summary.is-expanded .checkout-order-summary__chevron {
  transform: rotate(180deg);
}

.checkout-order-summary__toggle > strong {
  flex: 0 0 auto;
  margin-left: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
}

.checkout-order-summary__details {
  margin: 0 1rem;
  padding: 0.9rem 0 0.95rem;
  border-top: 1px dashed #75e8db;
}

.checkout-order-summary__lines {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.checkout-order-summary__line,
.checkout-order-summary__shipping {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.checkout-order-summary__line span {
  min-width: 0;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.checkout-order-summary__line strong,
.checkout-order-summary__shipping strong {
  flex: 0 0 auto;
  color: var(--text-main);
}

.checkout-order-summary__shipping {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid #75e8db;
  font-weight: 600;
}

.checkout-order-summary__shipping strong {
  color: #0f766e;
  text-transform: uppercase;
}

.checkout-step-content {
  display: none;
}

.checkout-step-content.active {
  display: block;
}

.checkout-step-content h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.checkout-step-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  line-height: 1.4;
}

.checkout-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 1.1rem 0 0.6rem;
  color: var(--text-main);
}

.checkout-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.checkout-form-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
}

.checkout-input-group {
  margin-bottom: 0.85rem;
}

.checkout-input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.checkout-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  background: var(--bg-main);
  color: var(--text-main);
}

.checkout-input:focus {
  border-color: var(--primary);
}

.checkout-form-error {
  font-size: 0.8rem;
  color: #b91c1c;
  margin-bottom: 0.75rem;
}

.checkout-saved-addresses {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkout-address-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-main);
}

.checkout-address-card.selected {
  border-color: var(--primary);
  background: var(--primary-light, #ccfbf1);
}

.checkout-address-card__title {
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.checkout-address-card__meta {
  color: var(--text-muted);
}

.checkout-add-address-toggle {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 10px;
  width: 100%;
  padding: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.checkout-new-address {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  background: var(--bg-main);
}

.checkout-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-main);
}

.checkout-btn-action {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
}

.checkout-btn-action--stripe {
  background: #635bff;
}

.checkout-btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.checkout-summary-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.checkout-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.checkout-summary-totals {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-bottom: 1rem;
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.checkout-summary-row--total {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.checkout-stripe-box {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.checkout-stripe-badge {
  display: inline-flex;
  background: #635bff;
  color: #fff;
  font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}

.checkout-stripe-box p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.checkout-confirmation {
  text-align: center;
  padding: 1rem 0;
}

.checkout-confirmation__icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.checkout-confirmation p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 1rem;
}

@media (max-width: 380px) {
  .checkout-order-summary__toggle {
    padding: 0.75rem;
  }

  .checkout-order-summary__label {
    font-size: 0.9rem;
  }

  .checkout-order-summary__toggle > strong {
    font-size: 1.15rem;
  }
}
