/* ── CHECKOUT DRAWER — TuttyCosas Kids ── */

.co-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,.55);
  animation: coFadeIn .2s ease;
}
.co-drawer-overlay.open { display: block; }

.co-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(480px, 100vw);
  height: 100dvh;
  z-index: 9999;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  transition: right .3s cubic-bezier(.4,0,.2,1);
}
.co-drawer.open { right: 0; }

/* Header */
.co-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1rem;
  border-bottom: 1px solid #f0ede8;
  background: #fff;
  flex-shrink: 0;
}
.co-drawer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--forest, #2d4a30);
}
.co-drawer-back,
.co-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--bark, #6b5744);
  padding: .25rem .5rem;
  border-radius: 8px;
  line-height: 1;
}
.co-drawer-back { visibility: hidden; }

/* Progress */
.co-drawer-progress {
  display: flex;
  gap: 4px;
  padding: .6rem 1rem;
  background: #faf8f5;
  border-bottom: 1px solid #f0ede8;
  flex-shrink: 0;
}
.co-dpill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  color: #999;
  background: #f0f0f0;
  white-space: nowrap;
  transition: all .2s;
}
.co-dpill.active {
  background: var(--forest, #2d4a30);
  color: #fff;
}

/* Body scrollable */
.co-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
}

/* Resumen inline */
.co-drawer-summary {
  background: #faf8f5;
  border-radius: 12px;
  padding: .875rem 1rem;
  margin-top: 1rem;
}
.co-drawer-summary--compact {
  margin-bottom: .75rem;
}

/* Botones */
.co-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--forest,#2d4a30), #1a3320);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .875rem 1.5rem;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  margin-top: .5rem;
}
.co-btn-primary:hover { opacity: .92; transform: translateY(-1px); }

.co-btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: none;
  border-radius: 12px;
  padding: .75rem 1.2rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s;
}
.co-btn-secondary:hover { background: #ebe8e3; }

.co-pay-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--forest,#2d4a30), #1a3320);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: all .2s;
  margin-top: .75rem;
}
.co-pay-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.co-pay-btn:not(:disabled):hover { opacity: .92; transform: translateY(-1px); }

.co-pay-note {
  font-size: .72rem;
  color: #888;
  text-align: center;
  margin-top: .5rem;
  line-height: 1.5;
}

@keyframes coFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Mobile: drawer ocupa pantalla completa */
@media (max-width: 480px) {
  .co-drawer { width: 100vw; }
}

/* Anti-zoom iOS — inputs nunca bajo 16px */
.co-drawer .co-field input,
.co-drawer .co-field select,
.co-drawer .co-coupon input {
  font-size: 16px;
}

.co-field input.error,
.co-field select.error {
  border-color: #e53e3e;
  background: #fff5f5;
}

.co-field-err {
  display: block;
  font-size: .78rem;
  color: #e53e3e;
  font-weight: 600;
  margin-top: 3px;
  min-height: 1rem;
}
/* Footer sticky — botones siempre en zona del pulgar */
.co-drawer-footer {
  flex-shrink: 0;
  padding: .75rem 1rem;
  padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid #f0ede8;
  background: #fff;
}

.co-drawer-footer .co-btn-primary,
.co-drawer-footer .co-btn-secondary,
.co-drawer-footer .co-pay-btn {
  margin-top: 0;
}

.co-drawer-footer-row {
  display: flex;
  gap: 8px;
}

.co-drawer-footer-row .co-btn-secondary {
  flex: 0 0 auto;
  padding: .875rem 1rem;
}

.co-drawer-footer-row .co-btn-primary {
  flex: 1;
  margin-top: 0;
}
/* Opciones entrega — una sola fila */
.co-delivery-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid #e8e4de;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 8px;
}
.co-delivery-opt input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #2d4a30;
  width: 18px;
  height: 18px;
}
.co-delivery-opt-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.co-delivery-opt-content strong {
  font-size: .9rem;
  color: #1a1a1a;
}
.co-delivery-desc {
  font-size: .78rem;
  color: #888;
}
/* Campos dirección — más espacio y altura */
.co-drawer .co-field {
  margin-bottom: 4px;
}

.co-drawer .co-field input,
.co-drawer .co-field select {
  height: 48px;
  padding: 0 16px;
}

.co-drawer .co-field input#coReferencias {
  height: 72px;
  padding: 12px 16px;
}

.co-drawer .co-field label {
  font-size: .82rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 2px;
}
/* Todos los inputs dirección — 100% ancho sin excepción */
.co-drawer .co-fields {
  grid-template-columns: 1fr;
}

.co-drawer .co-field {
  width: 100%;
}

.co-drawer .co-field input,
.co-drawer .co-field select,
.co-drawer .co-field textarea {
  width: 100%;
}
/* Resumen — espaciado entre label y valor */
.co-drawer-summary .co-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: .86rem;
  gap: 8px;
}
.co-drawer-summary .co-total-grand {
  font-size: .95rem;
  font-weight: 700;
  border-top: 1px solid #e8e4de;
  margin-top: 6px;
  padding-top: 8px;
}

/* Step 3 — fondo uniforme oculta gap interno del Brick MP */
#coStep3 {
  background: #fafafa;
  margin: -1rem;
  padding: 1rem;
}