/* ==========================================================
   CHECKOUT BOLD — CSS
   Mobile-first. Variables de color fáciles de personalizar.
========================================================== */

:root {
  --cb-primary: #6B3FF0;
  --cb-primary-d: #5228d4;
  --cb-accent: #FF6B35;
  --cb-success: #22C55E;
  --cb-error: #EF4444;
  --cb-warning: #F59E0B;
  --cb-bg: #F8F7FF;
  --cb-card: #FFFFFF;
  --cb-border: #E2E0F0;
  --cb-text: #1A1A2E;
  --cb-muted: #6B7280;
  --cb-radius: 12px;
  --cb-shadow: 0 4px 20px rgba(107, 63, 240, .08);
  --cb-transition: .25s ease;
}

/* ---- Reset básico ---- */
#cb-checkout-wrapper *,
#cb-checkout-wrapper *::before,
#cb-checkout-wrapper *::after {
  box-sizing: border-box;
}

#cb-checkout-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 60px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--cb-text);
}

/* ==========================================================
   BARRA DE PASOS
========================================================== */
.cb-steps-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 28px;
  overflow-x: auto;
  gap: 4px;
}

.cb-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 48px;
  position: relative;
  cursor: default;
}

.cb-step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  right: -50%;
  width: 100%;
  height: 2px;
  background: var(--cb-border);
  z-index: 0;
  transition: background var(--cb-transition);
}

.cb-step-item.done::after {
  background: var(--cb-primary);
}

.cb-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cb-border);
  color: var(--cb-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 1;
  transition: all var(--cb-transition);
}

.cb-step-label {
  font-size: 10px;
  color: var(--cb-muted);
  text-align: center;
  white-space: nowrap;
  transition: color var(--cb-transition);
}

.cb-step-item.active .cb-step-num {
  background: var(--cb-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(107, 63, 240, .2);
}

.cb-step-item.active .cb-step-label {
  color: var(--cb-primary);
  font-weight: 600;
}

.cb-step-item.done .cb-step-num {
  background: var(--cb-primary);
  color: #fff;
}

.cb-step-item.done .cb-step-num::after {
  content: '✓';
  position: absolute;
  font-size: 16px;
}

.cb-step-item.done .cb-step-num {
  font-size: 0;
  /* Oculta el número, muestra checkmark */
}

/* ==========================================================
   PASOS (secciones)
========================================================== */
.cb-step {
  display: none;
  animation: cbFadeIn .3s ease;
}

.cb-step.active {
  display: block;
}

@keyframes cbFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Header de paso ---- */
.cb-step-header {
  padding: 24px 0 16px;
}

.cb-step-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--cb-text);
}

.cb-step-header p {
  margin: 0;
  color: var(--cb-muted);
  font-size: 14px;
}

/* ==========================================================
   BOTONES DE NAVEGACIÓN
========================================================== */
.cb-step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.cb-btn-next,
.cb-btn-prev,
.cb-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--cb-radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--cb-transition);
}

.cb-btn-next {
  background: var(--cb-primary);
  color: #fff;
  margin-left: auto;
}

.cb-btn-next:hover {
  background: var(--cb-primary-d);
  transform: translateY(-1px);
}

.cb-btn-prev {
  background: transparent;
  color: var(--cb-primary);
  border: 2px solid var(--cb-border);
}

.cb-btn-prev:hover {
  border-color: var(--cb-primary);
  background: rgba(107, 63, 240, .04);
}

.cb-btn-primary {
  background: var(--cb-success);
  color: #fff;
  width: 100%;
  justify-content: center;
  font-size: 16px;
}

.cb-btn-primary:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.cb-arrow {
  font-size: 18px;
}

/* ==========================================================
   STEP 1: SLIDER ADICIONALES — REDISEÑO
========================================================== */
.cb-addons-slider {
  margin: 0;
  position: relative;
}

/* Contenedor del slider necesita espacio para las flechas */
.cb-step-1 .cb-addons-slider.slick-initialized {
  padding: 0 40px;
}

/* ---- Card de producto (completa, sin recortar) ---- */
.cb-addon-card {
  margin: 8px;
  background: var(--cb-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  overflow: hidden;
  transition: transform var(--cb-transition), box-shadow var(--cb-transition);
  display: flex !important;
  flex-direction: column;
}

.cb-addon-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cb-shadow);
}

