.checkout-step {
  display: none;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.checkout-step.active-step,
.active-step {
  display: flex;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: max-content;
  min-height: 24px;
  padding: 0 9px;

  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 999px;

  background: var(--accent-soft);
  color: var(--accent-light);

  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.checkout-step h3 {
  margin: 0;

  color: var(--text);

  font-family: var(--site-font-family);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.step-text {
  max-width: 56ch;
  margin: 0;

  color: var(--text-muted);

  font-size: 0.76rem;
  line-height: 1.45;
}

/* =========================================================
   ESCOLHAS
========================================================= */

.choice-stack,
.choice-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.choice-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.choice-group-head strong {
  color: var(--text);

  font-size: 0.8rem;
  font-weight: 800;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 7px;
  min-width: 0;
}

.choice-card {
  display: grid;
  align-content: start;
  gap: 4px;

  min-width: 0;
  padding: 10px 11px;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  background: var(--surface-soft);
  color: var(--text);

  text-align: left;

  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.choice-card:hover {
  transform: translateY(-1px);

  border-color: rgba(var(--accent-rgb), 0.38);

  background: rgba(var(--accent-rgb), 0.07);
}

.choice-card.is-active {
  border-color: var(--accent);

  background: var(--accent-soft);

  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.35),
    0 8px 20px rgba(0, 0, 0, 0.12);
}

.choice-card strong {
  color: var(--text);

  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.25;
}

.choice-card p,
.choice-card small {
  margin: 0;

  color: var(--text-muted);

  font-size: 0.73rem;
  line-height: 1.4;
}

.choice-card.is-active strong {
  color: var(--accent-light);
}

/* =========================================================
   CARDS DOS MODAIS
========================================================= */

.checkout-modal-card {
  width: min(720px, 100%);
  padding: 20px;
}

.address-modal-card {
  width: min(760px, 100%);
}

/* =========================================================
   LAYOUT DA REVISÃO
========================================================= */

.checkout-review-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(270px, 0.78fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.checkout-left-stack,
.checkout-right-stack {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.checkout-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  min-width: 0;
}

.checkout-form-grid-full {
  grid-column: 1 / -1;
}

.checkout-summary-grid,
.payment-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

/* =========================================================
   RESUMOS
========================================================= */

.checkout-summary-card {
  display: grid;
  align-content: start;
  gap: 8px;

  min-width: 0;
  padding: 11px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background: rgba(255, 255, 255, 0.025);
  color: var(--text);

  box-shadow: none;
}

.checkout-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-width: 0;
}

.checkout-summary-head h4 {
  min-width: 0;
  margin: 0;

  overflow: hidden;

  color: var(--text);

  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkout-summary-head .button-secondary,
.checkout-summary-head .text-button {
  flex: 0 0 auto;
}

/* =========================================================
   LISTAS INTERNAS
========================================================= */

.checkout-items-list,
.order-actions,
.payment-summary-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.checkout-items-list {
  max-height: 180px;
  padding-right: 4px;

  overflow-y: auto;
  overscroll-behavior: contain;
}

.checkout-items-list::-webkit-scrollbar,
#checkout-payment-options::-webkit-scrollbar {
  width: 5px;
}

.checkout-items-list::-webkit-scrollbar-thumb,
#checkout-payment-options::-webkit-scrollbar-thumb {
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.12);
}

.checkout-items-list::-webkit-scrollbar-thumb:hover,
#checkout-payment-options::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.38);
}

#checkout-payment-options {
  display: grid;
  gap: 7px;

  max-height: 208px;
  padding-right: 4px;

  overflow-y: auto;
  overscroll-behavior: contain;
}

#checkout-payment-extra-fields {
  display: grid;
  gap: 10px;
}

/* =========================================================
   ITEM DO CHECKOUT
========================================================= */

.checkout-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;

  min-width: 0;
  padding-bottom: 8px;

  border-bottom: 1px solid var(--border);
}

.checkout-item-row:last-child {
  padding-bottom: 0;

  border-bottom: 0;
}

.checkout-item-row > div {
  min-width: 0;
}

.checkout-item-row strong {
  color: var(--text);

  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.checkout-item-row > strong {
  flex: 0 0 auto;

  color: var(--accent-light);

  font-family: var(--site-font-family);
  font-size: 0.78rem;
  white-space: nowrap;
}

.checkout-item-row p,
.checkout-address-preview,
.copy-box span,
.order-subtitle,
.order-address {
  margin: 0;

  color: var(--text-muted);

  font-size: 0.74rem;
  line-height: 1.4;
}

/* =========================================================
   OBSERVAÇÕES
========================================================= */

.checkout-notes-card {
  gap: 10px;
}

.checkout-notes-field {
  display: grid;
  gap: 7px;
}

.checkout-notes-field span {
  color: #d9d9e2;

  font-size: 0.76rem;
  font-weight: 700;
}

.checkout-notes-field textarea {
  width: 100%;
  min-height: 105px;
  padding: 10px 11px;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  outline: none;

  background: var(--surface-soft);
  color: var(--text);

  font-size: 0.77rem;
  line-height: 1.5;

  resize: vertical;

  transition:
    border-color 150ms ease,
    outline-color 150ms ease;
}

.checkout-notes-field textarea:hover {
  border-color: var(--border-strong);
}

.checkout-notes-field textarea:focus {
  border-color: var(--accent);

  outline: 3px solid rgba(var(--accent-rgb), 0.11);
}

/* =========================================================
   TOTAIS
========================================================= */

.checkout-totals {
  display: grid;
  gap: 7px;

  padding: 11px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background: rgba(255, 255, 255, 0.025);
}

.checkout-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  color: var(--text-muted);

  font-size: 0.76rem;
}

