/* ============================================================
   🎨 CHECKOUT — FINALIZAÇÃO DO PEDIDO
============================================================ */

.checkout-page-section {
  min-height: 100vh;

  padding: 56px 20px 80px;

  background: #f8fafc;

  font-family: "Inter", sans-serif;

  box-sizing: border-box;
  overflow-x: hidden;
}

.checkout-container-fluid {
  width: 100%;
  max-width: 1120px;

  margin: 0 auto;

  box-sizing: border-box;
}

/* ============================================================
   CABEÇALHO
============================================================ */

.checkout-header-main {
  margin-bottom: 32px;
}

.btn-voltar-catalogo {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 16px;
  padding: 0;

  background: transparent;
  color: var(--cor-principal);

  border: none;

  font-size: 14px;
  font-weight: 700;
  text-decoration: none;

  cursor: pointer;

  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.btn-voltar-catalogo:hover {
  color: var(--cor-rosa);

  transform: translateX(-3px);
}

.checkout-header-main h2 {
  display: flex;
  align-items: center;
  gap: 12px;

  margin: 0 0 8px;

  color: var(--cor-texto-escuro);

  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  line-height: 1.2;
}

.checkout-header-main h2 i {
  color: var(--cor-principal);
}

.checkout-header-main p {
  max-width: 620px;

  margin: 0;

  color: var(--cor-texto-mutado);

  font-size: 15px;
  line-height: 1.6;
}

/* ============================================================
   GRID PRINCIPAL
============================================================ */

.checkout-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 28px;

  width: 100%;
  max-width: 100%;

  box-sizing: border-box;
}

@media (min-width: 992px) {
  .checkout-grid-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  }
}

/* ============================================================
   CARDS
============================================================ */

.checkout-card-box {
  width: 100%;
  max-width: 100%;

  padding: 28px;

  background: #ffffff;

  border: 1px solid var(--borda);
  border-radius: 20px;

  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);

  box-sizing: border-box;
}

.card-box-title {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 0 0 24px;
  padding-bottom: 15px;

  color: var(--cor-texto-escuro);

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

  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.card-box-title i {
  width: 36px;
  height: 36px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--cor-principal-light);
  color: var(--cor-principal);

  border-radius: 11px;

  font-size: 14px;
}

/* ============================================================
   FORMULÁRIO
============================================================ */

.form-group-modern {
  position: relative;

  margin-bottom: 22px;
}

.form-group-modern:last-child {
  margin-bottom: 0;
}

.form-group-modern label {
  display: flex;
  align-items: center;
  gap: 7px;

  margin-bottom: 8px;

  color: #475569;

  font-size: 13px;
  font-weight: 800;
}

.form-group-modern label i {
  width: 16px;

  color: var(--cor-principal);

  font-size: 12px;
  text-align: center;
}

.input-wrapper {
  position: relative;

  width: 100%;

  display: flex;
  align-items: center;
}