/* Wrapper de imagen con aspect ratio fijo */
.cb-addon-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
  /* Aspect ratio 1:1 */
  overflow: hidden;
  background: #f9f9fb;
  flex-shrink: 0;
}

.cb-addon-img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

/* Body del card (info + botón) */
.cb-addon-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cb-addon-info {
  padding: 10px 12px 8px;
  flex: 1;
}

.cb-addon-info h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cb-addon-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--cb-primary);
  display: block;
  margin-top: 2px;
}

.cb-addon-add {
  display: block;
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 10px;
  background: var(--cb-primary);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: background var(--cb-transition), transform var(--cb-transition);
  flex-shrink: 0;
  box-sizing: border-box;
}

.cb-addon-add:hover {
  background: var(--cb-primary-d);
  transform: translateY(-1px);
}

.cb-addon-add.added {
  background: var(--cb-success);
  color: #fff;
  cursor: default;
}

/* ==========================================================
   FLECHAS DEL SLIDER — Diseño mejorado
========================================================== */
/* Ocultar flechas nativas de Slick */
.slick-prev,
.slick-next {
  display: none !important;
}

/* Flechas custom */
.cb-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--cb-border);
  background: var(--cb-card);
  color: var(--cb-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--cb-transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  padding: 0;
}

.cb-arrow-btn:hover {
  background: var(--cb-primary);
  color: #fff;
  border-color: var(--cb-primary);
  box-shadow: 0 4px 12px rgba(107, 63, 240, .25);
}

.cb-arrow-prev {
  left: 0;
}

.cb-arrow-next {
  right: 0;
}

.cb-arrow-btn.slick-disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* Slick dots personalizados */
.cb-addons-slider .slick-dots {
  bottom: -28px;
  position: relative;
  margin-top: 8px;
}

.cb-addons-slider .slick-dots li {
  margin: 0 3px;
}

.cb-addons-slider .slick-dots li button:before {
  color: var(--cb-border);
  font-size: 8px;
  opacity: 1;
}

.cb-addons-slider .slick-dots li.slick-active button:before {
  color: var(--cb-primary);
}

/* Espacio inferior para los dots */
.cb-step-1 .cb-step-nav {
  margin-top: 48px;
}

/* ==========================================================
   STEP 2: CARRITO
========================================================== */
.cb-cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.cb-cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: 12px;
  background: var(--cb-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 12px;
}

.cb-cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.cb-item-info h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.cb-item-price {
  color: var(--cb-muted);
  font-size: 13px;
}

.cb-qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cb-qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--cb-border);
  background: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  color: var(--cb-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--cb-transition);
}

.cb-qty-btn:hover {
  border-color: var(--cb-primary);
  background: var(--cb-primary);
  color: #fff;
}

.cb-qty-val {
  font-weight: 700;
  font-size: 15px;
  min-width: 20px;
  text-align: center;
}

.cb-item-subtotal {
  font-weight: 700;
  font-size: 14px;
  color: var(--cb-text);
  min-width: 80px;
  text-align: right;
}

.cb-cart-totals {
  background: var(--cb-bg);
  border-radius: var(--cb-radius);
  padding: 16px;
}

.cb-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--cb-border);
}

.cb-total-row:last-child {
  border-bottom: none;
}

/* ==========================================================
   STEP 3 & 4: FORMULARIOS
========================================================== */
.cb-field-group {
  margin-bottom: 20px;
}

.cb-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cb-field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--cb-text);
  margin-bottom: 7px;
}

.cb-hint {
  font-weight: 400;
  color: var(--cb-muted);
}

.cb-field-group input[type="text"],
.cb-field-group input[type="tel"],
.cb-field-group input[type="email"],
.cb-field-group input[type="date"],
.cb-field-group textarea,
.cb-field-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--cb-border);
  border-radius: var(--cb-radius);
  font-size: 15px;
  color: var(--cb-text);
  background: var(--cb-card);
  transition: border-color var(--cb-transition), box-shadow var(--cb-transition);
  outline: none;
  font-family: inherit;
}

