/* ==============================
   CHECKOUT PÚBLICO
============================== */

.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(11, 18, 32, 0.72);
  overflow-y: auto;
}

.checkout-overlay.is-open {
  display: flex;
}

.checkout-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;

  padding: 24px;

  background: #ffffff;
  border-radius: 20px;
}

.checkout-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 20px;
}

.checkout-modal__header h2 {
  margin: 0;
}

.checkout-modal__intro {
  margin: 6px 0 0;
}

.checkout-modal__close {
  flex: 0 0 auto;

  border: 0;
  background: transparent;

  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.checkout-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.checkout-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.checkout-field label,
.checkout-field__label {
  font-weight: 700;
}

.checkout-field input,
.checkout-field select,
.checkout-field textarea {
  width: 100%;
  box-sizing: border-box;

  border: 1px solid #b6bec9;
  border-radius: 10px;

  padding: 11px 12px;
  font: inherit;

  background: #ffffff;
}

.checkout-field textarea {
  min-height: 90px;
  resize: vertical;
}

.checkout-field input:focus,
.checkout-field select:focus,
.checkout-field textarea:focus {
  outline: 3px solid rgba(25, 103, 210, 0.18);
  border-color: #1967d2;
}

.checkout-field select:disabled {
  background: #eef1f5;
  cursor: not-allowed;
}

.checkout-error {
  min-height: 1.2em;
  color: #a4001d;
  font-size: 0.86rem;
}

.checkout-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  margin-top: 18px;
}

.checkout-terms input {
  margin-top: 4px;
}

.checkout-status {
  min-height: 1.4em;
  margin: 14px 0;

  color: #a4001d;
  font-weight: 700;
}

.checkout-submit,
.checkout-result__button {
  width: 100%;

  border: 0;
  border-radius: 12px;

  padding: 13px 18px;

  background: #1967d2;
  color: #ffffff;

  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.checkout-submit:disabled {
  opacity: 0.62;
  cursor: wait;
}

.checkout-notice {
  margin-top: 16px;
  padding: 12px 14px;

  border-radius: 12px;
  background: #fff4d6;
}

.checkout-result {
  text-align: center;
}

.checkout-result__code {
  display: block;

  margin: 18px 0 8px;

  font-size: 1.15rem;
  word-break: break-word;
}

.checkout-result__total {
  margin: 8px 0 18px;

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

.checkout-result__message {
  margin-bottom: 20px;
}

/* Ocultar la coordinación de retiro mientras no exista una URL válida. */
.checkout-result__whatsapp[hidden] {
  display: none !important;
}

@media (max-width: 650px) {
  .checkout-overlay {
    align-items: flex-start;
    padding: 12px;
  }

  .checkout-modal {
    max-height: none;
    padding: 18px;
    border-radius: 16px;
  }

  .checkout-form__grid {
    grid-template-columns: 1fr;
  }

  .checkout-field--full {
    grid-column: auto;
  }
}


/* ==============================
   CUENTA Y CÓDIGO DEL PEDIDO
============================== */

.checkout-account-message {
  margin: 0 0 18px;
  padding: 13px 15px;
  border-radius: 12px;
  font-weight: 700;
}

.checkout-account-message--registered {
  border: 1px solid #a6d5b6;
  background: #eaf8ef;
  color: #145a2b;
}

.checkout-account-message--guest {
  border: 2px solid #e0a000;
  background: #fff4cf;
  color: #6f4d00;
}

.checkout-save-profile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #edf5ff;
}

.checkout-save-profile input {
  margin-top: 4px;
}

.checkout-result__code-panel {
  margin: 18px 0;
  padding: 16px;
  border: 2px dashed #1967d2;
  border-radius: 14px;
  background: #f1f6ff;
}

.checkout-result__code {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 800;
}

.checkout-copy-code {
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  background: #0f5fbd;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.checkout-copy-status {
  display: block;
  min-height: 1.2em;
  margin-top: 8px;
  color: #145a2b;
  font-weight: 700;
}

.checkout-result__warning {
  margin: 0 0 20px;
  padding: 14px;
  border-radius: 12px;
  background: #fff0c2;
  color: #674600;
  font-weight: 800;
}

.login-status {
  min-height: 1.4em;
  margin: 12px 0;
  color: #a4001d;
  font-weight: 700;
}

/* ==============================
   ACCIONES DESPUÉS DE CREAR PEDIDO
============================== */

.checkout-result__actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.checkout-result__button--primary {
  background: #1967d2;
}

.checkout-result__button--primary:hover {
  background: #1259b7;
}

.checkout-result__button--secondary {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #26364d;
}

.checkout-result__button--secondary:hover {
  background: #f3f6fa;
}
