/* ─── Panel container ─── */
.mg-bacs-panel {
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── Bank details card ─── */
.mg-bacs-bank-details {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 22px;
  background: #fff;
}

.mg-bacs-bank-details h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
}

.mg-bacs-bank-intro {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 0.88rem;
}

.mg-bacs-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 24px;
}

.mg-bacs-bank-item {
  font-size: 0.82rem;
  color: #6b7280;
  position: relative;
}

.mg-bacs-label {
  display: block;
  margin-bottom: 2px;
}

.mg-bacs-bank-item strong {
  display: block;
  font-size: 0.95rem;
  color: #111827;
  margin-top: 2px;
}

/* ─── Copy button ─── */
.mg-bacs-copy-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.mg-bacs-copy-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

/* ─── Upload section ─── */
.mg-bacs-upload-section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 22px;
  background: #fff;
}

.mg-bacs-upload-section h4 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
}

/* ─── Dropzone ─── */
.mg-bacs-dropzone {
  position: relative;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

.mg-bacs-dropzone:hover,
.mg-bacs-dropzone:focus-visible {
  border-color: #9ca3af;
  background: #fafafa;
}

.mg-bacs-dropzone.is-dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.mg-bacs-dropzone.is-success {
  border-color: #86efac;
  border-style: solid;
  background: #f0fdf4;
}

.mg-bacs-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
}

/* ─── Idle state ─── */
.mg-bacs-dropzone-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mg-bacs-upload-icon {
  color: #9ca3af;
}

.mg-bacs-dropzone-text {
  font-size: 0.92rem;
  color: #374151;
  font-weight: 500;
}

.mg-bacs-dropzone-formats {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* ─── Preview state ─── */
.mg-bacs-dropzone-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.mg-bacs-preview-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.mg-bacs-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-bacs-preview-thumb svg {
  color: #6b7280;
}

.mg-bacs-preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mg-bacs-preview-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.mg-bacs-change-btn {
  font-size: 0.78rem;
  color: #3b82f6;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}

.mg-bacs-change-btn:hover {
  text-decoration: underline;
}

/* ─── Uploading state ─── */
.mg-bacs-dropzone-uploading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mg-bacs-dropzone-uploading span {
  font-size: 0.88rem;
  color: #6b7280;
}

.mg-bacs-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: mg-bacs-spin 0.7s linear infinite;
}

@keyframes mg-bacs-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Message ─── */
.mg-bacs-message {
  display: none;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
}

.mg-bacs-message.is-success {
  display: block;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.mg-bacs-message.is-error {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* ─── Place Order disabled ─── */
#place_order.mg-bacs-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .mg-bacs-bank-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
  }

  .mg-bacs-dropzone {
    padding: 22px 16px;
  }

  .mg-bacs-preview-name {
    max-width: 160px;
  }
}

@media (max-width: 400px) {
  .mg-bacs-bank-grid {
    grid-template-columns: 1fr;
  }
}