.cb-field-group input:focus,
.cb-field-group textarea:focus,
.cb-field-group select:focus {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(107, 63, 240, .15);
}

.cb-field-group input.cb-error,
.cb-field-group textarea.cb-error,
.cb-field-group select.cb-error {
  border-color: var(--cb-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}

.cb-char-count {
  text-align: right;
  font-size: 12px;
  color: var(--cb-muted);
  margin-top: 4px;
}

/* Radio buttons */
.cb-create-account-wrap .cb-label-top {
  margin-bottom: 10px;
}

.cb-radio-group {
  display: flex;
  gap: 24px;
}

.cb-radio-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}

.cb-radio-opt input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--cb-primary);
  cursor: pointer;
}

/* Shipping notice */
.cb-shipping-notice {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  line-height: 1.5;
}

.cb-shipping-notice.cb-shipping-warn {
  background: #fffbeb;
  border-color: #fcd34d;
}

.cb-shipping-notice.cb-shipping-error {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Selector de tarifas múltiples */
.cb-rate-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.cb-rate-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--cb-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all var(--cb-transition);
  background: #fff;
}

.cb-rate-opt:hover,
.cb-rate-opt.selected {
  border-color: var(--cb-primary);
  background: rgba(107, 63, 240, .04);
}

.cb-field-readonly {
  background: var(--cb-bg) !important;
  color: var(--cb-muted) !important;
  cursor: default !important;
  border-color: var(--cb-border) !important;
}

/* ==========================================================
   FLATPICKR — Estilos personalizados
========================================================== */
/* Input de Flatpickr (el altInput) */
.cb-field-group .flatpickr-input {
  cursor: pointer !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

/* Personalizar el popup de Flatpickr */
.flatpickr-calendar {
  border-radius: var(--cb-radius) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12) !important;
  border: 1px solid var(--cb-border) !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--cb-primary) !important;
  border-color: var(--cb-primary) !important;
}

.flatpickr-day:hover {
  background: rgba(107, 63, 240, .1) !important;
  border-color: rgba(107, 63, 240, .2) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: #d4d4d4 !important;
  text-decoration: line-through;
  cursor: not-allowed !important;
  background: transparent !important;
}

.flatpickr-months .flatpickr-month {
  height: 40px;
}

/* ==========================================================
   STEP 5: RESUMEN FINAL
========================================================== */
.cb-summary-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cb-summary-block {
  background: var(--cb-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 16px;
}

.cb-summary-block h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cb-muted);
  border-bottom: 1px solid var(--cb-border);
  padding-bottom: 8px;
}

.cb-sum-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--cb-border);
}

.cb-sum-item:last-child {
  border-bottom: none;
}

.cb-summary-block p {
  margin: 0 0 6px;
  font-size: 14px;
}

.cb-summary-totals {
  background: linear-gradient(135deg, var(--cb-primary) 0%, var(--cb-primary-d) 100%);
  border-radius: var(--cb-radius);
  padding: 20px;
  color: #fff;
}

.cb-summary-totals .cb-total-row {
  color: rgba(255, 255, 255, .8);
  border-color: rgba(255, 255, 255, .2);
  font-size: 15px;
}

.cb-summary-totals .cb-grand-total {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  padding-top: 12px;
}

/* ==========================================================
   STEP 6: PAGO
========================================================== */
.cb-payment-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.cb-tab-btn {
  flex: 1;
  padding: 14px 12px;
  border: 2px solid var(--cb-border);
  border-radius: var(--cb-radius);
  background: var(--cb-card);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--cb-transition);
  color: var(--cb-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cb-tab-btn:hover {
  border-color: var(--cb-primary);
  color: var(--cb-primary);
}

.cb-tab-btn.active {
  border-color: var(--cb-primary);
  background: rgba(107, 63, 240, .06);
  color: var(--cb-primary);
}

.cb-tab-content {
  display: none;
}

.cb-tab-content.active {
  display: block;
  animation: cbFadeIn .25s ease;
}

/* Bold intro */
.cb-bold-intro {
  background: var(--cb-bg);
  border-radius: var(--cb-radius);
  padding: 16px;
  margin-bottom: 24px;
}

.cb-bold-intro p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--cb-muted);
}

