﻿/* ============================================================================
 * CRAZYSTORE CHECKOUT â€” Webyansh-inspired layout (v1.0.5)
 * Two columns: form (left) + sticky order summary (right).
 * ============================================================================ */

/* === Custom Checkout Fullscreen Cleanup === */
.custom-checkout-page #page,
.custom-checkout-page header,
.custom-checkout-page footer,
.custom-checkout-page .site-header,
.custom-checkout-page .site-footer,
.custom-checkout-page .widget-area,
.custom-checkout-page .sidebar {
  display: none !important;
}

body.custom-checkout-page {
  background: #f5f5f5;
  margin: 0;
  padding: 0;
}

#custom-checkout-wrapper-machi {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bim-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

#custom-checkout-wrapper-machi {
  font-family: var(--bim-font);
}

#custom-checkout-wrapper-machi * {
  font-family: var(--bim-font) !important;
  box-sizing: border-box;
}

/* === LOGO === */
.machi_checkout-logo {
  text-align: center;
  padding: 24px 0 8px;
}
.machi_checkout-logo img {
  height: 56px;
  max-width: 180px;
  width: auto;
}

/* === MAIN GRID === */
.container-checkout {
  background: #fff;
  color: #333;
  line-height: 1.55;
  max-width: 1280px;
  margin: 16px auto;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.machi_left-section {
  padding: 40px 44px;
  background: #fff;
  border-right: 1px solid #eee;
}

.machi_right-section {
  padding: 32px 32px;
  background: #fafafa;
}

/* === LOGIN PROMPT (guest fast-path) === */
.machi_login-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #4b5563;
  margin: 0 0 18px;
  line-height: 1.4;
}
.machi_login-prompt[hidden] { display: none; }
.machi_login-prompt-icon { font-size: 14px; flex-shrink: 0; }
.machi_login-prompt a {
  color: #ff0000;
  font-weight: 600;
  text-decoration: none;
}
.machi_login-prompt a:hover { text-decoration: underline; }

/* === BREADCRUMB STEPPER === */
.machi_checkout-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 24px;
  color: #999;
  flex-wrap: wrap;
}
.machi_step {
  color: #999;
  text-decoration: none;
  font-weight: 500;
}
.machi_step:hover { color: #ff0000; }
.machi_step-current {
  color: #111;
  font-weight: 700;
}
.machi_step-sep { color: #ccc; font-size: 16px; }

/* === TYPOGRAPHY (mirrors cart hierarchy) === */
.machi_section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}
.title-crazy {
  color: #1a1a1a;
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.machi_section-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}
.subtitle-crazy { font-weight: 400; }
.machi_section-required-fields {
  font-size: 12px;
  color: #888;
  margin-top: 12px;
}

.machi_block {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid #eee;
}
.machi_block:first-of-type {
  margin-top: 24px;
  padding-top: 0;
  border-top: none;
}

/* === FORMS === */
.machi_form-group { margin-bottom: 16px; }
.machi_form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}
.machi_form-input,
#departamento {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.machi_form-input:focus,
#departamento:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
#departamento {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 38px;
}
.machi_form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.machi_form-row-2 { grid-template-columns: 1fr 1fr; }

