html.farma-content-pending {
  overflow: hidden;
}

html.farma-content-pending body > :not(#farma-loading) {
  visibility: hidden !important;
}

/* Public pages with complete static markup paint immediately while CMS contact details hydrate. */
html[data-public-shell].farma-content-pending {
  overflow: auto;
}

html[data-public-shell].farma-content-pending body > :not(#farma-loading):not([hidden]):not([aria-hidden="true"]):not(#product-peek) {
  visibility: visible !important;
}

html[data-public-shell].farma-content-pending :is(.top-contact, .footer-contact) {
  visibility: hidden !important;
}

html[data-public-shell].farma-content-pending:not(.farma-content-error) #farma-loading {
  display: none;
}

#farma-loading {
  display: none;
}

html.farma-content-pending #farma-loading,
html.farma-content-error #farma-loading {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  box-sizing: border-box;
  background: #eef5fb;
  color: #0a2540;
  font: 600 16px/1.8 Vazirmatn, sans-serif;
  text-align: center;
}

#farma-loading::before {
  content: "";
  width: 30px;
  height: 30px;
  border: 3px solid #c5d9e8;
  border-top-color: #005eb8;
  border-radius: 50%;
  animation: farma-loading-spin .8s linear infinite;
}

html.farma-content-error #farma-loading::before {
  display: none;
}

#farma-loading-retry {
  display: none;
  border: 1px solid #005eb8;
  border-radius: 8px;
  padding: 9px 20px;
  background: #fff;
  color: #0a2540;
  font: inherit;
  cursor: pointer;
}

html.farma-content-error #farma-loading-retry {
  display: inline-block;
}

@keyframes farma-loading-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  #farma-loading::before { animation: none; }
}
