/* Mercado Livre–style cart & checkout */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.ml-app {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #ededed;
  color: rgba(0,0,0,.9);
  min-height: 100vh;
  padding-bottom: 120px;
}

.ml-header {
  background: #fff159;
  position: sticky;
  top: 0;
  z-index: 100;
}
.ml-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 56px;
}
.ml-back {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  color: #333;
}
.ml-header-title {
  font-size: 1.05rem;
  font-weight: 400;
  color: #333;
  flex: 1;
}
.ml-header-title.bold { font-weight: 600; font-size: 1.15rem; }

.ml-location {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 10px;
  font-size: .78rem;
  color: #666;
}
.ml-location svg { flex-shrink: 0; color: #666; }

.ml-page { max-width: 480px; margin: 0 auto; }

.ml-card {
  background: #fff;
  margin-bottom: 8px;
}
.ml-card-pad { padding: 16px; }

.ml-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  font-size: .9rem;
}
.ml-check-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: #3483fa;
}

.ml-full-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: .88rem;
  color: #333;
}
.ml-full-bar img { height: 18px; object-fit: contain; }
.ml-full-fallback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #00a650;
  font-weight: 700;
  font-size: .82rem;
}

.ml-item {
  display: grid;
  grid-template-columns: 24px 92px 1fr auto;
  gap: 0 12px;
  padding: 16px 14px 16px 12px;
  border-bottom: 1px solid #eee;
  align-items: start;
}
.ml-item-check-col {
  width: 18px;
  height: 18px;
  accent-color: #3483fa;
  align-self: center;
  margin-top: 18px;
}
.ml-item-thumb-wrap {
  width: 92px;
  height: 92px;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.ml-item-thumb {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.ml-item-info {
  min-width: 0;
  padding-top: 2px;
  padding-right: 4px;
}
.ml-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 112px;
  max-width: 130px;
}
.ml-item-body { flex: 1; min-width: 0; }
.ml-item-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ml-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.ml-badge-fire { background: #fff3e0; color: #e65100; }
.ml-badge-offer { background: #e3f2fd; color: #1565c0; }
.ml-item-title {
  font-size: .84rem;
  color: rgba(0,0,0,.75);
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ml-qty-select {
  margin-top: 2px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 28px 6px 10px;
  font-size: .82rem;
  background: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.ml-item-prices {
  width: 100%;
  text-align: right;
  margin-top: 4px;
}
.ml-price-old-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}
.ml-price-old { font-size: .76rem; color: #999; text-decoration: line-through; white-space: nowrap; }
.ml-price-off {
  display: inline-block;
  background: #00a650;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.ml-price-current {
  font-size: 1.45rem;
  font-weight: 400;
  color: #333;
  line-height: 1.15;
  text-align: right;
  letter-spacing: -.02em;
}
.ml-price-drop {
  font-size: .76rem;
  color: #00a650;
  margin-top: 4px;
  text-align: right;
}
.ml-item-trash {
  background: none;
  border: none;
  color: #c5c5c5;
  cursor: pointer;
  padding: 2px;
  margin-bottom: 6px;
  line-height: 0;
}

.ml-summary {
  background: #fff;
  padding: 16px;
  margin-bottom: 8px;
}
.ml-sum-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .88rem;
  color: #666;
  margin-bottom: 8px;
  gap: 16px;
}
.ml-sum-line > span:first-child { flex: 1; }
.ml-sum-val {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #333;
}
.ml-sum-line .green { color: #00a650; font-weight: 600; }
.ml-sum-line .strike { text-decoration: line-through; color: #999; margin-right: 6px; }
.ml-coupon-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3483fa;
  font-size: .88rem;
  margin: 12px 0;
  cursor: pointer;
  background: none; border: none;
  padding: 0;
}
.ml-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1px solid #eee;
  gap: 16px;
}
.ml-total-row .lbl { font-size: 1rem; font-weight: 600; flex: 1; }
.ml-total-row .amt {
  font-size: 1.55rem;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ml-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  padding: 12px 16px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
  z-index: 200;
}
.ml-footer-inner { max-width: 480px; margin: 0 auto; }
.ml-urgency-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #c62828;
  color: #fff;
  margin: -12px -16px 12px;
  padding: 10px 16px;
  font-size: .82rem;
  font-weight: 600;
}
.ml-urgency-bar .timer {
  color: #ffe600;
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.ml-btn-primary {
  width: 100%;
  background: #3483fa;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.ml-btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.ml-btn-secondary {
  flex: 1;
  background: rgba(52,131,250,.12);
  color: #3483fa;
  border: none;
  border-radius: 6px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.ml-btn-row { display: flex; gap: 10px; }

.ml-loading-screen {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ml-loading-screen h2 {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  margin-bottom: 28px;
  max-width: 280px;
}
.ml-spinner {
  width: 40px; height: 40px;
  border: 3px solid #e8e8e8;
  border-top-color: #3483fa;
  border-radius: 50%;
  animation: mlspin .8s linear infinite;
}
@keyframes mlspin { to { transform: rotate(360deg); } }

.ml-screen { display: none; min-height: calc(100vh - 56px); }
.ml-screen.active { display: block; }
.ml-form-wrap { padding: 20px 16px 100px; max-width: 480px; margin: 0 auto; }
.ml-form-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 20px; color: #333; }
.ml-field { margin-bottom: 16px; }
.ml-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}
.ml-field input, .ml-field select {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  font-size: .95rem;
  background: #fff;
}
.ml-field input:focus { outline: none; border-color: #3483fa; box-shadow: 0 0 0 2px rgba(52,131,250,.15); }
.ml-field input.error { border-color: #f44336; }
.ml-field-row { display: flex; gap: 12px; align-items: flex-start; }
.ml-field-row .ml-field { flex: 1; }
.ml-link { color: #3483fa; font-size: .82rem; text-decoration: none; }
.ml-hint { font-size: .78rem; color: #666; margin-bottom: 16px; line-height: 1.45; }
.ml-section-title { font-size: 1rem; font-weight: 600; margin: 24px 0 8px; }

.ml-ship-card {
  background: #fff;
  border-radius: 8px;
  margin: 0 16px 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ml-ship-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  font-size: .88rem;
  font-weight: 600;
  gap: 12px;
}
.ml-ship-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ml-ship-envio { font-weight: 600; color: #333; white-space: nowrap; }
.ml-ship-full-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
  display: block;
}
.ml-ship-thumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.ml-ship-thumbs img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: #fafafa;
  border: 1px solid #eee;
  padding: 2px;
}
.ml-ship-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.ml-ship-option:last-child { border-bottom: none; }
.ml-ship-option input { margin-top: 4px; accent-color: #3483fa; }
.ml-ship-option-body { flex: 1; }
.ml-ship-option-title { font-size: .92rem; font-weight: 600; margin-bottom: 4px; }
.ml-ship-option-desc { font-size: .82rem; color: #666; }
.ml-ship-option-price { text-align: right; font-size: .88rem; }
.ml-ship-option-price .free { color: #00a650; font-weight: 700; }

.ml-warranty-wrap { padding: 20px 16px 100px; max-width: 480px; margin: 0 auto; }
.ml-warranty-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ml-warranty-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.ml-warranty-head h3 { font-size: 1rem; font-weight: 700; }
.ml-warranty-price { font-size: 1rem; font-weight: 600; text-align: right; }
.ml-warranty-price small { font-size: .75rem; font-weight: 400; color: #666; }
.ml-warranty-list { list-style: none; margin-bottom: 12px; }
.ml-warranty-list li {
  display: flex;
  gap: 10px;
  font-size: .88rem;
  color: #333;
  margin-bottom: 10px;
  line-height: 1.4;
}
.ml-warranty-list svg { flex-shrink: 0; color: #3483fa; margin-top: 2px; }
.ml-warranty-terms { font-size: .75rem; color: #666; text-align: center; margin-top: 16px; line-height: 1.45; }

.ml-review-wrap { padding: 16px 16px 120px; max-width: 480px; margin: 0 auto; }
.ml-review-block { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.ml-review-block h3 { font-size: .95rem; font-weight: 600; margin-bottom: 12px; }
.ml-review-line {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  margin-bottom: 8px;
  color: #666;
}
.ml-review-line .neg { color: #00a650; }
.ml-review-line .bold { font-weight: 600; color: #333; }
.ml-review-total {
  border-top: 1px solid #eee;
  padding-top: 12px;
  margin-top: 8px;
}
.ml-review-total .big { font-size: 1.4rem; font-weight: 600; }
.ml-review-save { color: #00a650; font-size: .82rem; margin-top: 4px; }
.ml-review-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid #f0f0f0;
  font-size: .85rem;
}
.ml-review-card svg { flex-shrink: 0; color: #666; }
.ml-pix-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0 4px;
}
.ml-pix-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid #f0f0f0;
}
.ml-pix-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ml-pix-icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}
.ml-pix-card-body { flex: 1; min-width: 0; }
.ml-pix-card-title {
  font-size: .95rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.35;
}
.ml-pix-note { font-size: .78rem; color: #666; line-height: 1.45; margin-top: 4px; }
.ml-pix-urgency { display: flex; align-items: center; gap: 4px; margin-top: 8px; color: #888; }

.ml-pix-screen { padding: 16px; max-width: 480px; margin: 0 auto; }
.ml-qr-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  margin-bottom: 12px;
}
.ml-qr-wrap #qrcode-container { display: inline-block; margin: 16px auto; }
.ml-pix-code {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  font-size: .75rem;
  margin: 12px 0;
  text-align: center;
}
.ml-empty { text-align: center; padding: 48px 24px; color: #666; }
.ml-empty a { color: #3483fa; }
.hidden { display: none !important; }
