/* WA Checkout Pro — Frontend */
.wac-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #25D366; color: #fff; font-size: 15px; font-weight: 600;
  padding: 14px 28px; border: none; border-radius: 8px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, filter .15s;
  box-shadow: 0 3px 12px rgba(37,211,102,.35); letter-spacing: .01em;
}
.wac-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,211,102,.45); filter: brightness(1.06); }
.wac-btn:active { transform: translateY(0); }

/* Overlay */
.wac-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  z-index: 999999; align-items: center; justify-content: center; padding: 16px;
}
.wac-overlay.wac-active { display: flex; animation: wacFadeIn .2s ease; }
@keyframes wacFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Modal */
.wac-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 620px;
  max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  animation: wacSlideUp .25s cubic-bezier(.34,1.56,.64,1); overflow: hidden;
}
@keyframes wacSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Header */
.wac-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; background: linear-gradient(135deg,#25D366,#128C7E); flex-shrink: 0;
}
.wac-header-inner { display: flex; align-items: center; gap: 10px; }
.wac-wa-icon { width: 36px; height: 36px; background: rgba(255,255,255,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.wac-modal-header h2 { margin: 0; font-size: 17px; font-weight: 700; color: #fff !important; }
.wac-close { background: rgba(255,255,255,.2); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.wac-close:hover { background: rgba(255,255,255,.35); }

/* Body */
.wac-modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.wac-modal-body::-webkit-scrollbar { width: 5px; }
.wac-modal-body::-webkit-scrollbar-thumb { background: #c8e6c9; border-radius: 3px; }

/* Product banner */
.wac-product-banner { background: linear-gradient(135deg,#f0fdf4,#dcfce7); border: 1px solid #bbf7d0; border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; color: #166534; font-weight: 500; }
.wac-product-banner:empty { display: none; }

/* Section label */
.wac-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #6b7280; margin: 16px 0 10px; display: flex; align-items: center; gap: 8px; }
.wac-section-label::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }

/* Form fields */
.wac-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wac-form-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.wac-form-field label { font-size: 13px; font-weight: 600; color: #374151; margin: 0; }
.wac-req { color: #ef4444; }
.wac-form-field input,
.wac-form-field select,
.wac-form-field textarea {
  border: 1.5px solid #d1d5db; border-radius: 8px; padding: 10px 12px;
  font-size: 14px; color: #1f2937; background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%; box-sizing: border-box; outline: none; font-family: inherit;
}
.wac-form-field input:focus,
.wac-form-field select:focus,
.wac-form-field textarea:focus { border-color: #25D366; box-shadow: 0 0 0 3px rgba(37,211,102,.15); }
.wac-form-field input.wac-error,
.wac-form-field select.wac-error,
.wac-form-field textarea.wac-error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.wac-form-field select:disabled { background: #f9fafb; color: #9ca3af; }
.wac-form-field textarea { resize: vertical; min-height: 66px; }
.wac-form-field input[readonly] { background: #f9fafb; color: #6b7280; }

/* Shipping */
.wac-shipping-wrap { border: 1.5px solid #e5e7eb; border-radius: 10px; overflow: hidden; min-height: 80px; }
.wac-shipping-placeholder, .wac-shipping-loading { display: flex; align-items: center; justify-content: center; gap: 8px; height: 80px; color: #9ca3af; font-size: 14px; }
.wac-spinner { width: 20px; height: 20px; border: 2.5px solid #e5e7eb; border-top-color: #25D366; border-radius: 50%; animation: wacSpin .7s linear infinite; }
@keyframes wacSpin { to { transform: rotate(360deg); } }
.wac-shipping-item { display: flex; align-items: center; padding: 11px 14px; cursor: pointer; transition: background .12s; border-bottom: 1px solid #f3f4f6; gap: 12px; }
.wac-shipping-item:last-child { border-bottom: none; }
.wac-shipping-item:hover { background: #f0fdf4; }
.wac-shipping-item.selected { background: #dcfce7; }
.wac-shipping-item input[type=radio] { accent-color: #25D366; width: 16px; height: 16px; flex-shrink: 0; }
.wac-courier-name { flex: 1; font-size: 13px; font-weight: 600; color: #1f2937; }
.wac-courier-etd { font-size: 12px; color: #059669; font-weight: 600; white-space: nowrap; }
.wac-courier-price { font-size: 14px; font-weight: 700; color: #1f2937; white-space: nowrap; }
.wac-error-msg { display: flex; align-items: center; justify-content: center; height: 80px; color: #dc2626; font-size: 13px; }

/* Footer */
.wac-modal-footer { padding: 16px 24px; border-top: 1px solid #f3f4f6; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.wac-footer-label { font-size: 13px; color: #6b7280; flex: 1; }
.wac-footer-label.has-selection { color: #059669; font-weight: 600; }
.wac-send-btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg,#25D366,#128C7E); color: #fff; border: none; border-radius: 8px; padding: 12px 22px; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s; box-shadow: 0 3px 12px rgba(37,211,102,.35); white-space: nowrap; }
.wac-send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,211,102,.4); }

/* Mobile */
@media (max-width: 540px) {
  .wac-modal { max-height: 100vh; border-radius: 16px 16px 0 0; }
  .wac-overlay { align-items: flex-end; padding: 0; }
  .wac-form-row { grid-template-columns: 1fr; }
  .wac-modal-footer { flex-direction: column; }
  .wac-send-btn { width: 100%; justify-content: center; }
}