.invalid-input {
  border: 1px solid rgb(253, 74, 74) !important;
}
.machi_error {
  color: #e11;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

/* === SHIPPING METHOD CARDS === */
.machi_shipping-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.machi_shipping-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid #e5e5e5;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
}
.machi_shipping-card:hover { border-color: #bbb; }
.machi_shipping-card input[type="radio"] {
  accent-color: #ff0000;
  width: 16px;
  height: 16px;
  margin: 0;
}
.machi_shipping-card-selected {
  border-color: #ff0000;
  background: #fff7f7;
}
.machi_shipping-card-body { flex: 1; min-width: 0; }
.machi_shipping-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}
.machi_shipping-card-sub {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}
.machi_shipping-card-pricewrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.machi_shipping-card-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  white-space: nowrap;
  line-height: 1.2;
}
.machi_shipping-card-price::before {
  content: "âœ“";
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.machi_shipping-card-condition {
  font-size: 11px;
  font-weight: 400;
  color: #888;
  line-height: 1.3;
  text-align: right;
}

/* === SHIPPING FORM TOGGLE === */
.machi_form-toggle {
  margin-top: 8px;
}
.machi_form-toggle[hidden] { display: none; }

/* Delivery promise pill (dynamic message based on departamento) */
.machi_delivery-promise {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f9f1;
  border: 1px solid #cde9cd;
  color: #225b22;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 4px;
}
.machi_delivery-promise[hidden] { display: none; }
.machi_delivery-promise-icon { font-size: 16px; }

/* === SUCURSAL (branch picker) === */
.machi_form-group-store { margin-bottom: 8px; }
.machi_radio-group-store.vertical { display: flex; flex-direction: column; }
.machi_store-list { margin-top: 8px; }
.machi_radio-option-store {
  background: #fafafa;
  padding: 14px;
  border-radius: 8px;
  border: 2px solid #e5e5e5;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0;
  transition: border-color 0.15s;
}
.machi_radio-option-store:hover { border-color: #bbb; }
.machi_radio-option-store.selected,
.machi_radio-option-store:has(input:checked) {
  border-color: #ff0000;
  background: #fff7f7;
}
.machi_radio-option-store input[type="radio"] {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: #ff0000;
}
.machi_store-info-wrapper { flex: 1; min-width: 0; }
.machi_store-name { font-weight: 700; margin-bottom: 6px; color: #222; }
.machi_store-details { font-size: 13px; color: #555; line-height: 1.45; }
.machi_store-schedule { display: block; margin-top: 4px; font-size: 12px; color: #777; }

/* === PAYMENT METHODS === */
.machi_payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.machi_payment-method {
  border: 2px solid #e5e5e5;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.machi_payment-method:hover { border-color: #ff0000; }
.machi_payment-method.selected { border-color: #ff0000; background: #fff7f7; }
.machi_payment-method.locked { pointer-events: none; opacity: 0.5; cursor: not-allowed; }
.machi_payment-icon img { height: 32px; width: auto; }
.machi_payment-text { font-size: 12px; font-weight: 600; line-height: 1.2; color: #333; }

/* ============================================================================
 * RIGHT COLUMN â€” STICKY ORDER SUMMARY
 * ============================================================================ */

.machi_summary-sticky {
  position: sticky;
  top: 16px;
}

.machi_summary-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

/* Compact product items (in summary) */
.machi_summary-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.machi_product-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
}
.machi_product-image {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.machi_product-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  padding: 4px;
  display: block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.machi_product-qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff0000;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.machi_product-info { flex: 1; min-width: 0; }
.machi_product-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #1f2937;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.machi_product-pricing { margin-bottom: 4px; }
.machi_product-price-line {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}
.machi_product-toggle-details {
  background: none;
  border: none;
  color: #666;
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 0;
  margin: 0;
}
.machi_product-toggle-details:hover { color: #ff0000; }
.machi_product-attributes {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #eee;
}
.machi_product-attributes p {
  font-size: 12px;
  color: #555;
  margin: 2px 0;
  line-height: 1.3;
}
.machi_product-detail-title {
  font-weight: 600;
  color: #333;
}

/* Totals */
.machi_summary-totals {
  border-top: 1px solid #eee;
  padding-top: 12px;
  margin-bottom: 16px;
}
.machi_summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-bottom: 8px;
}
.machi_summary-row span:last-child { font-weight: 700; color: #1a1a1a; }

/* Payment cards (USD / USDT) */
.machi_payment-cards-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 16px;
}
.machi_payment-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a0a0a 100%);
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-height: 130px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
}
.machi_payment-card.selected {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.25), 0 4px 16px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.machi_payment-card.unselected { opacity: 0.4; filter: grayscale(40%); transform: scale(0.97); }
.machi_payment-card.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; filter: grayscale(100%); }
.machi_payment-card.disabled::after {
  content: 'No disponible';
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7); color: #fff;
  padding: 6px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
  white-space: nowrap; z-index: 10;
}
.machi_payment-card-usd { background: linear-gradient(135deg, #1a1a1a 0%, #14532d 100%); border-color: rgba(34,197,94,0.35); }
.machi_payment-card-usd.selected { background: linear-gradient(135deg, #14532d 0%, #16a34a 100%); border-color: #22c55e; }
.machi_payment-card-usdt { background: linear-gradient(135deg, #1a1a1a 0%, #1e3a5f 100%); border-color: rgba(59,130,246,0.35); }
.machi_payment-card-usdt.selected { background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); border-color: #3b82f6; }
.machi_payment-card-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.machi_payment-card-icon { font-size: 20px; flex-shrink: 0; line-height: 1; }
.machi_payment-card-titles { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.machi_payment-card-title { font-size: 13px; font-weight: 600; line-height: 1.2; }
.machi_payment-card-subtitle { font-size: 11px; opacity: 0.85; }
.machi_payment-card-amount { display: flex; align-items: baseline; gap: 5px; margin-bottom: 6px; }
.machi_payment-amount-value { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -0.5px; }
.machi_payment-amount-currency { font-size: 12px; font-weight: 600; opacity: 0.95; }
.machi_payment-card-equivalent { font-size: 13px; opacity: 0.85; line-height: 1.2; }
.machi_payment-card-badge {
  position: absolute; top: 8px; right: 10px;
  background: rgba(255,255,255,0.22); color: #fff;
  padding: 2px 7px; border-radius: 12px;
  font-size: 9px; font-weight: 500;
  backdrop-filter: blur(10px);
}

/* === PAY BUTTON === */
.machi_pay-button {
  width: 100%;
  background: #ff0000;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, transform 0.1s;
  min-height: 50px;
}
.machi_pay-button:hover { background: #e60000; }
.machi_pay-button:active { transform: translateY(1px); }
.machi_pay-button:disabled,
.machi_pay-button.disabled-button {
  background: #555 !important;
  cursor: not-allowed;
  opacity: 0.55;
}
.machi_pay-button .check-glyph { color: #fff; font-weight: 700; margin-left: 0.25rem; }

/* === SECURITY NOTE === */
.machi_security-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.machi_security-note-text { font-weight: 600; color: #333; }

/* === SUMMARY PRODUCT CARD (mockup 1, cart-aligned typography) === */
.machi_product-meta {
  font-size: 13px;
  font-weight: 400;
  color: #666;
  margin: 2px 0 8px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.machi_product-foot {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
}
.machi_product-qty {
  font-size: 13px;
  font-weight: 400;
  color: #666;
}
.machi_product-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.machi_product-price-usd {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.2;
}
.machi_product-price-bs {
  font-size: 13px;
  font-weight: 400;
  color: #666;
  line-height: 1.2;
}

/* === RADIO ROW (Cochabamba / Santa Cruz, etc.) === */
.machi_radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.machi_radio-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.machi_radio-option:has(input:checked) {
  border-color: #ff0000;
  background: #fff7f7;
}
.machi_radio-option input[type="radio"] { accent-color: #ff0000; }

/* === LOADING SPINNER (cart fetch) === */
.cs-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 20px; color: #666; min-height: 80px;
}
.cs-spinner {
  width: 18px; height: 18px;
  border: 2px solid #f3f3f3; border-top: 2px solid #333;
  border-radius: 50%; animation: cs-spin 1s linear infinite;
}
@keyframes cs-spin { to { transform: rotate(360deg); } }

/* ============================================================================
 * MODAL â€” v1.0.5: compact layout, fits in viewport without scrolling
 * ============================================================================ */
.machi_modal {
  position: fixed; z-index: 1000;
  left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex; justify-content: center; align-items: center;
  padding: 16px; box-sizing: border-box;
}
.machi_modal.hidden { display: none; }
.machi_modal.fade-in { animation: fadeIn 0.4s ease-out forwards; }
.machi_modal.fade-out { animation: fadeOut 0.4s ease-out forwards; }

.machi_modal_content {
  background: #fff;
  border-radius: 14px;
  /* 460 y no 400: el QR ampliado necesita el sitio. */
  max-width: 460px;
  width: 100%;
  position: relative;
  overflow: hidden; /* clips scroll content to border-radius */
  animation: slideUp 0.6s ease-out;
}
.machi_modal_scroll {
  padding: 20px 22px;
  max-height: 88vh;
  overflow-y: auto;
  text-align: center;
}

.machi_modal_close {
  position: absolute; top: 10px; right: 14px;
  cursor: pointer; font-size: 22px; color: #888; line-height: 1;
}
.machi_modal_close:hover { color: #333; }

#modalPaymentTitle {
  font-size: 18px;
  margin: 0 0 2px;
  color: #222;
  font-weight: 700;
}

.machi_modal_order-id {
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-align: center;
}

/* Amount box â€” compact brand-gradient banner */
#machi-modal_payment-container {
  /* El negro del degradado anterior ensuciaba el rojo y dejaba la barra
     apagada. Ahora va del rojo de la tienda a un rojo hondo, con un halo
     suave debajo para que se despegue del papel. */
  background: linear-gradient(135deg, #ff0000 0%, #b00000 100%);
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.26);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 12px;
}
#modalTotalAmount {
  display: flex;
  flex-direction: row;
  gap: 16px;
  justify-content: center;
  align-items: baseline;
}
.modal-usdt-amount { color: #fff; font-weight: 700; font-size: 22px; }
.modal-usdt-currency { color: rgba(255,255,255,0.75); font-weight: 600; font-size: 14px; }
.modal-bs-amount { color: rgba(255,255,255,0.85); font-weight: 600; font-size: 16px; }
.modal-bs-currency { color: rgba(255,255,255,0.6); font-weight: 500; font-size: 13px; }

/* Instructions â€” compact */
.instructions {
  /* Era azul (#f8f9ff / #e3e8ff) -- herencia del diseño viejo y el panel mas
     grande del modal. Fondo calido y filo rojo a la izquierda: de la marca,
     y el filo guia la vista hacia el texto. */
  background: #fff7f7;
  border: 1px solid #ffdcdc;
  border-left: 3px solid #ff0000;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 10px;
  text-align: left;
}
.instructions-title {
  text-align: center;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Versión de una sola línea, para el pago QR: el título ocupaba un renglón
   entero para anunciar una única frase. El modal ya se iba de alto. */
.instructions.cs-compacta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 12px;
  /* Sin filo: con la barra roja justo encima, el borde de color sobraba y
     ademas descentraba la caja respecto al resto del modal. */
  border-left: 1px solid #ffdcdc;
}
.instructions.cs-compacta .instructions-title {
  display: block;
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}
.instructions.cs-compacta .instructions-hint { margin: 0; }
.instructions-list { margin: 0; padding-left: 18px; }
.instructions-list li { margin-bottom: 3px; line-height: 1.35; font-size: 13px; color: #444; }
.instructions-hint { margin: 0; font-size: 13px; color: #444; line-height: 1.4; }

/* Timer â€” compact single line */
.timer-section {
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 7px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.timer-text { font-size: 12px; color: #777; margin-bottom: 0; }
.timer-value {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  font-family: "Courier New", monospace;
}

/* QR image */
#modalPaymentImage {
  border: 1px solid #ddd;
  border-radius: 10px;
  /* 🔍 Antes: 44% / max 160px. El "QR" del banco no es solo el codigo: lleva
     impresos beneficiario, cuenta, monto y vigencia. A 160px ese texto era una
     mancha gris y el cliente no podia comprobar que iba a pagar lo correcto. */
  width: 88% !important;
  max-width: 300px;
  height: auto;
  margin: 0 auto 6px;
  display: none;
}

/* Account holder name */
.owner_payment-method {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0 0 10px;
}
.owner_payment-method p { margin: 0; }

/* File upload â€” stacked, full width */
.custom-file-upload {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 10px;
}
.upload-label {
  display: block;
  background: #2563eb;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  transition: background 0.2s;
}
.upload-label:hover { background: #1d4ed8; }
#file-name {
  color: #777;
  font-style: italic;
  font-size: 12px;
  text-align: center;
}
#deleteImageBtn {
  align-self: center;
  background: none !important;
  border: none;
  color: #e11;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
}

/* Security note â€” minimal */
.security-section {
  /* Antes: 12px en gris #888. Se leia como letra pequeña, que es justo lo que
     la gente se salta -- y esto no es letra pequeña, es la garantia. Ahora es
     una pastilla verde: el verde dice "seguro" sin tener que decirlo. */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  margin: 0 auto 6px;
  padding: 7px 14px;
  background: #f1f8f2;
  border: 1px solid #cfe6d2;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1d6b1d;
}

/* Nombrar al banco tranquiliza mas que cualquier adorno: dice que hay una
   entidad real detras del cobro, no solo una web. */
.cs-bank-note {
  text-align: center;
  font-size: 11px;
  color: #999;
  margin: 0 0 12px;
}
.cs-bank-note strong { color: #666; }

/* Action buttons â€” confirm full width on top, cancel secondary below */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
#cancelBtnInModal {
  background: none;
  color: #888;
  border: none;
  padding: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s;
}
#cancelBtnInModal:hover { color: #333; }

/* Confirm button â€” green, prominent, clearly the primary action */
.confirm-button {
  background: #ff0000;
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s, transform 0.1s;
}
.confirm-button:hover { background: #e60000; }
.confirm-button:active { transform: translateY(1px); }
.confirm-button:disabled,
.confirm-button.disabled-button {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Support link */
.support-section { text-align: center; }
.support-text { font-size: 12px; color: #888; margin-bottom: 3px; }
.support-link { color: #ff0000; text-decoration: none; font-weight: 600; font-size: 12px; }
.support-link:hover { text-decoration: underline; }

/* ============================================================================
 * TOAST NOTIFICATIONS
 * ============================================================================ */
.cs-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
}
.cs-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* On mobile: slide up from the bottom so it doesn't cover top content */
@media (max-width: 600px) {
  .cs-toast {
    top: auto;
    bottom: 80px;
    transform: translateX(-50%) translateY(120%);
    border-radius: 12px;
    width: calc(100% - 24px);
  }
  .cs-toast--visible {
    transform: translateX(-50%) translateY(0);
  }
}
.cs-toast--error {
  background: #fff1f1;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.cs-toast--error::before {
  content: 'âœ•';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff0000;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.cs-toast--info {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.cs-toast--info::before {
  content: '!';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.cs-toast__msg { flex: 1; }
.cs-toast__close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  padding: 0;
  flex-shrink: 0;
}
.cs-toast__close:hover { opacity: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================================
 * RESPONSIVE
 * ============================================================================ */

@media (max-width: 1024px) {
  .machi_left-section { padding: 32px 28px; }
  .machi_right-section { padding: 28px 24px; }
}

@media (max-width: 860px) {
  .container-checkout {
    grid-template-columns: 1fr;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
  /* Order summary first on mobile so user sees what they're buying immediately */
  .machi_right-section { order: -1; border-bottom: 1px solid #eee; }
  .machi_left-section { border-right: none; padding: 24px 18px; }
  .machi_right-section { padding: 20px 18px; }
  .machi_summary-sticky { position: static; }
  .machi_summary-title { font-size: 18px; margin-bottom: 12px; }
  .machi_form-row-2 { grid-template-columns: 1fr; }
  .machi_shipping-options { grid-template-columns: 1fr; }
  .machi_payment-methods { grid-template-columns: 1fr 1fr; }
  /* Compact payment cards on mobile */
  .machi_payment-card { min-height: 110px; padding: 12px; }
  .machi_payment-amount-value { font-size: 22px; }
  .machi_payment-card-equivalent { font-size: 12px; }
}

/* Tablet portrait: 500â€“768px â€” tighten typography */
@media (max-width: 768px) {
  .title-crazy { font-size: 22px; }
  .machi_section-title { font-size: 18px; }
  .machi_pay-button { font-size: 14px; }
}

@media (max-width: 480px) {
  .machi_checkout-logo img { height: 44px; }
  .title-crazy { font-size: 20px; }
  .machi_section-title { font-size: 16px; }
  .machi_payment-methods { grid-template-columns: 1fr 1fr; }
  .machi_payment-method { min-height: 70px; padding: 10px 8px; }
  .machi_payment-icon img { height: 26px; }
  .machi_payment-text { font-size: 11px; }
  /* Payment cards: tighter at very small screens */
  .machi_payment-card { min-height: 100px; padding: 10px; }
  .machi_payment-amount-value { font-size: 20px; }
  .machi_payment-card-title { font-size: 12px; }
  .machi_payment-card-equivalent { font-size: 11px; }
  .machi_pay-button { padding: 13px; font-size: 14px; }
  /* Shipping card: prevent overflow on tiny screens */
  .machi_shipping-card { flex-wrap: wrap; gap: 8px; }
  .machi_shipping-card-pricewrap { align-items: flex-start; }
  /* Modal â€” compact to fit viewport without scrolling */
  .machi_modal { padding: 8px; align-items: flex-end; }
  .machi_modal_content { border-radius: 16px 16px 10px 10px; }
  .machi_modal_scroll { padding: 14px 14px 12px; max-height: 88vh; }
  #modalPaymentTitle { font-size: 15px; margin-bottom: 1px; }
  .machi_modal_order-id { margin-bottom: 5px; font-size: 10px; }
  #machi-modal_payment-container { padding: 8px 12px; margin-bottom: 8px; }
  .modal-usdt-amount { font-size: 18px; }
  .modal-bs-amount { font-size: 14px; }
  .instructions { padding: 7px 10px; margin-bottom: 7px; }
  .instructions-title { font-size: 12px; margin-bottom: 3px; }
  .instructions-hint { font-size: 12px; }
  .timer-section { padding: 5px 10px; margin-bottom: 7px; }
  .timer-text { font-size: 11px; }
  .timer-value { font-size: 13px; }
  #modalPaymentImage { width: 80% !important; max-width: 280px; margin-bottom: 4px; }
  .owner_payment-method { font-size: 13px; margin-bottom: 6px; }
  .custom-file-upload { margin-bottom: 6px; gap: 4px; }
  .upload-label { padding: 9px 12px; font-size: 13px; }
  #file-name { font-size: 11px; }
  .security-section { font-size: 11px; margin-bottom: 7px; }
  .confirm-button { padding: 12px; font-size: 14px; }
  .support-text, .support-link { font-size: 11px; }
}

/* === Touch targets === */
@media (pointer: coarse) {
  .machi_shipping-card,
  .machi_payment-method,
  .machi_radio-option-store,
  .machi_form-input,
  #departamento { min-height: 44px; }
  .machi_pay-button, .confirm-button, #cancelBtnInModal { min-height: 48px; }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .machi_payment-card,
  .machi_pay-button,
  .machi_shipping-card,
  .machi_payment-method { transition: none; }
  .machi_modal.fade-in, .machi_modal.fade-out, .machi_modal_content { animation: none; }
}

/* === Print === */
@media print {
  .machi_modal, .machi_pay-button, .machi_checkout-steps { display: none !important; }
  .container-checkout { grid-template-columns: 1fr; box-shadow: none; }
}

/* === Download QR button === */
.download-qr-btn {
  display: none; /* shown via JS when QR image is visible */
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 8px;
  padding: 8px 18px;
  /* Rojo de marca. El negro anterior no era de la casa y flotaba suelto en
     medio del modal. En movil este boton importa mas de lo que parece: no
     puedes escanear tu propia pantalla, asi que descargar la imagen y abrirla
     en la app del banco es a menudo la unica forma de pagar. */
  background: #ff0000;
  border: 1.5px solid #ff0000;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, transform 0.18s ease;
  width: fit-content;
}
/* Al pasar por encima: rojo hondo -- el mismo #b00000 con el que acaba el
   degradado de la barra del importe -- y el boton se levanta un poco con un
   halo rojo. Se siente pulsable sin cambiar de color a algo ajeno. */
.download-qr-btn:hover {
  background: #b00000;
  border-color: #b00000;
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.32);
  transform: translateY(-1px);
}
.download-qr-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 0, 0, 0.25);
}

/* Quien pide menos movimiento conserva el cambio de color, pero sin el salto. */
@media (prefers-reduced-motion: reduce) {
  .download-qr-btn,
  .download-qr-btn:hover,
  .download-qr-btn:active { transition: background 0.18s ease; transform: none; }
}

/* On desktop: smaller, secondary feel */
@media (min-width: 481px) {
  .download-qr-btn {
    font-size: 12px;
    padding: 6px 14px;
    background: #555;
  }
}

/* On mobile: prominent — full-width, bigger tap target */
@media (max-width: 480px) {
  .download-qr-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 10px;
    background: #1a1a1a;
    margin-bottom: 10px;
  }
}



/* ═══════════════════════════════════════════════════════════════════════════
   PAGO QR — esqueleto de carga, ampliar el QR y el visto de pago recibido
   Todo CSS puro: ni librerias ni peticiones. 10/09/2026
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── El hueco reservado mientras el banco genera el QR ──────────────────────
   Ocupa EXACTAMENTE lo que ocupara la imagen. Sin esto el modal daba un salto
   al llegar el QR, porque el hueco valia 0 y de pronto valia 300px. */
.cs-qr-skeleton {
  width: 88%;
  max-width: 300px;
  aspect-ratio: 1 / 1.18;      /* la imagen del banco es algo mas alta que ancha */
  margin: 0 auto 6px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background-color: #f2f2f2;
  background-image: linear-gradient(100deg, #f2f2f2 30%, #fafafa 50%, #f2f2f2 70%);
  background-size: 220% 100%;
  animation: csShimmer 1.25s ease-in-out infinite;
}

@keyframes csShimmer {
  from { background-position: 180% 0; }
  to   { background-position: -60% 0; }
}

/* ── El QR aparece fundiendo, no de golpe ─────────────────────────────────── */
.cs-qr-in { animation: csFadeIn 0.42s ease-out both; }

@keyframes csFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Tocar el QR para verlo grande ────────────────────────────────────────── */
#modalPaymentImage.cs-qr-zoomable { cursor: zoom-in; }

.cs-qr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;             /* por encima del modal de pago */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.86);
  cursor: zoom-out;
  animation: csFadeIn 0.2s ease-out both;
}

.cs-qr-lightbox img {
  max-width: min(96vw, 560px);
  max-height: 84vh;
  width: auto;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

.cs-qr-lightbox .cs-qr-lightbox-hint {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 14px;
  opacity: 0.85;
}

/* ── ¡Pago recibido! ───────────────────────────────────────────────────────
   Un visto que se dibuja solo. Sereno a proposito: el cliente acaba de
   entregar dinero de verdad, y la calma se lee como confianza. */
.cs-ok { text-align: center; padding: 6px 0 2px; }

.cs-ok-mark {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  display: block;
  position: relative;
}

.cs-ok-mark svg { width: 100%; height: 100%; display: block; }

.cs-ok-circle {
  stroke: #1d6b1d;
  stroke-width: 3.4;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: csDraw 0.42s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.cs-ok-check {
  stroke: #1d6b1d;
  stroke-width: 4.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* 36 = largo real del trazo (12.0 + 23.8). Con un numero mayor el visto
     terminaba de dibujarse al 75% y el resto de la animacion no hacia nada. */
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: csDraw 0.26s cubic-bezier(0.65, 0, 0.45, 1) 0.38s forwards;
}

@keyframes csDraw { to { stroke-dashoffset: 0; } }

/* Un unico anillo que se expande y se apaga. */
.cs-ok-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #1d6b1d;
  opacity: 0;
  animation: csRing 0.85s ease-out 0.5s both;
}

@keyframes csRing {
  from { transform: scale(1);    opacity: 0.55; }
  to   { transform: scale(1.55); opacity: 0; }
}

.cs-ok-title {
  color: #1d6b1d;
  font-size: 22px;
  font-weight: 700;
  animation: csRise 0.34s ease-out 0.46s both;
}

.cs-ok-sub {
  margin-top: 6px;
  color: #555;
  animation: csRise 0.34s ease-out 0.58s both;
}

@keyframes csRise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Respeta a quien pide menos movimiento ──────────────────────────────────
   Sin esto, alguien con "reducir movimiento" activado (mareos, migranas) se
   come igual el destello. Se muestra el resultado final, sin recorrido. */
@media (prefers-reduced-motion: reduce) {
  .cs-qr-skeleton { animation: none; }
  .cs-qr-in,
  .cs-ok-title,
  .cs-ok-sub,
  .cs-qr-lightbox { animation: none; opacity: 1; transform: none; }
  .cs-ok-circle,
  .cs-ok-check { animation: none; stroke-dashoffset: 0; }
  .cs-ok-ring { display: none; }
}

@media (max-width: 480px) {
  .cs-qr-skeleton { width: 80%; max-width: 280px; }
  .cs-ok-mark { width: 66px; height: 66px; }
  .cs-ok-title { font-size: 20px; }
}

/* ── Se acabó el tiempo ─────────────────────────────────────────────────────
   Sereno a propósito. El carrito acaba de vaciarse y al cliente se le va a
   mover de página: un aviso claro se lee como una web que funciona; una
   desaparición silenciosa, como una que se ha roto. */
.cs-timeout { text-align: center; padding: 26px 18px; }

.cs-timeout-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 10px;
  animation: csRise 0.36s ease-out both;
}

.cs-timeout-title {
  font-size: 20px;
  font-weight: 700;
  color: #b32d2e;
  animation: csRise 0.36s ease-out 0.08s both;
}

.cs-timeout-sub {
  margin-top: 8px;
  color: #555;
  font-size: 14.5px;
  line-height: 1.55;
  animation: csRise 0.36s ease-out 0.16s both;
}

/* Sólo se usa si el modal no estaba abierto (p. ej. lo cerró y siguió en la
   página). Sin esto el aviso se colaría al final del documento, donde nadie
   lo vería antes de la redirección. */
.cs-timeout-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
}

@media (prefers-reduced-motion: reduce) {
  .cs-timeout-icon,
  .cs-timeout-title,
  .cs-timeout-sub { animation: none; opacity: 1; transform: none; }
}

/* ── El hueco cuando lleva la animación Lottie dentro ───────────────────────
   Misma caja y misma medida que el shimmer: lo único que cambia es que se
   apaga el degradado latiente para que no compita con la animación. Si el
   reproductor no llega a cargar, esta clase no se añade y queda el shimmer. */
.cs-qr-skeleton.cs-qr-lottie {
  background-image: none;
  background-color: #fff;
  animation: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.cs-qr-skeleton.cs-qr-lottie svg { display: block; width: 100%; height: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   PAGO QR — espera y confirmación
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── «Esperando tu pago» ────────────────────────────────────────────────────
   El ⏳ estaba quieto: un reloj sin agujas, imposible saber si la página
   sigue viva. Ahora se voltea como un reloj de arena de verdad. */
.cs-wait-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #996800;
  font-weight: 700;
  font-size: 15.5px;
}

.cs-hourglass {
  display: inline-block;
  animation: csFlip 2.4s ease-in-out infinite;
}

@keyframes csFlip {
  0%, 40%  { transform: rotate(0deg); }
  50%, 90% { transform: rotate(180deg); }
  100%     { transform: rotate(180deg); }
}

/* Los puntos suspensivos, escribiéndose solos. */
.cs-dots::after {
  content: "";
  animation: csDots 1.4s steps(4, end) infinite;
}

@keyframes csDots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
}

.cs-wait-sub {
  margin-top: 7px;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}
/* La frase que de verdad quita la angustia: que no tiene que hacer nada más. */
.cs-wait-sub strong { color: #1a1a1a; }

/* ── El visto, con más presencia ────────────────────────────────────────────
   Entra rebotando y suelta tres anillos escalonados. Sin confeti: el cliente
   acaba de entregar dinero real y la calma se lee como una tienda que
   cumple; la fiesta, como una app. */
.cs-ok-mark {
  animation: csPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes csPop {
  0%   { transform: scale(0);    opacity: 0; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1);    opacity: 1; }
}

.cs-ok-ring.cs-r2 { animation: csRing 0.85s ease-out 0.68s both; }
.cs-ok-ring.cs-r3 { animation: csRing 0.85s ease-out 0.86s both; }

/* El número de pedido, en su propia caja: es lo que el cliente fotografía. */
.cs-ok-order {
  background: #f1f8f2;
  border-radius: 10px;
  padding: 12px;
  margin-top: 13px;
  animation: csRise 0.34s ease-out 0.7s both;
}
.cs-ok-order .cs-ok-label {
  font-size: 11.5px;
  color: #6a8a6c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.cs-ok-order .cs-ok-value {
  font-size: 15px;
  color: #1a1a1a;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .cs-hourglass,
  .cs-dots::after,
  .cs-ok-mark,
  .cs-ok-order { animation: none; opacity: 1; transform: none; }
  .cs-ok-ring { display: none; }
}

@media (max-width: 480px) {
  .cs-wait-title { font-size: 14.5px; }
  .cs-ok-order { padding: 10px; margin-top: 10px; }
  .cs-ok-order .cs-ok-value { font-size: 14px; }
  .security-section { padding: 6px 12px; font-size: 12px; }
}