.checkout-total-row strong {
  color: var(--text);

  font-size: 0.78rem;
  font-weight: 800;
}

.checkout-total-highlight {
  margin-top: 2px;
  padding-top: 8px;

  border-top: 1px dashed var(--border-strong);

  color: var(--text);

  font-size: 0.84rem;
  font-weight: 700;
}

.checkout-total-highlight strong {
  color: var(--accent-light);

  font-family: var(--site-font-family);
  font-size: 0.95rem;
  font-weight: 900;
}

/* =========================================================
   PAGAMENTO PIX
========================================================= */

.payment-qr-card {
  place-items: center;

  text-align: center;
}

#pix-qr-image {
  display: block;

  width: min(230px, 100%);
  aspect-ratio: 1 / 1;
  padding: 8px;

  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 10px;

  background: #ffffff;

  object-fit: contain;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
}

/* =========================================================
   CAIXA PARA COPIAR
========================================================= */

.copy-box {
  display: grid;
  gap: 7px;

  min-width: 0;
  padding: 11px;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  background: var(--surface-soft);
}

.copy-box strong {
  color: var(--text);

  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;

  overflow-wrap: anywhere;
  word-break: break-word;
}

.copy-box textarea {
  width: 100%;
  min-height: 82px;
  padding: 8px;

  border: 1px solid var(--border);
  border-radius: 7px;

  outline: none;

  background: rgba(255, 255, 255, 0.025);
  color: var(--text);

  font-size: 0.72rem;
  line-height: 1.45;

  resize: none;
}

.copy-box textarea:focus {
  border-color: var(--accent);

  outline: 3px solid rgba(var(--accent-rgb), 0.1);
}

.copy-box .button-primary,
.copy-box .button-secondary {
  width: 100%;
  min-height: 36px;

  font-size: 0.72rem;
}

/* =========================================================
   AÇÕES DO FORMULÁRIO
========================================================= */

.checkout-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.checkout-form-actions .button-primary {
  flex: 1 1 180px;

  width: 100%;
  min-height: 40px;
}

.checkout-form-actions .button-secondary {
  flex: 0 1 auto;

  min-height: 40px;
}

/* =========================================================
   PEDIDOS
========================================================= */

.orders-section {
  display: grid;
  gap: 14px;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.order-card {
  min-width: 0;
  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background:
    radial-gradient(
      circle at top right,
      rgba(var(--accent-rgb), 0.07),
      transparent 34%
    ),
    var(--surface);

  box-shadow: none;

  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.order-card:hover {
  transform: translateY(-1px);

  border-color: rgba(var(--accent-rgb), 0.3);

  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.order-card-collapsible {
  padding: 0;
}

.order-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  min-width: 0;
  padding: 13px 14px;

  cursor: pointer;
  list-style: none;

  transition: background 150ms ease;
}

.order-card-summary:hover {
  background: rgba(var(--accent-rgb), 0.055);
}

.order-card-summary::-webkit-details-marker {
  display: none;
}

.order-card-summary::after {
  content: "⌄";

  flex: 0 0 auto;

  color: var(--text-muted);

  font-size: 0.85rem;

  transition:
    transform 150ms ease,
    color 150ms ease;
}

.order-card-collapsible[open] .order-card-summary::after {
  transform: rotate(180deg);

  color: var(--accent-light);
}

.order-card-summary-main {
  display: grid;
  gap: 5px;

  min-width: 0;
}

.order-card-summary-main strong {
  overflow: hidden;

  color: var(--text);

  font-size: 0.8rem;
  font-weight: 800;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card-body {
  display: grid;
  gap: 11px;

  padding: 13px 14px 14px;

  border-top: 1px solid var(--border);

  background: rgba(255, 255, 255, 0.018);
}

.order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;

  min-width: 0;
}

.order-card-head > div {
  min-width: 0;
}

.order-card-head h3,
.order-card-head h4 {
  margin: 0;

  color: var(--text);

  font-size: 0.84rem;
  line-height: 1.3;
}

.order-items-list {
  display: grid;
  gap: 6px;

  margin: 0;
  padding-left: 17px;

  color: var(--text-muted);

  font-size: 0.74rem;
  line-height: 1.45;
}

.order-items-list li::marker {
  color: var(--accent);
}

/* =========================================================
   OBSERVAÇÃO DO PEDIDO
========================================================= */

.order-note-card,
.order-note-box {
  display: grid;
  gap: 6px;

  padding: 10px 11px;

  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--radius-sm);

  background: rgba(var(--accent-rgb), 0.07);
}

.order-note-label,
.order-note-box span {
  color: var(--accent-light);

  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-note-text,
.order-note-box strong {
  margin: 0;

  color: var(--text);

  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;

  white-space: pre-wrap;
}

/* =========================================================
   AÇÕES DOS PEDIDOS E PAGAMENTO
========================================================= */

.order-actions .button-secondary,
.order-actions .button-primary,
.payment-layout .button-secondary,
.payment-layout .button-primary {
  width: 100%;
  min-height: 38px;

  font-size: 0.74rem;
}

/* =========================================================
   FOCO
========================================================= */

.choice-card:focus-visible,
.order-card-summary:focus-visible,
.checkout-form-actions button:focus-visible,
.order-actions button:focus-visible,
.payment-layout button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* =========================================================
   MOVIMENTO REDUZIDO
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .choice-card,
  .order-card,
  .order-card-summary,
  .order-card-summary::after {
    transition: none;
  }
}

/* =========================================================
   CORREÇÃO FINAL — CHECKOUT, PEDIDOS E DADOS CLAROS
   Este arquivo é carregado depois dos demais e deve vencer.
========================================================= */

#checkout-modal,
#address-modal,
#customer-data-modal {
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --surface-strong: #ececec;
  --border: #d7d7d7;
  --border-strong: #bfbfbf;
  --text: #222222;
  --text-muted: #6f6f6f;
}

