﻿/* ============================================================================
 * 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;
  max-width: 400px;
  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 {
  background: linear-gradient(135deg, #1a1a1a 0%, #7f1d1d 100%);
  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 {
  background: #f8f9ff;
  border: 1px solid #e3e8ff;
  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;
}
.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;
  width: 44% !important;
  max-width: 160px;
  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 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #888;
  margin: 0 0 12px;
}

/* 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: 38% !important; 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;
  background: #1a1a1a;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s;
  width: fit-content;
}
.download-qr-btn:hover { background: #333; }

/* 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;
  }
}

