/*
 * Social buttons for the Site homepage and Contacts page.
 * The stylesheet is loaded only on those two routes.
 * Keep shared footer styles for Shop, Blog and Helpdesk unchanged.
 */
:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Geometry and glass treatment match the repair page's messenger buttons. */
:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a {
  --social-color: #c6d1ff;
  --social-border: rgba(162, 183, 255, 0.32);
  --social-background: rgba(115, 141, 220, 0.1);
  position: relative;
  display: inline-flex;
  flex: 0 1 auto;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 51px;
  padding: 14px 18px;
  border: 1px solid var(--social-border);
  border-radius: 999px;
  color: var(--social-color);
  background: var(--social-background);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 12px 38px rgba(0, 0, 0, 0.28),
    0 0 22px rgba(127, 161, 255, 0.06);
  backdrop-filter: blur(22px) saturate(155%);
  font-size: 15px;
  font-weight: 470;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    112deg,
    rgba(255, 190, 126, 0.14),
    transparent 34%,
    transparent 70%,
    rgba(127, 187, 255, 0.12)
  );
  opacity: 0.7;
  pointer-events: none;
  content: "";
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a:hover {
  border-color: currentColor;
  color: var(--social-color);
  background: var(--social-background);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 16px 42px rgba(0, 0, 0, 0.36),
    0 0 28px rgba(136, 157, 255, 0.13);
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a:focus-visible {
  outline: 2px solid var(--social-color);
  outline-offset: 4px;
  border-color: currentColor;
  color: var(--social-color);
  background: var(--social-background);
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a:active {
  transform: translateY(0) scale(0.985);
}

/* Full labels remain visible; icon wrappers have no separate accent colour. */
:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a > * {
  position: relative;
  z-index: 1;
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a > span {
  overflow: visible;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-overflow: clip;
  white-space: nowrap;
}

.app-site .wa-contact-channel-list .wa-contact-action__icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) svg {
  display: block;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: currentColor;
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) svg :is(rect, circle:not(.is-filled)) {
  fill: none;
  stroke: currentColor;
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) svg .is-filled {
  fill: currentColor;
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) svg .is-cutout {
  fill: #171c2b;
}

/* Brand colours. URLs remain in the existing CMS and theme settings. */
:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) [data-network="telegram"] {
  --social-color: #acdfff;
  --social-border: rgba(113, 198, 255, 0.32);
  --social-background: rgba(54, 151, 211, 0.1);
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) [data-network="viber"] {
  --social-color: #d9c5ff;
  --social-border: rgba(177, 137, 255, 0.32);
  --social-background: rgba(138, 94, 209, 0.1);
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) [data-network="facebook"] {
  --social-color: #b1ceff;
  --social-border: rgba(112, 164, 255, 0.32);
  --social-background: rgba(59, 113, 204, 0.1);
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) [data-network="instagram"] {
  --social-color: #f5bbdc;
  --social-border: rgba(226, 130, 184, 0.32);
  --social-background: rgba(194, 78, 143, 0.1);
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) [data-network="youtube"] {
  --social-color: #ffb7bd;
  --social-border: rgba(245, 123, 134, 0.32);
  --social-background: rgba(214, 72, 87, 0.1);
}

:is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) [data-network="messenger"] {
  --social-color: #c6cfff;
  --social-border: rgba(145, 166, 255, 0.32);
  --social-background: rgba(101, 117, 216, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  :is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a {
    transition: none;
  }

  :is(.app-site.is-home .finale-socials__grid, .app-site .wa-contact-channel-list) > a:hover {
    transform: none;
  }
}

/* DEBUG: uncomment to inspect button group boundaries. */
/* .wa-contact-channel-list, .app-site.is-home .finale-socials__grid { outline: 1px dashed #c6d1ff; } */

/* Even rows in the narrow homepage card; collapse safely on very small screens. */
@media (max-width: 650px) {
  .app-site.is-home .finale-socials__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr));
  }

  .app-site.is-home .finale-socials__grid > a {
    padding-inline: 10px;
  }
}
