/* RESET & BASE */
.ts-custom-checkout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 4px 16px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #111;
}

.ts-custom-checkout * {
  box-sizing: border-box;
}

/* LAYOUT */
.checkout-container {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  align-items: flex-start;
}

/* STEPS CARDS */
.checkout-step {
  background: #fff;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-bottom: 24px;
}

/* HEADER */
.step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  background: #111;
  color: #fff;
  flex-shrink: 0;
}

.step-title-group h2 {
  margin: 0;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
  color: #111;
}

.step-title-group h3 {
  margin: 0;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
  color: #111;
}

/* FORMS */
.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #555;
}

.form-row input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
  transition: all 0.2s;
  font-weight: 500;
}

.form-row input:focus {
  border-color: #e4b83b;
  outline: none;
  box-shadow: 0 0 0 4px rgba(228, 184, 59, 0.15);
}

.form-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* DELIVERY CARDS */
.delivery-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 10px;
}

.delivery-option {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: flex-start;
}

.delivery-option:hover {
  border-color: #ccc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.delivery-option.active {
  border-color: #111;
  background: #f9f9f9;
  box-shadow: 0 0 0 1px #111 inset;
}

.delivery-option input {
  margin-top: 4px;
  accent-color: #111;
}

.delivery-option strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.delivery-option div div {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  line-height: 1.4;
}

/* PAYMENT CARDS */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 10px;
}

.payment-method {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease;
  position: relative;
}

.payment-method:hover {
  border-color: #ccc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.payment-method:has(input:checked),
.payment-method.active {
  border-color: #111;
  background: #fcfcfc;
  box-shadow: 0 0 0 1px #111 inset;
}

.payment-method input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #111;
  flex-shrink: 0;
}

.payment-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
  border-radius: 12px;
  color: #333;
  flex-shrink: 0;
}

.payment-info {
  flex: 1;
}

.payment-info strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.payment-info span {
  display: block;
  font-size: 13px;
  color: #666;
  margin-top: 2px;
}

.payment-badge {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: #e4b83b20;
  color: #9a7b26;
  border: 1px solid #e4b83b40;
}

/* CUOTAS */
.ts-card-installments {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #eee;
  border-radius: 16px;
  background: #fafafa;
  display: none;
}

.ts-card-installments.show {
  display: block;
}

.ts-inst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ts-inst-head strong {
  font-size: 14px;
  font-weight: 900;
  color: #111;
}

.ts-inst-chip {
  font-size: 11px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  letter-spacing: .02em;
}

.ts-inst-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ts-inst-opt {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 10px 10px;
  cursor: pointer;
  transition: .18s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 74px;
}

.ts-inst-opt:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.05);
  border-color: #d1d5db;
}

.ts-inst-opt.active {
  border-color: #111;
  box-shadow: 0 0 0 1px #111 inset;
}

.ts-inst-opt input {
  display: none;
}

.ts-inst-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ts-inst-top b {
  font-size: 13px;
  font-weight: 900;
  color: #111;
}

.ts-inst-top span {
  font-size: 11px;
  font-weight: 900;
  color: #9a7b26;
  background: #e4b83b20;
  border: 1px solid #e4b83b40;
  padding: 3px 8px;
  border-radius: 999px;
}

.ts-inst-sub {
  font-size: 12px;
  color: #555;
  font-weight: 700;
  line-height: 1.2;
}

.ts-inst-sub small {
  display: block;
  font-size: 11px;
  color: #777;
  font-weight: 700;
  margin-top: 4px;
}

.ts-inst-note {
  margin-top: 12px;
  font-size: 12px;
  color: #666;
  font-weight: 600;
  line-height: 1.4;
}

/* BUTTON */
.checkout-button {
  width: 100%;
  padding: 20px;
  border-radius: 16px;
  background: #e4b83b;
  color: #000;
  border: none;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(228, 184, 59, 0.25);
  transition: all 0.2s;
}

.checkout-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.secure-badge {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: #666;
  font-weight: 600;
  align-items: center;
}

/* ERRORS */
.checkout-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.checkout-errors .error {
  margin: 4px 0;
  color: #991b1b;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkout-errors .error:before {
  content: "⚠️";
}

/* SUMMARY SIDEBAR */
.checkout-summary {
  background: #fff;
  padding: 32px;
  border-radius: 24px;
  position: sticky;
  top: 30px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.checkout-summary h3 {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 800;
  color: #111;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.item-image {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-details {
  flex: 1;
}

.item-details h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #111;
  line-height: 1.4;
}

.item-qty {
  margin: 0;
  font-size: 12px;
  color: #888;
  font-weight: 500;
}

.item-price {
  font-weight: 800;
  font-size: 15px;
  color: #111;
}

.cart-total-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px dashed #eee;
}

.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 15px;
  color: #555;
}

.total-final {
  margin-top: 12px;
  font-size: 22px;
  color: #111;
}

/* RESUMEN CUOTAS */
.ts-summary-installments {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 14px;
  background: #fafafa;
  display: none;
}

.ts-summary-installments.show {
  display: block;
}

.ts-summary-installments .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #555;
  font-weight: 700;
  margin: 4px 0;
}

.ts-summary-installments .row strong {
  color: #111;
  font-weight: 900;
}

/* RESPONSIVE */
@media (max-width: 968px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    position: static;
    order: -1;
    margin-bottom: 30px;
  }
}

@media (max-width: 640px) {
  .form-row-half {
    grid-template-columns: 1fr;
  }

  .delivery-options {
    grid-template-columns: 1fr;
  }

  .payment-method {
    flex-direction: column;
    align-items: flex-start;
  }

  .payment-badge {
    align-self: flex-start;
  }

  .ts-inst-grid {
    grid-template-columns: 1fr;
  }
}