/* ZapPedido - Checkout moderno V5 Compacto
   Ajustes de apresentação. Mantém IDs, names, funções JS, cálculos e fluxo do pedido.
*/

body {
  background: #f4f5f7 !important;
}

.checkout-moderno {
  --checkout-width: 560px;
  max-width: var(--checkout-width);
  min-height: 100vh;
  margin: 0 auto;
  background: #f7f8fa;
  box-shadow: 0 0 28px rgba(18, 24, 40, .05);
}

/* Cabeçalho mais compacto */
.checkout-moderno > .navbar {
  width: min(100%, var(--checkout-width));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  min-height: 60px;
  padding: 7px 14px;
  background: rgba(255,255,255,.98) !important;
  border-bottom: 1px solid #eceef2;
  box-shadow: 0 5px 16px rgba(20, 24, 35, .05) !important;
  backdrop-filter: blur(10px);
}

.checkout-moderno .navbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #222831;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}

.checkout-moderno .navbar-brand img {
  width: 66px !important;
  max-width: 66px;
  max-height: 30px;
  object-fit: contain;
}

/* Estrutura compacta */
.checkout-moderno .accordion {
  margin-top: 60px !important;
  margin-bottom: 0 !important;
  height: auto !important;
  overflow: visible !important;
  padding: 12px 10px 92px;
  scrollbar-width: auto !important;
}

.checkout-moderno .accordion-item {
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e7e9ed !important;
  border-radius: 14px !important;
  box-shadow: 0 3px 10px rgba(16, 24, 40, .04);
}

.checkout-moderno .accordion-item:first-of-type,
.checkout-moderno .accordion-item:last-of-type {
  border-radius: 14px !important;
}

.checkout-moderno .accordion-button,
.checkout-moderno .accordion-item:first-of-type .accordion-button,
.checkout-moderno .accordion-item:last-of-type .accordion-button.collapsed {
  min-height: 46px;
  padding: 11px 14px;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff;
  color: #343941;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: .012em;
}

.checkout-moderno .accordion-button:not(.collapsed) {
  background: color-mix(in srgb, var(--zp-secondary) 70%, #fff) !important;
  color: var(--zp-primary) !important;
  box-shadow: inset 3px 0 0 var(--zp-primary) !important;
}

.checkout-moderno .accordion-button:focus {
  box-shadow: inset 3px 0 0 var(--zp-primary) !important;
}

.checkout-moderno .accordion-body {
  padding: 11px 13px 13px;
  color: #3d424a;
}

/* Identificação */
.checkout-moderno .checkout-identificacao {
  padding: 11px 13px 12px !important;
  text-align: left;
}

.checkout-identificacao-campos {
  display: grid;
  gap: 7px;
}

.checkout-campo-identificacao {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #e1e4e8;
  border-radius: 11px;
  background: #fff;
  cursor: text;
}

.checkout-campo-icone {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--zp-secondary) 78%, #fff);
  color: var(--zp-primary);
  font-size: 14px;
}

.checkout-campo-conteudo {
  min-width: 0;
  flex: 1;
}

.checkout-campo-conteudo small {
  display: block;
  margin-bottom: 0;
  color: #8b919a;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.checkout-moderno #telefone,
.checkout-moderno #nome {
  display: block;
  height: 22px !important;
  padding: 0 !important;
  background: transparent !important;
  color: #252a31 !important;
  font-size: 15px !important;
  font-weight: 700;
  line-height: 22px !important;
  box-shadow: none !important;
}

.checkout-moderno #telefone::placeholder,
.checkout-moderno #nome::placeholder {
  color: #a1a6ae !important;
  font-size: 14px !important;
  font-weight: 500;
}

.checkout-moderno #telefone:focus,
.checkout-moderno #nome:focus {
  outline: none;
  box-shadow: none !important;
}

.checkout-moderno .nome_user {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.checkout-confirmacao-identificacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #eef0f2;
}

