/* ============================================================
   TEMU CATÓLICO - CHECKOUT / FINALIZAR COMPRA STYLES
   Matching Temu UI (Image 2)
   ============================================================ */

:root {
  --checkout-bg: #f5f5f5;
  --checkout-card-bg: #ffffff;
  --checkout-text: #111111;
  --checkout-muted: #767676;
  --checkout-green: #00a650;
  --checkout-orange: #fa6400;
  --checkout-border: #e8e8e8;
}

body.checkout-body {
  background-color: var(--checkout-bg);
  color: var(--checkout-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.checkout-header {
  background: #ffffff;
  border-bottom: 1px solid var(--checkout-border);
  padding: 14px 0;
}

.checkout-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkout-logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.checkout-logo-box img {
  height: 44px;
  width: auto;
  display: block;
}

.checkout-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #00a650;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

.checkout-secure-badge:hover {
  text-decoration: underline;
}

/* Breadcrumbs */
.checkout-breadcrumb-bar {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 0 20px;
  font-size: 12px;
  color: var(--checkout-muted);
}

.checkout-breadcrumb-bar a {
  color: var(--checkout-muted);
  text-decoration: none;
}

.checkout-breadcrumb-bar a:hover {
  color: var(--checkout-orange);
}

.checkout-breadcrumb-bar .sep {
  margin: 0 6px;
  color: #bbb;
}

.checkout-breadcrumb-bar .active {
  color: #222;
  font-weight: 600;
}

/* Main Grid Layout */
.checkout-container {
  max-width: 1200px;
  margin: 16px auto 50px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 24px;
  align-items: flex-start;
}

/* LEFT COLUMN */
.checkout-left-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Green Promotion Ribbon */
.checkout-green-ribbon {
  background: #eef9f2;
  border: 1px solid #c7ecd4;
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.checkout-ribbon-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0b7a3e;
  font-weight: 700;
}

.checkout-ribbon-right {
  color: #555;
  font-size: 12px;
  font-weight: 500;
}

/* Card: Dirección de Envío */
.checkout-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--checkout-border);
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.checkout-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.checkout-card-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #111;
  margin: 0;
}

.checkout-link-btn {
  font-size: 12.5px;
  font-weight: 600;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
}

.checkout-link-btn:hover {
  color: var(--checkout-orange);
}

/* Address Box with striped indicator bar */
.checkout-address-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #fafafa;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
  position: relative;
}

.address-content {
  line-height: 1.5;
}

.address-name-phone {
  font-size: 14px;
  font-weight: 800;
  color: #111;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3px;
}

.address-street {
  font-size: 13px;
  color: #333;
}

.address-district-city {
  font-size: 12.5px;
  color: #666;
}

.address-edit-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: #777;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}

.address-edit-icon:hover {
  background: #e5e5e5;
  color: #111;
}

/* Package Shipping Section */
.checkout-package-section {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--checkout-border);
  padding: 20px 22px;
}

.checkout-pkg-header {
  font-size: 14.5px;
  font-weight: 800;
  color: #111;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-items-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-item-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.checkout-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.checkout-item-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f8f8;
  border: 1px solid #eee;
}

.checkout-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.checkout-item-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
  padding: 2px 4px;
  text-transform: uppercase;
}

.checkout-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkout-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #111;
  line-height: 1.35;
  margin: 0;
}

.checkout-item-attr {
  font-size: 12px;
  color: #767676;
}

.checkout-item-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.item-old-price {
  font-size: 12.5px;
  color: #999;
  text-decoration: line-through;
}

.item-current-price {
  font-size: 14.5px;
  font-weight: 800;
  color: #111;
}

.item-promo-hint {
  font-size: 11.5px;
  color: #666;
}

.item-ws-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #86efac;
}

.checkout-gift-card-btn {
  font-size: 12px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.checkout-gift-card-btn:hover {
  color: var(--checkout-orange);
}

.checkout-item-delivery-note {
  font-size: 12px;
  color: #0b7a3e;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.checkout-qty-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.checkout-qty-select {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
  outline: none;
}

/* RIGHT COLUMN: Resumen del Pedido */
.checkout-right-col {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-summary-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--checkout-border);
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.summary-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #111;
  margin: 0 0 16px 0;
}

/* Coupon Box */
.coupon-box-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.coupon-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.coupon-input:focus {
  border-color: #222;
}

.coupon-apply-btn {
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

.coupon-apply-btn:hover {
  background: #e5e5e5;
}

.coupon-link-toggle {
  font-size: 12px;
  color: #555;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 18px;
}

.coupon-link-toggle:hover {
  color: var(--checkout-orange);
}

/* Financial Breakdown */
.summary-line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
  color: #333;
}

.summary-line-item.discount-line {
  color: var(--checkout-orange);
  font-weight: 600;
}

.summary-line-item.green-line {
  color: #0b7a3e;
  font-weight: 700;
}

.summary-divider {
  height: 1px;
  background: #eee;
  margin: 14px 0;
}

.summary-total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.summary-total-label {
  font-size: 15.5px;
  font-weight: 800;
  color: #111;
}

.summary-total-amount {
  font-size: 24px;
  font-weight: 900;
  color: #111;
  letter-spacing: -0.5px;
}

.summary-legal-note {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
  margin-bottom: 16px;
}

.summary-legal-note a {
  color: #666;
  text-decoration: underline;
}

/* Donation Row */
.donation-box-row {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #444;
}

.donation-box-row input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
}

/* Payment Method Selection Card inside Summary */
.payment-methods-box {
  margin-bottom: 18px;
}

.payment-method-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
  transition: 0.15s;
}

.payment-method-option.selected {
  border-color: #fa6400;
  background: #fff8f5;
}

.payment-method-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #111;
  cursor: pointer;
  margin: 0;
  flex: 1;
}

/* Big Orange CTA Button */
.btn-finalize-order {
  width: 100%;
  background: #fa6400;
  color: #ffffff;
  border: none;
  border-radius: 28px;
  padding: 13px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 12px rgba(250, 100, 0, 0.25);
}

.btn-finalize-order:hover {
  background: #e05500;
  transform: translateY(-1px);
}

.btn-finalize-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.btn-finalize-sub {
  font-size: 11.5px;
  opacity: 0.92;
  font-weight: 600;
  margin-top: 1px;
}

/* Trust / Entrega Garantizada Box */
.checkout-trust-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--checkout-border);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trust-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0b7a3e;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.trust-card-item {
  font-size: 12px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trust-card-item svg {
  color: #00a650;
  flex-shrink: 0;
}

/* Modal: Cambiar Dirección */
.checkout-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.checkout-modal-overlay.is-visible {
  display: flex;
}

.checkout-modal-box {
  background: #ffffff;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.checkout-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
}

.checkout-form-group {
  margin-bottom: 14px;
}

.checkout-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.checkout-form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13.5px;
  box-sizing: border-box;
}

.checkout-form-control:focus {
  border-color: #fa6400;
  outline: none;
}

/* Order Success Modal */
.order-success-modal {
  text-align: center;
  padding: 10px;
}

.success-check-circle {
  width: 64px;
  height: 64px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
}

/* Responsive */
@media (max-width: 900px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }
  .checkout-right-col {
    position: static;
  }
}

@media (max-width: 540px) {
  .checkout-item-row {
    grid-template-columns: 70px 1fr;
  }
  .checkout-qty-col {
    grid-column: 1 / -1;
    align-items: flex-start;
  }
}