#checkout-modal .modal-card,
#address-modal .modal-card,
#customer-data-modal .modal-card {
  border-color: #d2d2d2 !important;
  background: #ebebeb !important;
  color: #222222 !important;
}

.checkout-step h3,
.checkout-summary-head h4,
.checkout-summary-card strong,
.choice-card strong,
.checkout-total-row strong,
.order-card h3,
.order-card h4,
.order-card strong {
  color: #222222 !important;
}

.step-text,
.checkout-address-preview,
.checkout-item-row p,
.choice-card p,
.choice-card small,
.checkout-total-row,
.order-subtitle,
.order-address,
.order-card p,
.order-card span,
.order-card small {
  color: #6f6f6f !important;
}

.checkout-summary-card,
.checkout-totals,
.copy-box,
.choice-card,
.order-card,
.payment-qr-card,
.checkout-notes-card {
  border-color: #d7d7d7 !important;
  background: #ffffff !important;
  color: #222222 !important;
  box-shadow: none !important;
}

.choice-card:hover,
.order-card:hover {
  border-color: var(--accent) !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.choice-card.is-active {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

.choice-card.is-active strong {
  color: var(--accent-dark) !important;
}

.checkout-notes-field span,
#checkout-modal label > span,
#address-modal label > span {
  color: #4f4f4f !important;
}

.checkout-notes-field textarea,
#checkout-payment-extra-fields input,
#checkout-payment-extra-fields select,
#checkout-payment-extra-fields textarea,
#address-modal input,
#address-modal select,
#address-modal textarea,
.copy-box textarea {
  border-color: #d4d4d4 !important;
  background: #ffffff !important;
  color: #222222 !important;
}

.checkout-total-highlight strong,
.checkout-item-row > strong {
  color: var(--accent-dark) !important;
}

/* Dados do cliente: regras finais para impedir que pedidos voltem ao escuro */

#customer-data-modal .customer-data-modal-card {
  border-color: #d2d2d2 !important;
  background: #ebebeb !important;
  color: #222222 !important;
}

#customer-data-modal .customer-data-modal-head {
  border-color: #d4d4d4 !important;
}

#customer-data-modal .customer-data-modal-head h2,
#customer-data-modal .customer-data-modal-section-head h3 {
  color: #222222 !important;
}

#customer-data-modal .customer-data-modal-head .section-subtitle {
  color: #6f6f6f !important;
}

#customer-data-modal .customer-data-modal-section,
#customer-data-modal #customer-summary-grid > *,
#customer-data-modal #orders-list .order-card {
  border-color: #d7d7d7 !important;
  background: #ffffff !important;
  color: #222222 !important;
  box-shadow: none !important;
}

#customer-data-modal #customer-summary-grid > * {
  background: #f7f7f7 !important;
}

#customer-data-modal #orders-list .order-card:hover {
  transform: none !important;
  border-color: var(--accent) !important;
  background: #ffffff !important;
}

#customer-data-modal #customer-summary-grid h3,
#customer-data-modal #customer-summary-grid h4,
#customer-data-modal #customer-summary-grid strong,
#customer-data-modal #orders-list h3,
#customer-data-modal #orders-list h4,
#customer-data-modal #orders-list strong {
  color: #222222 !important;
}

#customer-data-modal #customer-summary-grid p,
#customer-data-modal #customer-summary-grid span,
#customer-data-modal #customer-summary-grid small,
#customer-data-modal #orders-list p,
#customer-data-modal #orders-list span,
#customer-data-modal #orders-list small {
  color: #6f6f6f !important;
}