.checkout-confirmacao-identificacao > span {
  color: #737983;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.checkout-confirmacao-acoes {
  display: flex;
  flex: 0 0 auto;
}

.checkout-moderno .botao_sim,
.checkout-moderno .botao_nao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 9px !important;
  box-shadow: none !important;
  font-size: 11px;
  font-weight: 800;
}

.checkout-moderno .botao_sim {
  background: var(--zp-button) !important;
  border-color: var(--zp-button) !important;
  color: var(--zp-button-text) !important;
}

.checkout-moderno .botao_nao {
  background: #fff !important;
  border: 1px solid #d9dde3 !important;
  color: #727780 !important;
}

/* Modo de entrega - uma linha por opção */
.checkout-entrega-opcoes {
  gap: 6px;
  padding: 0 !important;
}

.checkout-entrega-opcao {
  position: relative;
  min-height: 46px;
  padding: 7px 10px 7px 46px !important;
  border: 1px solid #e1e4e9 !important;
  border-radius: 11px !important;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.checkout-entrega-opcao:hover {
  border-color: color-mix(in srgb, var(--zp-primary) 45%, #d8dce2) !important;
}

.checkout-entrega-opcao:has(input:checked) {
  border-color: var(--zp-primary) !important;
  background: color-mix(in srgb, var(--zp-secondary) 68%, #fff) !important;
  box-shadow: 0 0 0 1px var(--zp-primary) inset;
}

.checkout-entrega-opcao::before {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--zp-secondary) 80%, #fff);
  font-size: 13px;
}

.checkout-retirar::before { content: "🏪"; }
.checkout-local::before { content: "🍽️"; }
.checkout-delivery::before { content: "🛵"; }

.checkout-entrega-opcao > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
  text-align: left;
  line-height: 1.2;
}

.checkout-entrega-opcao > span b {
  color: #2d3239;
  font-size: 12px;
}

.checkout-entrega-opcao > span small {
  display: none;
}

.checkout-entrega-opcao .form-check-input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
}

/* Endereço */
.checkout-moderno #collapseThree .group {
  margin-bottom: 6px;
}

.checkout-moderno #collapseThree .row {
  --bs-gutter-x: .7rem;
}

.checkout-moderno #collapseThree .input,
.checkout-moderno #collapse4 .input,
.checkout-moderno #collapse4 .form-control,
.checkout-moderno #collapseThree .form-control,
.checkout-moderno #collapseThree .form-select {
  border-radius: 9px;
}

.checkout-moderno #collapseThree button[title="Buscar Localização"] {
  width: 32px !important;
  height: 32px !important;
  border-radius: 9px;
  background: var(--zp-primary) !important;
}

.checkout-moderno .avancar-pgto .btn-success {
  border: 0;
  border-radius: 9px;
  padding: 8px 14px;
  background: var(--zp-button) !important;
  color: var(--zp-button-text) !important;
  font-size: 12px;
  font-weight: 700;
}

/* Pagamento */
.checkout-pagamento-opcoes {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 !important;
}

