/* Shared PALMA V2 footer styles. Loaded on every public route that renders the theme footer. */
body.has-palma-v2-footer {
  --palma-v2-brand-red: #9c1319;
  --palma-v2-dark-2: #423d53;
}

/* PALMA Template V2 footer — SansanSports visual parity. */
body.has-palma-v2-footer .site-footer-v2 {
  margin: 0;
  color: #f6f4f0;
  font-family: "Reddit Sans", sans-serif;
  background: #303030;
}
body.has-palma-v2-footer .site-footer-v2 * { box-sizing: border-box; }

/* Homepage Final CTA seam. The footer owner controls this V2 front-page variant. */
@media (min-width: 1025px) {
  body.home.palma-template-v2.has-palma-v2-footer .site-footer-v2 { margin-top: -6px; }
}

/* Dark information area: 1440 × 829 on desktop. */
body.has-palma-v2-footer .footer-v2-main {
  width: 100%;
  padding: 80px 80px;
  background: #303030;
}
body.has-palma-v2-footer .footer-v2-inner {
  width: 98%;
  max-width: none;
  margin: 0 auto;
}
body.has-palma-v2-footer .footer-v2-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 20px;
  align-items: start;
  min-height: 270px;
}
body.has-palma-v2-footer .footer-v2-logo,
body.has-palma-v2-footer .footer-v2-logo img {
  display: block;
  width: 175px;
  height: 58px;
  object-fit: contain;
}
body.has-palma-v2-footer .footer-v2-brand p {
  width: 100%;
  max-width: none;
  min-height: 78px;
  margin: 31px 0 30px;
  color: #c9c4ca;
  font-size: 16px;
  line-height: 26px !important;
}
body.has-palma-v2-footer .footer-v2-social {
  display: flex;
  gap: 11px;
}
body.has-palma-v2-footer .footer-v2-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10%;
  color: #f6f4f0;
  background: var(--palma-social-background, rgba(246, 244, 240, 0.1));
}
body.has-palma-v2-footer .footer-v2-social svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
body.has-palma-v2-footer .footer-v2-social-facebook { background: #3b5998 !important; }
body.has-palma-v2-footer .footer-v2-social-instagram { background: #d13d9d !important; }
body.has-palma-v2-footer .footer-v2-social-youtube { background: #cd201f !important; }

/* Right-aligned contact content: fixed 380px within the flexible right half. */
body.has-palma-v2-footer .footer-v2-contact {
  justify-self: end;
  width: 380px;
  padding-top: 10px;
}
body.has-palma-v2-footer .footer-v2-contact h3 {
  margin: 0 0 24px;
  color: #c9c4ca !important;
  font-size: 20px;
  line-height: 23px;
  font-weight: 800 !important;
}
body.has-palma-v2-footer .footer-v2-contact ul,
body.has-palma-v2-footer .footer-v2-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
body.has-palma-v2-footer .footer-v2-contact li {
  display: flex;
  align-items: center;
  min-height: 31px;
}
body.has-palma-v2-footer .footer-v2-contact li + li { margin-top: 11px; }
body.has-palma-v2-footer .footer-v2-contact-icon {
  display: flex;
  width: 20px;
  height: 20px;
  margin-right: 13px;
  flex: 0 0 20px;
  color: #f6f4f0;
}
body.has-palma-v2-footer .footer-v2-contact-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
body.has-palma-v2-footer .footer-v2-contact a {
  color: #f6f4f0;
  font-size: 22px;
  line-height: 31px;
  text-decoration: none;
}
body.has-palma-v2-footer .footer-v2-contact > p {
  width: 380px;
  max-width: 100%;
  margin: 20px 0 0;
  color: #f6f4f0;
  font-size: 15px;
  line-height: 26px !important;
  font-weight: 300;
}

/* Sansan's desktop divider sits 62px below the intro block and 62px above nav. */
body.has-palma-v2-footer .footer-v2-divider {
  height: 1px;
  margin-top: 62px;
  background: #747181;
}

/* Five proportional navigation columns with 20px gutters. */
body.has-palma-v2-footer .footer-v2-nav {
  display: grid;
  grid-template-columns: minmax(0, 18.7fr) minmax(0, 23.4fr) minmax(0, 21.5fr) minmax(0, 18.7fr) minmax(0, 11.2fr);
  column-gap: 20px;
  align-items: start;
  min-height: 274px;
  margin-top: 62px;
}
body.has-palma-v2-footer .footer-v2-nav > div { min-width: 0; }
body.has-palma-v2-footer .footer-v2-nav h4 {
  margin: 0 0 20px;
  color: #c9c4ca !important;
  font-size: 14px;
  line-height: 19px;
  font-weight: 900 !important;
  text-transform: uppercase;
}
body.has-palma-v2-footer .footer-v2-nav li + li { margin-top: 4px; }
body.has-palma-v2-footer .footer-v2-nav a {
  color: #d8d5d5;
  font-size: 13px;
  line-height: 26px;
  text-decoration: none;
}
body.has-palma-v2-footer .footer-v2-nav a:hover {
  color: #cc3366;
  text-decoration: none;
}

/* Red copyright bar: 1440 × 46. */
body.has-palma-v2-footer .footer-v2-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 10px;
  color: #f6f4f0;
  background: #9c1319;
  font-size: 15px;
  line-height: 23px;
  font-weight: 300;
  text-align: center;
}
body.has-palma-v2-footer .footer-v2-copy a { display: none; }

/* Mobile footer: dark area 375px wide, two-column navigation. */
@media (max-width: 1024px) {
  body.has-palma-v2-footer .footer-v2-main { padding: 40px 20px; }
  body.has-palma-v2-footer .footer-v2-inner { width: 100%; }
  body.has-palma-v2-footer .footer-v2-divider { display: none; }
  body.has-palma-v2-footer .footer-v2-top {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
  }
  body.has-palma-v2-footer .footer-v2-logo,
  body.has-palma-v2-footer .footer-v2-logo img { width: 120px; height: 40px; }
body.has-palma-v2-footer .footer-v2-brand p {
    width: 100%;
    min-height: 110px;
    margin: 30px 0;
    color: #c9c4ca;
    font-size: 14px;
    line-height: 22px !important;
  }
  body.has-palma-v2-footer .footer-v2-contact {
    width: 100%;
    min-height: 235px;
    padding-top: 0;
  }
  body.has-palma-v2-footer .footer-v2-contact h3 {
    margin-bottom: 10px;
    color: #c9c4ca;
    font-size: 16px;
    line-height: 19px;
    font-weight: 800;
  }
  body.has-palma-v2-footer .footer-v2-contact li { min-height: 28px; }
  body.has-palma-v2-footer .footer-v2-contact li + li { margin-top: 8px; }
  body.has-palma-v2-footer .footer-v2-contact a {
    font-size: 20px;
    line-height: 28px;
  }
  body.has-palma-v2-footer .footer-v2-contact-icon svg { width: 18px; height: 18px; }
  body.has-palma-v2-footer .footer-v2-contact > p {
    width: 100%;
    min-height: 78px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 22px;
    font-weight: 400;
  }
  body.has-palma-v2-footer .footer-v2-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 20px;
    margin-top: 20px;
  }
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(1),
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(3),
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(5) { grid-column: auto; }
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(2),
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(4) { grid-column: auto; }
  body.has-palma-v2-footer .footer-v2-nav > div { width: 100%; }
  body.has-palma-v2-footer .footer-v2-nav h4 {
    margin-bottom: 8px;
    color: #c9c4ca;
    font-size: 14px;
    line-height: 19px;
  }
  body.has-palma-v2-footer .footer-v2-nav li { min-height: 22px; }
  body.has-palma-v2-footer .footer-v2-nav li + li { margin-top: 4px; }
  body.has-palma-v2-footer .footer-v2-nav a { display: block; line-height: 22px; }
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(1),
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(2),
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(1),
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(2),
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(5) { min-height: 0; }
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(3),
  body.has-palma-v2-footer .footer-v2-nav > :nth-child(4) { min-height: 0; }
  body.has-palma-v2-footer .footer-v2-nav a {
    color: #d8d5d5;
    font-size: 14px;
    line-height: 22px;
  }
  body.has-palma-v2-footer .footer-v2-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 5px 10px calc(5px + env(safe-area-inset-bottom, 0px));
    font-size: 13px;
    line-height: 18px;
  }
}