.form-group-modern input,
.form-group-modern select,
.form-group-modern textarea {
  width: 100%;

  padding: 14px 44px 14px 15px;

  background: #f8fafc;
  color: var(--cor-texto-escuro);

  border: 1px solid #cbd5e1;
  border-radius: 13px;

  font-family: inherit;
  font-size: 14px;
  font-weight: 500;

  box-sizing: border-box;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-group-modern textarea {
  min-height: 110px;

  resize: vertical;
}

.form-group-modern input::placeholder,
.form-group-modern textarea::placeholder {
  color: #94a3b8;
}

.form-group-modern input:hover,
.form-group-modern select:hover,
.form-group-modern textarea:hover {
  border-color: #94a3b8;
}

.form-group-modern input:focus,
.form-group-modern select:focus,
.form-group-modern textarea:focus {
  outline: none;

  background: #ffffff;

  border-color: var(--cor-principal);

  box-shadow: 0 0 0 4px rgba(0, 163, 224, 0.1);
}

/* ============================================================
   ÍCONES DE VALIDAÇÃO
============================================================ */

.feedback-icon {
  position: absolute;
  top: 50%;
  right: 15px;

  display: none;

  font-size: 15px;

  pointer-events: none;

  transform: translateY(-50%);
}

.success-icon {
  color: #16a34a;
}

.error-icon {
  color: #dc2626;
}

.form-feedback {
  display: none;

  margin-top: 7px;

  color: #dc2626;

  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

/* ============================================================
   ESTADOS DO FORMULÁRIO
============================================================ */

.form-group-modern.success input,
.form-group-modern.success select,
.form-group-modern.success textarea {
  background: #f0fdf4;

  border-color: #22c55e;
}

.form-group-modern.success .success-icon {
  display: block;
}

.form-group-modern.error input,
.form-group-modern.error select,
.form-group-modern.error textarea {
  background: #fff1f2;

  border-color: #ef4444;
}

.form-group-modern.error .error-icon {
  display: block;
}

.form-group-modern.error .form-feedback {
  display: block;
}

/* ============================================================
   LISTA DO RESUMO
============================================================ */

.summary-items-list {
  max-height: 420px;

  display: flex;
  flex-direction: column;
  gap: 12px;

  padding-right: 5px;

  overflow-x: hidden;
  overflow-y: auto;
}

.summary-items-list::-webkit-scrollbar {
  width: 5px;
}

.summary-items-list::-webkit-scrollbar-track {
  background: transparent;
}

.summary-items-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;

  border-radius: 999px;
}

/* ============================================================
   ITEM DO RESUMO
============================================================ */

.checkout-summary-item {
  width: 100%;

  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;

  padding: 13px;

  background: #f8fafc;

  border: 1px solid var(--borda);
  border-radius: 15px;

  box-sizing: border-box;
}

.summary-item-left {
  display: contents;
}

.summary-item-thumb {
  position: relative;

  width: 58px;
  min-width: 58px;
  height: 58px;

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

  overflow: hidden;

  background: #ffffff;

  border: 1px solid var(--borda);
  border-radius: 12px;

  box-sizing: border-box;
}

/* ============================================================
   IMAGEM ÚNICA DO RESUMO
============================================================ */

.summary-thumb-single {
  width: 100%;
  height: 100%;

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

  overflow: hidden;
}

.summary-thumb-single img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
  object-position: center;
}

/* ============================================================
   MOSAICO DE OFERTAS E COMBOS
============================================================ */

.summary-combo-images {
  position: relative;

  width: 100%;
  height: 100%;

  display: grid;

  gap: 2px;

  overflow: hidden;

  background: #e2e8f0;
}

.summary-combo-image-item {
  position: relative;

  min-width: 0;
  min-height: 0;

  overflow: hidden;

  background: #f1f5f9;
}

.summary-combo-image-item img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
  object-position: center;
}

