/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Montserrat', 'Inter', sans-serif;
  background: #0a0a0a;
  color: #fff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ===== TOP BAR ===== */
.checkout-topbar {
  background: #7a0d8f;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
}

/* ===== HEADER ===== */
.checkout-header {
  background: #111;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.checkout-header img {
  height: 36px;
  width: auto;
}

.checkout-header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

/* ===== LAYOUT ===== */
.checkout-wrapper {
  max-width: 520px;
  margin: 32px auto;
  padding: 0 16px 60px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: linear-gradient(135deg, rgba(122,13,143,0.18), rgba(90,10,106,0.10));
  border: 1px solid rgba(122,13,143,0.4);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.product-icon {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.product-info { flex: 1; }

.product-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.product-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-price-old {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  text-decoration: line-through;
}

.product-price-new {
  font-size: 1.1rem;
  font-weight: 900;
  color: #00e676;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 12px;
  margin-top: 24px;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input::placeholder { color: rgba(255,255,255,0.3); }

.form-input:focus {
  border-color: #7a0d8f;
  box-shadow: 0 0 0 3px rgba(122,13,143,0.15);
}

.form-input.error {
  border-color: #ff4444;
}

.form-error {
  font-size: 0.72rem;
  color: #ff6b6b;
  margin-top: 4px;
  display: none;
}

.form-error.visible { display: block; }

/* Phone row */
.phone-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* ===== PAYMENT METHODS ===== */
.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.payment-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: #1a1a1a;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  transition: all 0.25s;
  user-select: none;
}

.payment-tab:hover {
  border-color: rgba(122,13,143,0.5);
  color: rgba(255,255,255,0.7);
}

.payment-tab.active {
  border-color: #7a0d8f;
  background: rgba(122,13,143,0.12);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(122,13,143,0.15);
}

.payment-tab svg { flex-shrink: 0; }

/* ===== PIX PANEL ===== */
.pix-panel {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
}

.pix-panel .pix-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(0, 178, 122, 0.12);
  border-radius: 50%;
  margin-bottom: 12px;
}

.pix-info-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.pix-info-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
}

.pix-steps {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.pix-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
}

.pix-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #7a0d8f;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

/* ===== CARD PANEL ===== */
.card-panel {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  display: none;
}

.card-panel.visible { display: block; }

.card-number-wrap {
  position: relative;
  margin-bottom: 12px;
}

.card-flag {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  pointer-events: none;
}

.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.select-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 14px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-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='rgba(255,255,255,0.4)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.select-input:focus {
  border-color: #7a0d8f;
  box-shadow: 0 0 0 3px rgba(122,13,143,0.15);
}

.installments-wrap {
  position: relative;
}

.installments-select {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #fff;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-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='rgba(255,255,255,0.4)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.installments-select:focus {
  border-color: #7a0d8f;
  box-shadow: 0 0 0 3px rgba(122,13,143,0.15);
}

/* ===== COUPON ===== */
.coupon-toggle {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: #c44dd6;
  cursor: pointer;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.coupon-toggle:hover { text-decoration: underline; }

.coupon-row {
  display: none;
  gap: 10px;
  margin-bottom: 16px;
}

.coupon-row.visible { display: flex; }

.coupon-btn {
  background: rgba(122,13,143,0.2);
  border: 1px solid rgba(122,13,143,0.4);
  color: #c44dd6;
  border-radius: 8px;
  padding: 0 18px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.coupon-btn:hover {
  background: rgba(122,13,143,0.35);
}

/* ===== SECURITY BADGE ===== */
.security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  margin-bottom: 20px;
}

/* ===== ORDER SUMMARY ===== */
.order-summary {
  background: #111;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  padding: 6px 0;
}

.summary-row.total {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.summary-row.total span:last-child { color: #00e676; }

/* ===== PAY BUTTON ===== */
.pay-btn {
  width: 100%;
  background: linear-gradient(135deg, #7a0d8f, #5a0a6a);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 6px 24px rgba(122,13,143,0.35);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.pay-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: left 0.5s;
}

.pay-btn:hover::before { left: 100%; }
.pay-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(122,13,143,0.5);
}
.pay-btn:active { transform: translateY(0); }

.pay-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ===== GUARANTEE ===== */
.guarantee-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 24px;
  text-align: center;
}

/* ===== FOOTER ===== */
.checkout-footer {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.2);
  line-height: 1.6;
  padding: 0 20px;
}

.checkout-footer a { color: rgba(255,255,255,0.3); text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .card-row { grid-template-columns: 1fr 1fr; }
  .card-row .form-input:last-child { grid-column: span 2; }
  .form-row { grid-template-columns: 1fr; }
  .payment-methods { grid-template-columns: 1fr 1fr; }
}
