/* ==========================================================================
   PRO-valikko (pro_nav_block) – floating bottom bar
   All rules scoped to .pro-nav / .rs-pro-lift
   ========================================================================== */

:root {
  --pro-nav-h: 0px;          /* set by JS to the bar's real height */
  --pro-nav-speed: .3s;
  --pro-nav-ease: cubic-bezier(.2, .7, .2, 1);
}

.pro-nav {
  background: var(--color-primary);
  bottom: 0;
  box-shadow: 0 -.25rem 1.5rem rgba(42, 54, 63, .12);
  color: #fff;
  left: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: fixed;
  right: 0;
  transform: translateY(100%);
  transition: transform var(--pro-nav-speed) var(--pro-nav-ease), visibility 0s linear var(--pro-nav-speed);
  visibility: hidden;
  z-index: 98; /* below the site header (99) */
}
.pro-nav.is-visible {
  transform: translateY(0);
  transition: transform var(--pro-nav-speed) var(--pro-nav-ease), visibility 0s;
  visibility: visible;
}

.pro-nav-inner {
  align-items: center;
  display: flex;
  gap: 2rem;
  margin: 0 auto;
  max-width: 75rem;
  min-height: 4.5rem;
  padding: .75rem 1.5rem;
}

.pro-nav-label {
  color: #fff;
  flex: 0 0 auto;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
}

.pro-nav-items {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 2.25rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;

  /* Beat the theme's "ul li:not(:last-child) { margin-bottom }" */
  li,
  li:not(:last-child) {
    margin: 0;
    padding: 0;
  }
}

.pro-nav-link {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: .9375rem;
  gap: .625rem;
  line-height: 1.2;
  text-decoration: none;

  &:hover,
  &:focus,
  &:visited {
    color: #fff;
  }
  &:focus-visible {
    border-radius: .25rem;
    outline: 2px solid #fff;
    outline-offset: .25rem;
  }
}

/* Underline only under the text */
.pro-nav-title {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: .375rem;
  transition: text-decoration-color .2s ease;
}
.pro-nav-link:hover .pro-nav-title {
  text-decoration-color: rgba(255, 255, 255, .6);
}
.pro-nav-link.is-active .pro-nav-title {
  font-weight: 700;
  text-decoration-color: #fff;
}

/* Icons are green circles: a white ring keeps them visible on the green bar */
.pro-nav-icon {
  background: #fff;
  border-radius: 50%;
  display: block;
  flex: 0 0 auto;
  height: 2rem;
  padding: 2px;
  width: 2rem;

  img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
  }
}

/* Button: white on the green bar */
.pro-nav-button {
  flex: 0 0 auto;

  .btn,
  .btn.btn-primary,
  .btn.btn-primary:visited {
    background: #fff;
    border-color: #fff;
    color: var(--color-dark);
    font-size: 1rem;
    margin: 0;
    padding: .625rem 1.25rem;
    white-space: nowrap;
  }
  .btn.btn-primary:hover,
  .btn.btn-primary:focus {
    background: var(--color-dark);
    border-color: var(--color-dark);
    color: #fff;
  }
}

/* Mobile – from the width where the PRO intro columns stack (< 1024px):
   equal columns, icon above the full name, no label or button */
@media (max-width: 1023px) {
  .pro-nav-inner {
    gap: 0;
    min-height: 0;
    padding: .5rem 0;
  }
  .pro-nav-label,
  .pro-nav-button {
    display: none;
  }
  .pro-nav-items {
    align-items: stretch;
    display: grid;
    gap: 0;
    grid-template-columns: repeat(var(--pro-nav-count, 3), minmax(0, 1fr));
  }
  .pro-nav-link {
    flex-direction: column;
    font-size: .8125rem;
    gap: .375rem;
    height: 100%;
    justify-content: center;
    padding: .25rem;
    text-align: center;
  }
  .pro-nav-title {
    text-underline-offset: .25rem;
  }
  /* No white ring on mobile: the icon's own green circle melts into the bar,
     so only the white symbol shows – zoomed in to make it bigger */
  .pro-nav-icon {
    background: none;
    border-radius: 0;
    height: 2.25rem;
    overflow: hidden;
    padding: 0;
    width: 2.25rem;

    img {
      transform: scale(1.6);
    }
  }
}

/* Third-party bottom elements (chat, Trustmary, Cookiebot) lift above the bar
   with the same slide. JS tags their fixed elements with .rs-pro-lift. */
html.pro-nav-visible .rs-pro-lift {
  translate: 0 calc(-1 * var(--pro-nav-h)) !important;
}

@media (prefers-reduced-motion: reduce) {
  :root { --pro-nav-speed: 0s; }
}