.summary-combo-images-1 {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.summary-combo-images-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.summary-combo-images-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.summary-combo-images-3 .summary-combo-position-1 {
  grid-row: 1 / span 2;
}

.summary-combo-images-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.summary-thumb-placeholder {
  width: 100%;
  height: 100%;

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

  background: #f1f5f9;
  color: #94a3b8;

  font-size: 18px;
}

.summary-combo-more {
  position: absolute;
  right: 4px;
  bottom: 4px;

  min-width: 22px;
  height: 22px;

  padding: 0 6px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;

  border-radius: 999px;

  font-size: 10px;
  font-weight: 900;
  line-height: 1;

  z-index: 3;
}

.summary-item-details {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 5px;
}

.summary-item-name {
  display: -webkit-box;

  margin: 0;

  overflow: hidden;

  color: var(--cor-texto-escuro);

  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;

  overflow-wrap: anywhere;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.summary-item-qty {
  color: var(--cor-texto-mutado);

  font-size: 12px;
  font-weight: 600;
}

.summary-item-dates {
  color: var(--cor-principal);

  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;

  overflow-wrap: anywhere;
}

.summary-item-right {
  grid-column: 2;

  min-width: 0;

  padding-top: 8px;
  margin-top: 3px;

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

  text-align: right;
}

.summary-item-right strong {
  color: var(--cor-texto-escuro);

  font-size: 15px;
  font-weight: 900;

  white-space: nowrap;
}

/* ============================================================
   DIVISOR
============================================================ */

.summary-divider {
  margin: 24px 0;

  border: none;
  border-top: 1px dashed #cbd5e1;
}

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

.summary-total-box {
  display: flex;
  flex-direction: column;
  gap: 12px;

  margin-bottom: 24px;
}

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

  color: var(--cor-texto-mutado);

  font-size: 13px;
  font-weight: 600;
}

.subtotal-val {
  color: var(--cor-texto-escuro);

  font-weight: 800;

  white-space: nowrap;
}

.total-row.main-total {
  margin-top: 4px;
  padding-top: 16px;

  color: var(--cor-texto-escuro);

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

  font-size: 15px;
  font-weight: 800;
}

.total-row.main-total strong {
  color: var(--cor-principal);

  font-size: 25px;
  font-weight: 900;
  line-height: 1;

  white-space: nowrap;
}

/* ============================================================
   BOTÃO FINALIZAR
============================================================ */

.finish-order-btn {
  width: 100%;
  min-height: 56px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 14px 20px;

  background: var(--cor-rosa);
  color: #ffffff;

  border: none;
  border-radius: 15px;

  box-shadow: 0 12px 25px rgba(236, 72, 153, 0.2);

  font-family: inherit;
  font-size: 15px;
  font-weight: 900;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.finish-order-btn:hover {
  background: #db2777;

  box-shadow: 0 16px 30px rgba(236, 72, 153, 0.28);

  transform: translateY(-2px);
}

.finish-order-btn:active {
  transform: translateY(0);
}

.finish-order-btn:disabled {
  background: #cbd5e1;
  color: #ffffff;

  box-shadow: none;

  cursor: not-allowed;

  opacity: 0.7;

  transform: none;
}

.finish-order-btn i {
  transition: transform 0.2s ease;
}

.finish-order-btn:hover i {
  transform: translateX(3px);
}

/* ============================================================
   RESUMO FIXO NO DESKTOP
============================================================ */

@media (min-width: 992px) {
  .sticky-summary {
    position: sticky;
    top: 28px;
  }
}

/* ============================================================
   TABLET
============================================================ */

@media (max-width: 991px) {
  .checkout-page-section {
    padding: 45px 18px 65px;
  }

  .checkout-card-box {
    padding: 24px;
  }

  .summary-items-list {
    max-height: none;
  }
}

/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 600px) {
  .checkout-page-section {
    padding: 32px 12px 50px;
  }

  .checkout-header-main {
    margin-bottom: 24px;
  }

  .checkout-header-main h2 {
    align-items: flex-start;

    font-size: 24px;
  }

  .checkout-header-main p {
    font-size: 14px;
  }

  .checkout-grid-layout {
    gap: 18px;
  }

  .checkout-card-box {
    padding: 18px;

    border-radius: 17px;
  }

  .card-box-title {
    margin-bottom: 20px;

    font-size: 16px;
  }

  .card-box-title i {
    width: 32px;
    height: 32px;
  }

  .form-group-modern {
    margin-bottom: 18px;
  }

  .form-group-modern input,
  .form-group-modern select,
  .form-group-modern textarea {
    padding: 13px 42px 13px 14px;

    font-size: 14px;
  }

  .checkout-summary-item {
    grid-template-columns: 52px minmax(0, 1fr);

    padding: 11px;
  }

  .summary-item-thumb {
    width: 52px;
    min-width: 52px;
    height: 52px;
  }

  .summary-item-name {
    font-size: 13px;
  }

  .summary-item-right strong {
    font-size: 14px;
  }

  .total-row.main-total strong {
    font-size: 22px;
  }

  .finish-order-btn {
    min-height: 52px;

    font-size: 14px;
  }
}

/* ============================================================
   CELULARES PEQUENOS
============================================================ */

@media (max-width: 360px) {
  .checkout-card-box {
    padding: 15px;
  }

  .checkout-summary-item {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 9px;
  }

  .summary-item-thumb {
    width: 46px;
    min-width: 46px;
    height: 46px;
  }

  .total-row.main-total {
    align-items: flex-end;
  }

  .total-row.main-total strong {
    font-size: 20px;
  }
}


/* ============================================================
   BADGES DE TIPO — BRINQUEDO, OFERTA E COMBO
============================================================ */

.summary-offer-badge,
.summary-toy-badge {
  width: fit-content;

  display: inline-flex;
  align-items: center;

  gap: 5px;

  padding: 5px 8px;

  border-radius: 999px;

  font-size: 9px;
  font-weight: 850;
  line-height: 1;

  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-offer-badge {
  background:
    var(--cor-principal-light);

  color:
    var(--cor-principal);

  border:
    1px solid
    rgba(0, 163, 224, 0.18);
}

.summary-combo-badge {
  background:
    linear-gradient(
      135deg,
      #f5f3ff,
      #ede9fe
    );

  color: #7c3aed;

  border-color: #ddd6fe;
}

.summary-toy-badge {
  background: #f1f5f9;

  color: #475569;

  border:
    1px solid
    #e2e8f0;
}


/* ============================================================
   CARD DE OFERTA E COMBO
============================================================ */

.checkout-summary-offer {
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #fbfdff 100%
    );

  border-color:
    rgba(0, 163, 224, 0.2);
}

.checkout-summary-combo {
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #fcfbff 100%
    );

  border-color:
    rgba(124, 58, 237, 0.22);
}