.checkout-pagamento-opcoes > div {
  width: auto !important;
  min-height: 48px;
  padding: 7px 9px !important;
  border: 1px solid #e1e4e9;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}

.checkout-pagamento-opcoes > div:has(input:checked) {
  border-color: var(--zp-primary);
  background: color-mix(in srgb, var(--zp-secondary) 68%, #fff);
  box-shadow: 0 0 0 1px var(--zp-primary) inset;
}

.checkout-pagamento-opcoes small {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: #3b4047;
  font-size: 12px;
  font-weight: 700;
}

.checkout-pagamento-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.checkout-pagamento-label i {
  color: var(--zp-primary);
  font-size: 14px;
}

.checkout-pagamento-opcoes .form-check-input {
  float: none;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
}

.checkout-detalhe-pagamento {
  margin-top: 8px !important;
  padding: 9px 10px;
  border: 1px solid #eaecf0;
  border-radius: 11px;
  background: #fafbfc;
}

.checkout-detalhe-titulo {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.checkout-detalhe-titulo > i {
  color: var(--zp-primary);
  font-size: 15px;
}

.checkout-detalhe-titulo > div {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.checkout-detalhe-titulo small {
  color: #8a9099;
  font-size: 9px;
}

.checkout-troco-campo {
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

.checkout-moderno #div_cupom.checkout-cupom {
  margin: 9px 0 0 !important;
  padding: 9px 10px;
  align-items: center;
  border: 1px solid #eaecf0;
  border-radius: 11px;
  background: #f8f9fb;
}

.checkout-moderno #div_cupom.checkout-cupom > small {
  display: block;
  margin-bottom: 6px;
  color: #393e46;
  font-size: 11px;
}

.checkout-moderno #div_cupom .col-md-2 {
  flex: 1 1 auto;
  width: auto;
}

.checkout-moderno #div_cupom .col-md-1 {
  flex: 0 0 44px;
  width: 44px;
}

.checkout-moderno #cupom {
  min-height: 38px;
}

.checkout-moderno #btn_cupom {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
}

.checkout-moderno #area-obs.checkout-observacao {
  margin: 10px 2px 2px !important;
}

/* Barra final compacta: total sempre visível + ação */
.checkout-resumo-fixo {
  position: fixed !important;
  right: auto !important;
  bottom: 0 !important;
  left: 50% !important;
  z-index: 1050;
  display: grid !important;
  grid-template-columns: minmax(112px, .72fr) minmax(180px, 1.28fr) !important;
  gap: 10px;
  align-items: center;
  width: min(100%, 560px) !important;
  transform: translateX(-50%);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.99);
  border-top: 1px solid #e8eaee;
  box-shadow: 0 -5px 18px rgba(17, 24, 39, .08);
  backdrop-filter: blur(10px);
}

.checkout-total-compacto {
  display: flex !important;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 2px;
}

.checkout-total-label {
  color: #7b818a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.1;
}

