.social-rail {
  --social-rail-width: 58px;
  --social-rail-ink: #f1eee8;
  --social-rail-muted: rgba(241, 238, 232, 0.62);
  --social-rail-border: rgba(241, 238, 232, 0.16);
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 44;
  display: flex;
  width: var(--social-rail-width);
  min-height: 284px;
  align-items: stretch;
  transform: translateY(-50%);
  transition: width 220ms ease;
  pointer-events: none;
}

.social-rail-line {
  position: absolute;
  top: -72px;
  bottom: -72px;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--social-rail-border) 18%, var(--social-rail-border) 82%, transparent);
}

.social-rail-links {
  display: grid;
  width: 100%;
  align-content: center;
  gap: 6px;
  padding: 16px 5px 16px 10px;
  border: 0;
  border-radius: 22px 0 0 22px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    backdrop-filter 220ms ease;
  pointer-events: auto;
}

.social-rail-link {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  overflow: hidden;
  border-radius: 16px;
  color: var(--social-rail-muted);
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.social-rail-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(241, 238, 232, 0.1);
  border-radius: 50%;
  color: currentColor;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.social-rail-icon img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 1;
  filter: none;
  transition: opacity 180ms ease, filter 180ms ease, transform 180ms ease;
}

.social-link img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.social-row .social-link img {
  width: 22px;
  height: 22px;
}

.social-rail-label {
  max-width: 0;
  overflow: hidden;
  color: var(--social-rail-ink);
  font-family: Manrope, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 220ms ease, opacity 180ms ease;
}

.social-rail-link:hover,
.social-rail-link:focus-visible {
  color: #2ca9df;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
  transform: translateX(-4px);
}

/* The full glass panel slides out from behind the hovered logo. */
.social-rail:hover .social-rail-links,
.social-rail:focus-within .social-rail-links {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 0;
  background:
    linear-gradient(
      180deg,
      rgba(7, 7, 7, 0.02) 0%,
      rgba(12, 12, 12, 0.24) 13%,
      rgba(12, 12, 12, 0.36) 50%,
      rgba(12, 12, 12, 0.24) 87%,
      rgba(7, 7, 7, 0.04) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 22px rgba(255, 255, 255, 0.035),
    0 18px 44px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(28px) saturate(72%) brightness(0.96);
  -webkit-backdrop-filter: blur(28px) saturate(72%) brightness(0.96);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.social-rail-link:hover .social-rail-icon,
.social-rail-link:focus-visible .social-rail-icon {
  border-color: currentColor;
  background: rgba(44, 169, 223, 0.1);
  transform: scale(1.06);
}

.social-rail-link:hover .social-rail-icon img,
.social-rail-link:focus-visible .social-rail-icon img {
  opacity: 1;
  filter: none;
  transform: scale(1.04);
}

.social-rail-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(44, 169, 223, 0.24);
}

.social-rail-link-facebook,
.social-rail-link-linkedin {
  color: #79bde1;
}

.social-rail-link-instagram {
  color: #b9a5c8;
}

.social-rail-link-telegram,
.social-rail-link-whatsapp,
.social-rail-link-viber {
  color: #2ca9df;
}

@media (min-width: 981px) {
  .social-rail:hover,
  .social-rail:focus-within {
    --social-rail-width: 154px;
  }

  .social-rail:hover .social-rail-label,
  .social-rail:focus-within .social-rail-label {
    max-width: 90px;
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .social-rail {
    --social-rail-width: 52px;
    right: 0;
    min-height: 240px;
  }

  .social-rail-line {
    top: -48px;
    bottom: -48px;
  }

  .social-rail-links {
    gap: 3px;
    padding: 12px 4px 12px 6px;
    border-radius: 18px 0 0 18px;
  }

  .social-rail-link {
    min-height: 44px;
  }

.social-rail-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .social-rail-label {
    display: none;
  }
}

@media (max-width: 640px) {
  .social-rail {
    right: 0;
    transform: translateY(-50%) scale(0.94);
    transform-origin: right center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-rail,
  .social-rail-link,
  .social-rail-icon,
  .social-rail-label {
    transition: none;
  }
}

html[data-theme="light"] .social-rail {
  --social-rail-ink: #f4f1eb;
  --social-rail-muted: rgba(244, 241, 235, 0.68);
  --social-rail-border: rgba(255, 255, 255, 0.16);
}

html[data-theme="light"] .social-rail-links {
  border: 1px solid rgba(23, 52, 75, 0.16);
  border-right: 0;
  background-color: var(--pricing-reference-bg, #fbfaf7);
  background-image: var(--decor-platinum);
  background-position: 0 0;
  background-repeat: repeat;
  background-size: var(--decor-size);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 34px rgba(23, 52, 75, 0.12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"] .social-rail-icon {
  border-color: rgba(34, 31, 26, 0.18);
}

html[data-theme="light"] .social-rail-link:hover,
html[data-theme="light"] .social-rail-link:focus-visible {
  background: rgba(191, 144, 91, 0.14);
}

html[data-theme="light"] .social-rail:hover .social-rail-links,
html[data-theme="light"] .social-rail:focus-within .social-rail-links {
  border-color: rgba(23, 52, 75, 0.2);
  border-right: 0;
  background-color: var(--pricing-reference-bg, #fbfaf7);
  background-image: var(--decor-platinum);
  background-position: 0 0;
  background-repeat: repeat;
  background-size: var(--decor-size);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 42px rgba(23, 52, 75, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  -webkit-mask-image: none;
  mask-image: none;
}

/* Keep page scroll arrows aligned with the collapsed social-icon lane. */
.page-scroll-controls {
  right: 6px;
  display: block;
  width: 42px;
  height: 1px;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(-50%) translateX(0) !important;
}

.page-scroll-button {
  position: absolute;
  left: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(var(--gold-rgb), 0.06) 56%),
    rgba(24, 21, 17, 0.94);
  border-color: rgba(var(--gold-rgb), 0.38);
  color: rgba(var(--primary-rgb), 0.92);
  opacity: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.page-scroll-button:first-child {
  top: -222px;
}

.page-scroll-button:last-child {
  top: 180px;
}

.page-scroll-button:disabled {
  opacity: 1;
  color: rgba(var(--primary-rgb), 0.42);
}

.page-scroll-button:hover,
.page-scroll-button:focus-visible {
  background:
    linear-gradient(145deg, rgba(var(--gold-rgb), 0.16), transparent 58%),
    rgba(40, 31, 22, 0.96);
  border-color: rgba(var(--primary-rgb), 0.78);
  color: var(--primary);
}

@media (max-width: 980px) {
  .page-scroll-controls {
    right: 6px;
    width: 40px;
    height: 1px;
    transform: translateY(0) !important;
  }

  .page-scroll-button:first-child {
    top: -204px;
  }

  .page-scroll-button:last-child {
    top: 164px;
  }
}

@media (max-width: 480px) {
  .page-scroll-controls {
    right: 6px;
  }
}

html[data-theme="light"] .page-scroll-button {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(var(--gold-rgb), 0.08)),
    rgba(245, 241, 233, 0.96);
  border-color: rgba(var(--primary-deep-rgb), 0.3);
  color: var(--primary-deep);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(var(--ink-rgb), 0.14);
}

html[data-theme="light"] .page-scroll-button:hover,
html[data-theme="light"] .page-scroll-button:focus-visible {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(var(--gold-rgb), 0.18)),
    rgba(255, 252, 245, 0.98);
  border-color: rgba(var(--primary-deep-rgb), 0.56);
  color: var(--primary-deep);
}