/* ============================================================
   BRINQUEDOS INCLUÍDOS
============================================================ */

.summary-offer-items {
  margin-top: 4px;
  padding: 10px;

  background: #ffffff;

  border:
    1px solid
    #e2e8f0;

  border-radius: 11px;
}

.summary-offer-items-title {
  display: inline-flex;
  align-items: center;

  gap: 6px;

  margin-bottom: 8px;

  color: #64748b;

  font-size: 9px;
  font-weight: 850;

  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-offer-items-list {
  display: flex;
  flex-direction: column;

  gap: 6px;
}

.summary-offer-item {
  display: flex;
  align-items: flex-start;

  gap: 6px;

  color:
    var(--cor-texto-escuro);

  font-size: 10px;
  font-weight: 650;
  line-height: 1.4;
}

.summary-offer-item i {
  width: 16px;
  height: 16px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  margin-top: 1px;

  background: #dcfce7;
  color: #15803d;

  border-radius: 999px;

  font-size: 8px;
}


/* ============================================================
   BLOCO DE PREÇOS PROMOCIONAIS
============================================================ */

.summary-offer-price-details {
  width: 100%;

  display: flex;
  flex-direction: column;

  gap: 6px;

  margin-top: 3px;
  padding: 10px 11px;

  background:
    linear-gradient(
      135deg,
      rgba(0, 163, 224, 0.07),
      rgba(236, 72, 153, 0.04)
    );

  border:
    1px solid
    rgba(0, 163, 224, 0.14);

  border-radius: 11px;
}

.summary-original-price,
.summary-discount-value,
.summary-promotional-price {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  font-size: 10px;
  line-height: 1.35;
}

.summary-original-price {
  color: #94a3b8;

  font-weight: 650;
}

.summary-original-price del {
  font-weight: 750;

  text-decoration-thickness: 1px;
}

.summary-discount-value {
  color: #15803d;

  font-weight: 850;
}

.summary-promotional-price {
  margin-top: 2px;
  padding-top: 6px;

  color: #475569;

  border-top:
    1px dashed
    rgba(148, 163, 184, 0.45);

  font-weight: 750;
}

.summary-promotional-price strong {
  color:
    var(--cor-principal);

  font-size: 13px;
  font-weight: 900;
}

.summary-item-unit-price {
  color:
    var(--cor-principal);

  font-size: 11px;
  font-weight: 750;
}


/* ============================================================
   LINHA DE DESCONTO TOTAL
============================================================ */

.summary-discount-row {
  padding: 9px 11px;

  background: #f0fdf4;

  color: #15803d;

  border:
    1px solid
    #bbf7d0;

  border-radius: 10px;

  font-weight: 800;
}

.summary-discount-row
#summaryDiscount {
  color: #15803d;

  font-weight: 900;

  white-space: nowrap;
}