.checkout-total-valor {
  display: block !important;
  overflow: hidden;
  color: var(--zp-primary);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkout-resumo-dados {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.checkout-resumo-fixo .abaixo {
  position: relative;
  display: block !important;
  min-width: 0;
  margin: 0 !important;
}

.checkout-aviso-agendamento {
  margin: 0 0 4px;
  color: #6d28d9;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.checkout-resumo-fixo #botao_finalizar {
  min-height: 46px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--zp-button) !important;
  color: var(--zp-button-text) !important;
  box-shadow: 0 5px 12px color-mix(in srgb, var(--zp-button) 18%, transparent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.checkout-resumo-fixo #botao_finalizar.btn-secondary {
  background: #aeb3ba !important;
  color: #fff !important;
  box-shadow: none;
}

.checkout-resumo-fixo #div_img {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(255,255,255,.92);
}

/* Retorno visual da busca por localização */

.checkout-moderno .modal-header {
  background: var(--zp-primary) !important;
  color: #fff !important;
}

@media (max-width: 390px) {
  .checkout-moderno .accordion {
    padding-right: 8px;
    padding-left: 8px;
  }

  .checkout-moderno .accordion-body {
    padding-right: 10px;
    padding-left: 10px;
  }

  .checkout-confirmacao-identificacao {
    align-items: center;
    flex-direction: row;
  }

  .checkout-confirmacao-identificacao > span {
    max-width: 46%;
  }

  .checkout-moderno .botao_sim,
  .checkout-moderno .botao_nao {
    min-width: 96px;
  }

  .checkout-resumo-fixo {
    grid-template-columns: minmax(105px, .7fr) minmax(170px, 1.3fr) !important;
    gap: 8px;
  }

  .checkout-total-valor {
    font-size: 17px;
  }
}


/* V5 - Bairro obrigatório e endereço manual */
.checkout-moderno .checkout-bairro-col {
  margin-bottom: 6px;
}

.checkout-moderno .checkout-bairro-obrigatorio {
  min-height: 56px;
  padding: 5px 10px 6px;
  border: 1.5px solid color-mix(in srgb, var(--zp-primary) 45%, #d9dde3);
  border-radius: 10px;
  background: color-mix(in srgb, var(--zp-secondary) 42%, #fff);
}

.checkout-moderno .checkout-bairro-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin: 0;
  color: #2e343b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
}

.checkout-moderno .checkout-bairro-label small {
  color: var(--zp-primary);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.checkout-moderno .checkout-bairro-obrigatorio:focus-within {
  border-color: var(--zp-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--zp-primary) 12%, transparent);
}

.checkout-moderno .checkout-bairro-obrigatorio .select2-container {
  width: 100% !important;
}

.checkout-moderno .checkout-bairro-obrigatorio .select2-selection__rendered {
  color: #242930 !important;
}

/* V6 - refinamentos finais: orientação do telefone e resumo transparente do total */
.checkout-moderno .checkout-campo-identificacao[for="telefone"] {
  min-height: 60px;
}

.checkout-telefone-ajuda {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-top: 1px;
  color: #737983;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
}

.checkout-telefone-ajuda em {
  color: #9a9fa7;
  font-style: normal;
  font-weight: 500;
}

.checkout-resumo-fixo {
  grid-template-areas:
    "mini mini"
    "total acao" !important;
  row-gap: 4px;
}

.checkout-mini-resumo {
  grid-area: mini;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: #727780;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.checkout-mini-resumo span {
  flex: 0 0 auto;
}

.checkout-mini-resumo b {
  color: #444a52;
  font-weight: 800;
}

.checkout-total-compacto {
  grid-area: total;
}

.checkout-resumo-fixo .abaixo {
  grid-area: acao;
}

.checkout-moderno .accordion {
  padding-bottom: 108px;
}

/* Bairro obrigatório sem texto longo. */
.checkout-moderno .checkout-bairro-label small {
  font-size: 8.5px;
}

@media (max-width: 390px) {
  .checkout-mini-resumo {
    gap: 3px;
    font-size: 8.5px;
  }

  .checkout-moderno .accordion {
    padding-bottom: 106px;
  }
}

/* V7 - Pix manual compacto: titular + ação de copiar sem aumentar demais a etapa. */
.checkout-moderno #pagar_pix {
  margin-top: 9px !important;
}

.checkout-pix-compacto {
  padding: 9px 10px;
  border: 1px solid #e7eaee;
  border-radius: 11px;
  background: #fafbfc;
}

.checkout-pix-caption {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: #353b42;
  font-size: 11.5px;
  line-height: 1.15;
}

.checkout-pix-caption i {
  color: var(--zp-primary);
  font-size: 13px;
}

.checkout-pix-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.checkout-pix-chave {
  min-width: 0;
  color: #444a52;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.checkout-pix-chave b {
  color: #30353b;
  font-weight: 700;
}

.checkout-pix-copiar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--zp-primary) 35%, #dfe3e8);
  border-radius: 9px;
  background: color-mix(in srgb, var(--zp-secondary) 65%, #fff);
  color: var(--zp-primary);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.checkout-pix-copiar:active {
  transform: scale(.97);
}

.checkout-pix-copiar.copiado {
  border-color: var(--zp-primary);
  background: color-mix(in srgb, var(--zp-secondary) 82%, #fff);
}

.checkout-pix-titular {
  margin-top: 5px;
  color: #777e87;
  font-size: 10.5px;
  line-height: 1.2;
}

.checkout-pix-titular b {
  color: #5c636b;
  font-weight: 600;
}

@media (max-width: 380px) {
  .checkout-pix-copiar {
    padding-left: 7px;
    padding-right: 7px;
  }

  .checkout-pix-chave {
    font-size: 11.5px;
  }
}