.cb-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-success);
  background: rgba(34, 197, 94, .1);
  padding: 6px 12px;
  border-radius: 100px;
}

#cb-bold-button-wrapper {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

/* Transferencia */
.cb-bank-info {
  background: var(--cb-bg);
  border-radius: var(--cb-radius);
  padding: 20px;
  margin-bottom: 16px;
}

.cb-bank-info h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
}

.cb-bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cb-bank-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--cb-border);
}

.cb-bank-table td:first-child {
  color: var(--cb-muted);
  width: 40%;
}

.cb-transfer-instructions {
  font-size: 14px;
  color: var(--cb-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ==========================================================
   SPINNER / LOADING
========================================================== */
.cb-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  color: var(--cb-muted);
  font-size: 14px;
  justify-content: center;
}

.cb-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--cb-border);
  border-top-color: var(--cb-primary);
  border-radius: 50%;
  animation: cbSpin .7s linear infinite;
  flex-shrink: 0;
}

.cb-spinner.large {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.cb-spinner.small {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-width: 2px;
}

@keyframes cbSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================
   OVERLAY
========================================================== */
.cb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.cb-overlay-box {
  background: var(--cb-card);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.cb-overlay-box p {
  margin: 20px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--cb-muted);
}

/* ==========================================================
   NOTICE / ALERTAS
========================================================== */
.cb-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99998;
  padding: 14px 24px;
  border-radius: var(--cb-radius);
  font-size: 14px;
  font-weight: 600;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}

.cb-notice.error {
  background: var(--cb-error);
  color: #fff;
}

.cb-notice.success {
  background: var(--cb-success);
  color: #fff;
}

.cb-notice.warning {
  background: var(--cb-warning);
  color: #fff;
}

/* ==========================================================
   EMPTY / MISC
========================================================== */
.cb-empty {
  text-align: center;
  color: var(--cb-muted);
  padding: 30px;
  font-size: 15px;
}

.cb-empty-cart {
  text-align: center;
  padding: 40px;
}

/* ==========================================================
   ENTREGA ANÓNIMA
========================================================== */
.cb-anonymous-wrap {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cb-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.cb-radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cb-primary);
  cursor: pointer;
}

/* ==========================================================
   RESPONSIVE — MÓVIL
========================================================== */
@media (max-width: 480px) {
  .cb-steps-bar {
    padding: 16px 0 20px;
  }

  .cb-step-label {
    display: none;
  }

  .cb-step-num {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .cb-field-row {
    grid-template-columns: 1fr;
  }

  .cb-cart-item {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }

  .cb-cart-item img {
    width: 56px;
    height: 56px;
    grid-row: span 2;
  }

  .cb-qty-control,
  .cb-item-subtotal {
    grid-column: 2;
  }

  .cb-payment-tabs {
    flex-direction: column;
  }

  .cb-btn-next,
  .cb-btn-prev {
    padding: 12px 18px;
    font-size: 14px;
  }

  .cb-step-header h2 {
    font-size: 19px;
  }

  /* Slider en móvil — flechas más pequeñas */
  .cb-arrow-btn {
    width: 30px;
    height: 30px;
  }

  .cb-arrow-btn svg {
    width: 16px;
    height: 16px;
  }

  .cb-step-1 .cb-addons-slider.slick-initialized {
    padding: 0 32px;
  }
}

/* ==========================================================
   CARD DESIGN SELECTOR + PREVIEW MODAL
========================================================== */

/* --- Selector de disenos --- */
.cb-card-section {
  margin-top: 4px;
}

.cb-card-designs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cb-card-design-opt {
  position: relative;
  width: 72px;
  height: 52px;
  border-radius: 8px;
  border: 2px solid var(--cb-border);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--cb-transition), box-shadow var(--cb-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.cb-card-design-opt:hover {
  border-color: var(--cb-primary);
  box-shadow: 0 2px 8px rgba(107, 63, 240, .15);
}

.cb-card-design-opt.active {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(107, 63, 240, .2);
}

.cb-card-design-opt.active::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cb-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
  z-index: 2;
}

.cb-card-design-opt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-card-design-opt .cb-card-opt-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--cb-muted);
  text-align: center;
  padding: 2px 4px;
  line-height: 1.2;
}

