/* ============================================================
   Cielo — pre-checkout upsell popup
   Sits above the cart drawer (z 1000). Brand: navy #335572 / sky #67A2D7.
   ============================================================ */

.cielo-upsell {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}
.cielo-upsell.is-open { visibility: visible; pointer-events: auto; }
html.cielo-upsell-open, html.cielo-upsell-open body { overflow: hidden; }

.cielo-upsell-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 58, 91, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cielo-upsell.is-open .cielo-upsell-backdrop { opacity: 1; }

.cielo-upsell-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 26, 36, 0.28);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  color: #335572;
  font-family: inherit;
}
.cielo-upsell.is-open .cielo-upsell-card { transform: none; opacity: 1; }

.cielo-upsell-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(51, 85, 114, 0.15);
  background: #fff;
  color: #335572;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  z-index: 2;
}
.cielo-upsell-close:hover { background: rgba(51, 85, 114, 0.05); border-color: #335572; }

.cielo-upsell-head { padding: 26px 28px 8px; flex-shrink: 0; }
.cielo-upsell-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: rgba(103, 162, 215, 0.14);
  color: #2f6fa8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cielo-upsell-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #67A2D7;
  box-shadow: 0 0 0 3px rgba(103, 162, 215, 0.25);
}
.cielo-upsell-head h2 {
  margin: 0 40px 6px 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #335572;
}
.cielo-upsell-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(51, 85, 114, 0.7);
}

.cielo-upsell-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 28px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- product row ---- */
.cu-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border: 1.5px solid rgba(51, 85, 114, 0.12);
  border-radius: 16px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cu-row.is-added { border-color: rgba(103, 162, 215, 0.6); box-shadow: 0 0 0 3px rgba(103, 162, 215, 0.12); }

.cu-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #E8EEF1, #F2F6F8);
}
.cu-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cu-name { font-size: 16px; font-weight: 500; color: #335572; line-height: 1.3; }

/* ---- tier tiles (compact version of the product-page tiles) ---- */
.cu-tiers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.cu-tier {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 9px 4px 8px;
  border-radius: 12px;
  border: 1.5px solid rgba(51, 85, 114, 0.15);
  background: #fff;
  color: #335572;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.cu-tier:hover { border-color: rgba(51, 85, 114, 0.55); }
.cu-tier.is-active {
  border-color: #335572;
  background: #335572;
  color: #fff;
  box-shadow: 0 6px 18px rgba(51, 85, 114, 0.22);
}
.cu-tier-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: #67A2D7;
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.cu-tier.is-active .cu-tier-badge { background: #67A2D7; }
.cu-tier-multi { font-size: 16px; font-weight: 500; line-height: 1; }
.cu-tier-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(51, 85, 114, 0.65);
  white-space: nowrap;
}
.cu-tier.is-active .cu-tier-label { color: rgba(255, 255, 255, 0.7); }
.cu-tier-price { font-size: 13px; font-weight: 500; line-height: 1.2; }
.cu-tier-note { display: block; font-size: 10px; font-weight: 400; color: #67A2D7; }
.cu-tier.is-active .cu-tier-note { color: rgba(255, 255, 255, 0.8); }

/* ---- qty + add ---- */
.cu-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cu-qty {
  display: inline-flex;
  align-items: center;
  height: 40px;
  border: 1.5px solid rgba(51, 85, 114, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.cu-qty.is-locked { opacity: 0.55; }
.cu-qty-btn {
  width: 36px;
  height: 100%;
  border: 0;
  background: none;
  color: #335572;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.cu-qty-btn:disabled { cursor: not-allowed; color: rgba(51, 85, 114, 0.4); }
.cu-qty-btn:not(:disabled):hover { background: rgba(51, 85, 114, 0.05); }
.cu-qty-n {
  width: 44px;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-family: inherit;
  color: #335572;
  -moz-appearance: textfield;
}
.cu-qty-n::-webkit-outer-spin-button, .cu-qty-n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cu-add {
  flex: 1 1 auto;
  min-width: 140px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #335572;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s;
}
.cu-add:hover { opacity: 0.9; }
.cu-add.is-busy { opacity: 0.7; cursor: progress; }
.cu-add.is-done { background: #16a34a; }

.cu-msg { font-size: 12px; min-height: 0; color: rgba(51, 85, 114, 0.7); }
.cu-msg:empty { display: none; }
.cu-msg.is-error { color: #c0392b; }

/* ---- foot ---- */
.cielo-upsell-foot {
  flex-shrink: 0;
  padding: 14px 28px 24px;
  border-top: 1px solid rgba(51, 85, 114, 0.08);
  margin-top: 6px;
}
.cielo-upsell-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border-radius: 999px;
  background: #335572;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}
.cielo-upsell-checkout:hover { opacity: 0.9; color: #fff; }

/* ---- mobile ---- */
@media (max-width: 560px) {
  .cielo-upsell { padding: 0; align-items: flex-end; }
  .cielo-upsell-card {
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 22px 22px 0 0;
    transform: translateY(24px);
  }
  .cielo-upsell-head { padding: 22px 18px 6px; }
  .cielo-upsell-head h2 { font-size: 19px; }
  .cielo-upsell-body { padding: 8px 14px 4px; }
  .cielo-upsell-foot { padding: 12px 14px 18px; }
  .cu-row { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .cu-thumb { width: 56px; height: 56px; }
  .cu-main { flex-basis: 100%; }
  .cu-name { margin-top: -60px; margin-left: 66px; min-height: 56px; display: flex; align-items: center; }
  .cu-tiers { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .cu-tier { padding: 8px 2px 7px; border-radius: 10px; }
  .cu-tier-price { font-size: 12px; }
  .cu-add { min-width: 0; }
}