/* Tablet footer: use the available width instead of stretching the mobile
   two-column pattern to 768–1024px. */
@media (min-width: 768px) and (max-width: 1024px) {
  body.has-palma-v2-footer .footer-v2-main { padding: 56px 40px; }
  body.has-palma-v2-footer .footer-v2-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr);
    column-gap: 40px;
    min-height: 0;
  }
  body.has-palma-v2-footer .footer-v2-brand p {
    min-height: 0;
    margin: 24px 0 0;
  }
  body.has-palma-v2-footer .footer-v2-contact {
    justify-self: end;
    min-height: 0;
    padding-top: 0;
  }
  body.has-palma-v2-footer .footer-v2-contact > p { min-height: 0; }
  body.has-palma-v2-footer .footer-v2-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 24px;
    min-height: 0;
    margin-top: 48px;
  }
  body.has-palma-v2-footer .footer-v2-nav > div { min-height: 0; }
  body.has-palma-v2-footer .footer-v2-nav li { min-height: 0; }
  body.has-palma-v2-footer .footer-v2-nav a { line-height: 24px; }
}

/* Shared floating contact actions from the V2 homepage. */
body.has-palma-v2-footer .chat-tool {
  position: fixed;
  right: 43px;
  bottom: 240px;
  z-index: 900;
  width: 50px;
  height: 110px;
}
body.has-palma-v2-footer .chat-logo,
body.has-palma-v2-footer .chat-sub {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: var(--palma-v2-brand-red, #9c1319);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
body.has-palma-v2-footer .chat-sub {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}
body.has-palma-v2-footer .chat-whatsapp { bottom: 60px; }
body.has-palma-v2-footer .chat-actions { display: contents; }
body.has-palma-v2-footer .chat-email { bottom: 0; }
body.has-palma-v2-footer .chat-tool:hover .chat-sub,
body.has-palma-v2-footer .chat-tool:focus-within .chat-sub,
body.has-palma-v2-footer .chat-tool.open .chat-sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
body.has-palma-v2-footer .chat-tool:hover .chat-logo,
body.has-palma-v2-footer .chat-tool:focus-within .chat-logo,
body.has-palma-v2-footer .chat-tool.open .chat-logo {
  opacity: 0;
  visibility: hidden;
}
body.has-palma-v2-footer .chat-logo svg,
body.has-palma-v2-footer .chat-sub svg,
body.has-palma-v2-footer .back-to-top svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
body.has-palma-v2-footer .chat-logo:focus-visible,
body.has-palma-v2-footer .chat-sub:focus-visible,
body.has-palma-v2-footer .back-to-top:focus-visible {
  outline: 3px solid rgba(156, 19, 25, 0.35);
  outline-offset: 3px;
}
body.has-palma-v2-footer .back-to-top {
  position: fixed;
  right: 43px;
  bottom: 180px;
  z-index: 900;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: #b0b0b0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s, background 0.3s ease;
}
body.has-palma-v2-footer .back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
body.has-palma-v2-footer .back-to-top:hover,
body.has-palma-v2-footer .back-to-top:focus-visible {
  background: var(--palma-v2-dark-2, #423d53);
}
@media (max-width: 1024px) {
  body.has-palma-v2-footer .chat-tool {
    right: 12px;
    bottom: 169px;
  }
  body.has-palma-v2-footer .back-to-top {
    right: 12px;
    bottom: 109px;
  }
}
