/* Shop-only modal polish (scoped by body.shop-page) */

body.shop-page .modal-overlay {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
}

body.shop-page .modal-content {
  width: min(560px, calc(100vw - 32px));
  background: linear-gradient(145deg, rgba(20, 24, 33, 0.98), rgba(12, 14, 20, 0.98));
  border: 1px solid rgba(252, 157, 11, 0.22);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}

body.shop-page .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(252, 157, 11, 0.18), rgba(252, 157, 11, 0.06));
  border-bottom: 1px solid rgba(252, 157, 11, 0.14);
}

body.shop-page .modal-header h3,
body.shop-page .modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #fff;
}

body.shop-page .modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.25);
  color: #e5e7eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 20px;
}

body.shop-page .modal-close:hover {
  border-color: rgba(252, 157, 11, 0.45);
  background: rgba(252, 157, 11, 0.10);
}

body.shop-page .modal-body {
  padding: 16px;
  color: #cbd5e1;
}

body.shop-page .shop-modal-section-title {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: #e5e7eb;
}

body.shop-page .shop-modal-total {
  margin: 0 0 14px 0;
  color: #e5e7eb;
}

body.shop-page .shop-modal-total strong {
  color: #fc9d0b;
}

body.shop-page .shop-modal-field {
  margin-bottom: 12px;
}

body.shop-page .shop-modal-field label {
  display: block;
  margin-bottom: 6px;
  color: #e5e7eb;
  font-size: 0.9rem;
}

body.shop-page .shop-modal-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  outline: none;
}

body.shop-page .shop-modal-input:focus {
  border-color: rgba(252, 157, 11, 0.55);
  box-shadow: 0 0 0 3px rgba(252, 157, 11, 0.14);
}

body.shop-page .shop-modal-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.shop-page .shop-modal-primary {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #fc9d0b, #e68a00);
  color: #111827;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(252, 157, 11, 0.25);
}

body.shop-page .shop-modal-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(252, 157, 11, 0.34);
}

body.shop-page .shop-modal-help {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
}

body.shop-page .shop-success-title {
  margin: 0 0 14px 0;
  color: #e5e7eb;
}

body.shop-page .shop-success-title strong {
  color: #fc9d0b;
}

body.shop-page .shop-grants {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

body.shop-page .shop-grant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.22);
}

body.shop-page .shop-grant .left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.shop-page .shop-grant .icon {
  font-size: 18px;
}

body.shop-page .shop-grant .label {
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.shop-page .shop-grant .qty {
  color: #fff;
  font-weight: 800;
}

body.shop-page .shop-modal-actions {
  padding: 0 16px 16px 16px;
}

/* Real spinner for the div.loading-spinner used by shop.js */
body.shop-page .loading-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(252, 157, 11, 0.95);
  animation: shopSpin 0.9s linear infinite;
  padding: 0;
  color: transparent;
}

@keyframes shopSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  body.shop-page .modal-content { width: calc(100vw - 24px); }
  body.shop-page .shop-modal-grid2 { grid-template-columns: 1fr; }
}

/* Toast safety: keep “Purchase complete!” from stretching into a huge box */
body.shop-page .toast {
  position: fixed !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: 18px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(100px) !important;
  width: auto !important;
  height: auto !important;
  max-width: min(92vw, 560px) !important;
  border-radius: 12px !important;
}

body.shop-page .toast.show {
  transform: translateX(-50%) translateY(0) !important;
}

body.shop-page .toast-content {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}