/* Boton de preview */
.cb-btn-preview-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  color: var(--cb-primary);
  border: 2px solid var(--cb-primary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--cb-transition);
}

.cb-btn-preview-card:hover {
  background: var(--cb-primary);
  color: #fff;
}

.cb-btn-preview-card::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B3FF0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: all var(--cb-transition);
}

.cb-btn-preview-card:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

/* --- Modal de preview --- */
.cb-card-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cb-card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
}

.cb-card-modal-content {
  position: relative;
  z-index: 1;
  max-width: 440px;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  animation: cbCardIn .3s ease;
}

@keyframes cbCardIn {
  from {
    opacity: 0;
    transform: scale(.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cb-card-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--cb-transition);
}

.cb-card-modal-close:hover {
  background: rgba(0, 0, 0, .7);
}

/* --- Canvas de la tarjeta --- */
.cb-card-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 3.5;
  background: #FFFDF7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 32px 30px;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Overlay semitransparente para legibilidad sobre imagen */
.cb-card-canvas.has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .35);
  z-index: 0;
}

.cb-card-canvas.has-bg .cb-card-message,
.cb-card-canvas.has-bg .cb-card-firma {
  position: relative;
  z-index: 1;
}

.cb-card-message {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70%;
  overflow-y: auto;
}

.cb-card-firma {
  margin-top: 14px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 14px;
  font-style: italic;
  color: #666;
  text-align: center;
}

.cb-card-firma::before {
  content: '— ';
}

/* Sin mensaje placeholder */
.cb-card-message.empty {
  color: #bbb;
  font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .cb-card-design-opt {
    width: 60px;
    height: 44px;
  }

  .cb-card-design-opt .cb-card-opt-label {
    font-size: 9px;
  }

  .cb-card-canvas {
    padding: 30px 20px 24px;
  }

  .cb-card-message {
    font-size: 14px;
  }

  .cb-card-firma {
    font-size: 12px;
  }

  .cb-card-modal-content {
    max-width: 360px;
  }
}

/* ==========================================================
   INTL-TEL-INPUT — Integración visual con el checkout
========================================================== */
/* Contenedor del input con selector de país — ancho completo */
.cb-field-group .iti {
  width: 100%;
}

/* El input dentro de intl-tel-input hereda los estilos del checkout */
.cb-field-group .iti input.iti__tel-input {
  width: 100%;
  padding: 12px 16px 12px 52px;
  border: 2px solid var(--cb-border);
  border-radius: var(--cb-radius);
  font-size: 15px;
  color: var(--cb-text);
  background: var(--cb-card);
  transition: border-color var(--cb-transition), box-shadow var(--cb-transition);
  outline: none;
  font-family: inherit;
  height: auto;
}

.cb-field-group .iti input.iti__tel-input:focus {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(107, 63, 240, .15);
}

.cb-field-group .iti input.iti__tel-input.cb-error {
  border-color: var(--cb-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}

/* Botón de bandera — estilo flush con el input */
.cb-field-group .iti__country-container {
  border-right: 1px solid var(--cb-border);
  border-radius: var(--cb-radius) 0 0 var(--cb-radius);
}

/* Código dial visible */
.cb-field-group .iti__selected-dial-code {
  font-size: 14px;
  color: var(--cb-text);
  font-weight: 500;
}

/* Dropdown del país — posición correcta */
.iti__country-list {
  z-index: 9999 !important;
  border-radius: 8px !important;
  border: 1px solid var(--cb-border) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12) !important;
  max-height: 240px;
}

.iti__country-list .iti__country.iti__highlight {
  background-color: rgba(107, 63, 240, .08) !important;
}

/* Móvil — asegurar que el dropdown no se desborde */
@media (max-width: 480px) {
  .iti__country-list {
    width: calc(100vw - 32px) !important;
    left: 0 !important;
  }
}

/* ==========================================================
   INTL-TEL-INPUT (Teléfono comprador)
========================================================== */
.iti {
  width: 100%;
  display: block;
}

.iti__flag {
  background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/18.2.1/img/flags.png");
}

@media (min-resolution: 2x) {
  .iti__flag {
    background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/18.2.1/img/flags@2x.png");
  }
}

.cb-field-group .iti input[type="tel"] {
  padding-left: 85px !important;
}