.global-back-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
  color: #64748b;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.global-back-button:hover {
  background: #fff;
  color: #991b1b;
  border-color: #fecaca;
}

.global-back-button:active {
  transform: scale(0.98);
}

.global-back-button i {
  font-size: 0.72rem;
}

.global-back-button--inline {
  position: static;
  flex-shrink: 0;
  margin-inline-end: 0.5rem;
  z-index: 20;
}

header.top-nav .global-back-button--inline {
  margin-inline-end: 0.65rem;
  border-color: rgba(185, 28, 28, 0.18);
  color: #991b1b;
  background: rgba(255, 255, 255, 0.92);
}

.global-back-button--inline span {
  display: none;
}

.global-back-button--floating {
  position: fixed;
  top: 0.85rem;
  left: 1rem;
  right: auto;
  z-index: 9990;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(185, 28, 28, 0.14);
  color: #991b1b;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

html[dir="rtl"] .global-back-button--floating {
  left: auto;
  right: 1rem;
}

.global-back-button--floating span {
  display: inline;
}

body.has-sticky-top-header .global-back-button--floating {
  top: 4.35rem;
}

@media (min-width: 640px) {
  .global-back-button--inline {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .global-back-button--inline span {
    display: inline;
  }
}

@media (max-width: 640px) {
  .global-back-button--floating {
    top: 0.75rem;
    bottom: auto;
    left: 0.75rem;
    padding: 0.45rem 0.7rem;
  }

  html[dir="rtl"] .global-back-button--floating {
    left: auto;
    right: 0.75rem;
  }

  body.has-sticky-top-header .global-back-button--floating {
    top: 4.15rem;
    bottom: auto;
  }
}

body.global-back-hidden .global-back-button {
  display: none !important;
}
