/* =========================================================
   CHECKOUT MODAL & CART DRAWER - TOMY.CL
   Diseño Premium, Confiable y Optimizado para Conversión
   ========================================================= */

.checkout-modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter:none;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.checkout-modal-scrim.is-open {
  opacity: 1;
  visibility: visible;
}

.checkout-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: 92%;
  max-width: 550px;
  max-height: 92vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 9999;
  padding: 24px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}
.checkout-modal.is-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.modal-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: #0f172a;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Resumen del Pedido */
.checkout-product-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.summary-item-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.summary-item-row:last-child {
  margin-bottom: 0;
}
.summary-item-row img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.summary-item-row .summary-info {
  flex: 1;
}
.summary-item-row .summary-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}
.summary-item-row .summary-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}
.summary-item-row .summary-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0c43d7;
  text-align: right;
}

/* Badges de Confianza */
.trust-badges-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.trust-badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #1e40af;
  font-weight: 600;
}
.trust-badge-item span.icon {
  font-size: 1rem;
}

/* Formulario */
.form-row {
  display: flex;
  gap: 12px;
}
.form-group {
  margin-bottom: 14px;
  flex: 1;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.form-group input, 
.form-group textarea, 
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.94rem;
  box-sizing: border-box;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}
.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
  border-color: #0c43d7;
  box-shadow: 0 0 0 3px rgba(12, 67, 215, 0.15);
  background: #ffffff;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
}

/* Botón de Confirmación */
.btn-submit-order {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #0c43d7 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(12, 67, 215, 0.35);
}
.btn-submit-order:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(12, 67, 215, 0.45);
}
.btn-submit-order:active {
  transform: translateY(0);
}
.btn-submit-order:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Error Alert */
.order-error-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 12px;
  display: none;
}

/* Pantalla de Éxito */
.order-success-screen {
  text-align: center;
  padding: 24px 12px;
}
.success-icon-wrap {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 16px;
  border: 2px solid #bbf7d0;
}
.order-success-screen h3 {
  font-size: 1.45rem;
  color: #0f172a;
  margin: 0 0 10px;
  font-weight: 800;
}
.order-success-screen p {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 6px 0;
}
.order-details-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin: 18px 0;
  text-align: left;
  font-size: 0.88rem;
  color: #334155;
}
.order-details-box div {
  margin-bottom: 6px;
}
.order-details-box div:last-child {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .checkout-modal {
    padding: 18px;
    width: 95%;
  }
}
