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

:root {
  --cb-primary: #2C5545;
  --cb-primary-d: #1a3329;
  --cb-accent: #C4896F;
  --cb-success: #22C55E;
  --cb-error: #EF4444;
  --cb-warning: #F59E0B;
  --cb-bg: #FDFBF7;
  --cb-card: #FFFFFF;
  --cb-border: rgba(0, 0, 0, .08);
  --cb-text: #1a1a1a;
  --cb-muted: #666666;
  --cb-radius: 12px;
  --cb-shadow: 0 4px 20px rgba(44, 85, 69, .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(44, 85, 69, .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(44, 85, 69, .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(44, 85, 69, .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: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.cb-item-price {
  color: var(--cb-primary);
  font-size: 14px;
  font-weight: 600;
}

.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(44, 85, 69, .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(44, 85, 69, .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(44, 85, 69, .1) !important;
  border-color: rgba(44, 85, 69, .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 16px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--cb-primary);
  border-bottom: 2px solid var(--cb-border);
  padding-bottom: 10px;
}

.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: 12px 10px;
  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;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.2;
  text-align: center;
}

.cb-tab-btn .cb-tab-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: .7;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .cb-payment-tabs {
    flex-direction: column;
    gap: 8px;
  }
  .cb-tab-btn {
    font-size: 13px;
    padding: 10px 8px;
  }
}

/* Destacado del texto principal en tab Bold */
.cb-bold-highlight {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  margin: 0 0 12px;
  background: linear-gradient(135deg, rgba(44, 85, 69, .08), rgba(200, 169, 110, .12));
  border: 2px solid var(--cb-primary, #2c5545);
  border-left-width: 6px;
  border-radius: var(--cb-radius, 12px);
  font-size: 15px;
  line-height: 1.45;
  color: #2c3e2e;
  box-shadow: 0 2px 8px rgba(44, 85, 69, .08);
}

.cb-bold-highlight-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.cb-bold-highlight strong {
  color: var(--cb-primary, #2c5545);
  font-weight: 700;
}

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

.cb-tab-btn.active {
  border-color: var(--cb-primary);
  background: rgba(44, 85, 69, .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(44, 85, 69, .15);
}

.cb-card-design-opt.active {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(44, 85, 69, .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='%232C5545' 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;
  }
}

/* ==========================================================
   DELIVERY SLOT — disabled state
========================================================== */
#cb_delivery_slot option:disabled {
  color: #bbb;
  font-style: italic;
}
/* ==========================================================
   CUPONES (Step 2)
========================================================== */
.cb-coupon {
  margin: 16px 0 12px;
  padding: 14px 14px 12px;
  background: #fafafa;
  border: 1px dashed #d8c58a;
  border-radius: 8px;
}
.cb-coupon-input-row {
  display: flex;
  gap: 8px;
}
.cb-coupon-input-row input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fff;
}
.cb-coupon-input-row input[type="text"]:focus {
  outline: none;
  border-color: #1a5c2a;
  box-shadow: 0 0 0 2px rgba(26,92,42,0.15);
}
.cb-coupon-btn {
  padding: 10px 18px;
  background: #1a5c2a;
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.cb-coupon-btn:hover { background: #144a22; }
.cb-coupon-btn:disabled { opacity: 0.7; cursor: wait; }

.cb-coupon-msg {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.cb-coupon-msg--error { background: #fdecea; color: #8a1f1a; border: 1px solid #f5c2be; }
.cb-coupon-msg--ok    { background: #e8f5ea; color: #155724; border: 1px solid #bfe0c5; }

.cb-coupon-applied {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cb-coupon-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #c8a96e;
  border-radius: 999px;
  font-size: 13px;
}
.cb-coupon-chip-label { font-weight: 700; color: #8a6d2a; letter-spacing: 0.4px; }
.cb-coupon-chip-amount { color: #b32d2e; font-weight: 600; }
.cb-coupon-remove {
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
}
.cb-coupon-remove:hover { color: #b32d2e; }

.cb-total-discount strong { color: #b32d2e; }
.cb-total-grand {
  border-top: 1px solid #e5e5e5;
  padding-top: 8px;
  margin-top: 4px;
  font-size: 1.05em;
}
.cb-total-grand strong { color: #1a5c2a; font-size: 1.1em; }

/* ==========================================================
   STEP 1 — CALCULADORA DE ENVÍO + UPSELL
========================================================== */
.cb-ship-calc {
  margin: 0 0 28px;
  padding: 18px 20px;
  background: #fff8ed;
  border: 1px solid #e5d4aa;
  border-radius: 12px;
  position: relative;
}

.cb-ship-calc__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.cb-ship-calc__icon { font-size: 20px; line-height: 1; }
.cb-ship-calc__title { font-size: 16px; font-weight: 700; color: #1a5c2a; letter-spacing: 0.2px; }
.cb-ship-calc__hint  { font-size: 13px; color: #6b6b6b; margin: 0 0 12px; }

.cb-ship-calc__row { display: flex; gap: 8px; flex-wrap: wrap; }
.cb-ship-calc__input {
  flex: 1 1 220px; min-width: 0;
  padding: 10px 14px;
  border: 1.5px solid #d8c79a; border-radius: 8px;
  font-size: 14px; background: #fff;
  transition: border-color .2s;
}
.cb-ship-calc__input:focus {
  outline: none;
  border-color: #1a5c2a;
  box-shadow: 0 0 0 2px rgba(26,92,42,.12);
}
.cb-ship-calc__btn {
  flex: 0 0 auto;
  padding: 10px 22px;
  background: #1a5c2a; color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .2s, transform .1s;
}
.cb-ship-calc__btn:hover { background: #154722; }
.cb-ship-calc__btn:active { transform: translateY(1px); }
.cb-ship-calc__btn:disabled { opacity: .6; cursor: not-allowed; }

.cb-ship-calc__result {
  margin-top: 12px;
  min-height: 1px;
  font-size: 14px;
  line-height: 1.45;
}
.cb-ship-calc__result.is-error {
  padding: 10px 14px; background: #fdecea;
  border: 1px solid #e7a8a0; border-radius: 8px; color: #8a2a1e;
}
.cb-ship-calc__result.is-warn {
  padding: 10px 14px; background: #fff4dc;
  border: 1px solid #e0c878; border-radius: 8px; color: #856404;
}
.cb-ship-calc__result.is-loading {
  display: flex; align-items: center; gap: 8px; color: #555;
}
.cb-ship-calc__spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #d8c79a; border-top-color: #1a5c2a; border-radius: 50%;
  animation: cb-ship-spin .8s linear infinite;
}
@keyframes cb-ship-spin { to { transform: rotate(360deg); } }

.cb-ship-calc__quote {
  background: #fff; border: 1.5px solid #1a5c2a;
  border-radius: 10px; overflow: hidden;
}
.cb-ship-calc__line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; font-size: 14px; color: #2c2c2c;
}
.cb-ship-calc__line small { color: #888; font-weight: 400; }
.cb-ship-calc__line strong.is-lowering {
  color: #1a5c2a;
  animation: cb-pop .55s ease-out;
}
@keyframes cb-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); color: #1a5c2a; }
  100% { transform: scale(1); }
}
.cb-ship-calc__meta {
  padding: 6px 14px; font-size: 12px; color: #888; background: #f9f9f9;
}
.cb-ship-calc__free {
  padding: 14px; text-align: center;
  font-size: 16px; font-weight: 700; color: #1a5c2a; background: #e9f5ec;
}
.cb-ship-calc__free.is-celebrate {
  animation: cb-celebrate 1s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cb-celebrate {
  0%   { transform: scale(.85); opacity: 0; }
  60%  { transform: scale(1.07); }
  100% { transform: scale(1); opacity: 1; }
}

.cb-ship-calc__upsell {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #fff4dc 0%, #ffeac0 100%);
  border-left: 4px solid #c8a96e;
  border-radius: 8px;
  font-size: 13.5px; line-height: 1.45; color: #5c4317;
}
.cb-ship-calc__upsell-ico { font-size: 18px; line-height: 1.2; flex-shrink: 0; }
.cb-ship-calc__upsell-msg strong { color: #1a5c2a; font-weight: 700; }
.cb-ship-calc__upsell-link {
  display: inline-block; margin-top: 4px;
  color: #1a5c2a; font-weight: 700; text-decoration: underline;
}
.cb-ship-calc__upsell-link:hover { color: #154722; }

/* Confetti minimalista */
.cb-ship-confetti {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none; overflow: hidden; z-index: 5;
}
.cb-ship-confetti i {
  position: absolute; top: -10px; width: 8px; height: 12px; opacity: .9;
  border-radius: 1px;
  animation: cb-confetti-fall 1.5s ease-in forwards;
}
@keyframes cb-confetti-fall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(220px) rotate(540deg); opacity: 0; }
}

@media (max-width: 480px) {
  .cb-ship-calc__row { flex-direction: column; }
  /* FIX: en flex-direction column el flex-basis se aplica al eje vertical;
     forzar altura auto para que el input no crezca a 220px. */
  .cb-ship-calc__input {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 0;
  }
  .cb-ship-calc__btn { width: 100%; flex: 0 0 auto; }
}

/* Asegurar que el dropdown de Google quede sobre el modal del checkout */
.pac-container { z-index: 100000 !important; }

/* ==========================================================
   STEP 4 — DIRECCIÓN LOCKED (read-only con botón Cambiar)
========================================================== */
.cb-address-locked {
  margin: 6px 0 4px;
  padding: 12px 14px;
  background: #f0f5ee;
  border: 1.5px solid #c5d6bd;
  border-radius: 10px;
}
.cb-address-locked__row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.cb-address-locked__icon {
  font-size: 20px; flex-shrink: 0;
}
.cb-address-locked__body {
  flex: 1 1 200px; min-width: 0;
}
.cb-address-locked__text {
  font-weight: 600; font-size: 14px; color: #2c5545;
  word-break: break-word;
}
.cb-address-locked__sub {
  font-size: 12px; color: #6c7e62; margin-top: 2px;
}
.cb-address-locked__btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  background: #fff; color: #1a5c2a;
  border: 1.5px solid #1a5c2a;
  border-radius: 6px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.cb-address-locked__btn:hover { background: #1a5c2a; color: #fff; }