/* ============================================================
   TOTAL DO ITEM PROMOCIONAL
============================================================ */

.checkout-summary-offer
.summary-item-right small {
  color: #64748b;

  font-size: 9px;
  font-weight: 750;

  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkout-summary-offer
.summary-item-right strong {
  color:
    var(--cor-principal);
}


/* ============================================================
   MOBILE — OFERTA E COMBO
============================================================ */

@media (max-width: 600px) {
  .summary-offer-price-details {
    padding: 9px;

    gap: 5px;
  }

  .summary-original-price,
  .summary-discount-value,
  .summary-promotional-price {
    font-size: 9px;
  }

  .summary-promotional-price strong {
    font-size: 12px;
  }

  .summary-offer-items {
    padding: 9px;
  }

  .summary-offer-item {
    font-size: 9px;
  }

  .summary-discount-row {
    padding: 8px 9px;
  }
}


/* ============================================================
   CELULARES PEQUENOS — QUEBRA CONTROLADA
============================================================ */

@media (max-width: 360px) {
  .summary-original-price,
  .summary-discount-value,
  .summary-promotional-price {
    align-items: flex-start;
    flex-direction: column;

    gap: 2px;
  }

  .summary-promotional-price strong {
    align-self: flex-end;
  }
}


/* ============================================================
   ENTREGA POR DISTÂNCIA / AUTOCOMPLETE
============================================================ */

.delivery-address-wrapper {
  position: relative;
}

.delivery-address-suggestions {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 80;

  display: none;
  max-height: 280px;
  overflow-y: auto;

  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.delivery-address-suggestions.is-visible {
  display: block;
}

.delivery-address-option {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;

  color: #334155;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #f1f5f9;

  text-align: left;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}

.delivery-address-option:last-child {
  border-bottom: 0;
}

.delivery-address-option:hover {
  background: #f8fafc;
}

.delivery-address-option i {
  margin-top: 2px;
  color: var(--cor-principal);
  flex-shrink: 0;
}

.delivery-info-box {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-top: 12px;
  padding: 12px 13px;

  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.delivery-info-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;

  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
}

.delivery-info-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.delivery-info-content strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 850;
}

.delivery-info-content span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.delivery-info-box.is-free {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.delivery-info-box.is-free .delivery-info-icon {
  background: #dcfce7;
  color: #15803d;
}

.delivery-info-box.has-fee {
  background: #fffbeb;
  border-color: #fde68a;
}

.delivery-info-box.has-fee .delivery-info-icon {
  background: #fef3c7;
  color: #a16207;
}

.delivery-info-box.has-error {
  background: #fef2f2;
  border-color: #fecaca;
}

.delivery-info-box.has-error .delivery-info-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.summary-delivery-row {
  padding: 9px 11px;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-weight: 800;
}

.summary-delivery-row #summaryDelivery {
  white-space: nowrap;
  font-weight: 900;
}
