/* =========================================================================
   SITE FOOTER (every storefront page). One markup, token-only: the same
   layout and hierarchy in both themes, only the surface changes - a step
   above the near-black canvas in dark mode, white on the light canvas.
   The legacy .site-footer / .footer-back-to-top rules in homepage.css no
   longer match this markup (it uses the moto-footer classes).
   ========================================================================= */

.moto-footer-top,
.moto-footer {
  --footer-bg: var(--moto-sidebar);
  --footer-gutter: clamp(16px, 4vw, 40px);
}

html[data-theme="light"] :is(.moto-footer-top, .moto-footer) {
  --footer-bg: var(--moto-panel);
}

.moto-footer *,
.moto-footer *::before,
.moto-footer *::after {
  box-sizing: border-box;
}

.moto-footer__sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ------------------------------------------------------- back-to-top bar
   The existing text-roll button (homepage.css #backToTopBtn) on the footer
   surface, in the theme's text colour. */
.moto-footer-top {
  display: flex;
  justify-content: center;
  margin-top: clamp(40px, 6vw, 72px);
  padding: 18px var(--footer-gutter) 6px;
  border-top: 1px solid var(--moto-border);
  background: var(--footer-bg);
}

.moto-footer-top #backToTopBtn.btn-back-to-top {
  color: var(--moto-text) !important;
}

.moto-footer-top #backToTopBtn.btn-back-to-top:hover {
  color: var(--moto-red) !important;
}

.moto-footer-top #backToTopBtn.btn-back-to-top:focus-visible {
  outline: 2px solid var(--moto-red);
  outline-offset: 2px;
}

.moto-footer-top #backToTopBtn.btn-back-to-top .clone > *,
.moto-footer-top #backToTopBtn.btn-back-to-top .text > * {
  font-size: 1.1rem !important;
}

/* ---------------------------------------------------------------- footer */
.moto-footer {
  padding: 36px var(--footer-gutter) 0;
  background: var(--footer-bg);
  color: var(--moto-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.moto-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(28px, 4vw, 56px);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 36px;
}

.moto-footer__heading {
  margin: 0 0 14px;
  color: var(--moto-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.moto-footer__heading:not(:first-child) {
  margin-top: 26px;
}

.moto-footer__text {
  max-width: 34ch;
  margin: 0 0 14px;
}

.moto-footer a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.moto-footer a:hover {
  color: var(--moto-text);
}

.moto-footer a:focus-visible {
  outline: 2px solid var(--moto-red);
  outline-offset: 2px;
  border-radius: 4px;
}

.moto-footer__links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.moto-footer__links a {
  display: inline-block;
  line-height: 1.4;
}

/* Brand column: the wordmark, how to reach the team, where to follow */
.moto-footer__logo {
  display: inline-flex;
  margin: -4px 0 18px -6px;
}

/* The logo files are 500px squares with the wordmark and gauge in a band
   around 32-55% of the height: crop to that band. */
.moto-footer__logo-img {
  display: block;
  width: 168px;
  height: 52px;
  object-fit: cover;
  object-position: 50% 41%;
}

.moto-footer__logo-img.logo-light,
html[data-theme="light"] .moto-footer__logo-img.logo-dark {
  display: none;
}

html[data-theme="light"] .moto-footer__logo-img.logo-light {
  display: block;
}

.moto-footer__contact {
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.moto-footer__contact li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.moto-footer__contact svg {
  width: 18px;
  height: 18px;
  color: var(--moto-muted);
}

.moto-footer__contact svg {
  margin-top: 2px;
}

.moto-footer__label {
  display: block;
  margin-bottom: 2px;
  color: var(--moto-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.moto-footer__contact a {
  color: var(--moto-text-secondary);
  font-weight: 600;
}

.moto-footer__contact li > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Real coloured logos with no names. The negative margin lines the first logo up
   with the label above it: the link is 5px wider than the logo on each side. */
.moto-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: -5px;
}

.moto-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--moto-text);
  transition: opacity var(--dur-fast) ease;
}

.moto-footer__social a:hover {
  opacity: 0.75;
}

.moto-footer__social a:focus-visible {
  border-radius: 50%;
  outline-offset: 1px;
}

.moto-footer__social svg {
  display: block;
  width: 30px;
  height: 30px;
}

/* Newsletter: one field and a square send button, on one row at every width
   (the form keeps .newsletter-form for its submit handler, so the legacy
   phone rules that stack it are pinned back with !important here) */
.moto-footer .moto-footer__form {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.moto-footer .moto-footer__form input {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  height: var(--btn-h);
  padding: 0 16px !important;
  border: 1px solid var(--moto-border-subtle);
  border-radius: var(--btn-radius);
  background: var(--moto-panel-inset);
  color: var(--moto-text);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.moto-footer .moto-footer__form input::placeholder {
  color: var(--moto-text-dim);
}

.moto-footer .moto-footer__form input:focus-visible {
  border-color: var(--moto-red);
  box-shadow: 0 0 0 3px var(--moto-red-glow);
}

.moto-footer .moto-footer__form button {
  --footer-press: var(--ix-release-dur) var(--ix-spring);
  display: inline-grid;
  flex: none;
  width: var(--btn-h) !important;
  height: var(--btn-h);
  place-items: center;
  padding: 0 !important;
  border: 0;
  border-radius: var(--btn-radius);
  background: var(--moto-red-solid);
  color: #ffffff;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, scale var(--footer-press);
}

.moto-footer .moto-footer__form button svg {
  width: 20px;
  height: 20px;
  transition: translate var(--dur-base) var(--ix-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .moto-footer .moto-footer__form button:hover:not(:disabled) {
    background: var(--moto-red-dark);
  }

  .moto-footer .moto-footer__form button:hover:not(:disabled) svg {
    translate: 3px 0;
  }
}

.moto-footer .moto-footer__form button:active:not(:disabled) {
  --footer-press: var(--ix-press-dur) var(--ix-ease-out);
  scale: var(--ix-press-btn);
}

.moto-footer .moto-footer__form button:focus-visible {
  outline: 2px solid var(--moto-red);
  outline-offset: 2px;
}

.moto-footer .moto-footer__form button:disabled {
  background: var(--moto-panel-soft);
  color: var(--moto-text-dim);
  cursor: progress;
}

/* Payment and financing marks: the brand's own dark / light artwork, no
   tiles (the same pair the homepage uses) */
.moto-footer__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Display only: not links, so no hover or pointer */
.moto-footer__mark {
  display: inline-flex;
  align-items: center;
  height: 32px;
  opacity: 0.9;
  cursor: default;
}

.moto-footer__logos img {
  display: block;
  width: auto;
  max-width: 96px;
  height: 22px;
  object-fit: contain;
}

.moto-footer__logos .logo-on-light,
html[data-theme="light"] .moto-footer__logos .logo-on-dark {
  display: none;
}

html[data-theme="light"] .moto-footer__logos .logo-on-light {
  display: block;
}

.moto-footer__bottom {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 0 24px;
  border-top: 1px solid var(--moto-border);
}

.moto-footer__bottom p {
  margin: 0;
  color: var(--moto-muted);
  font-size: 0.8rem;
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 991.98px) {
  .moto-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .moto-footer {
    padding-top: 28px;
  }

  .moto-footer__grid {
    gap: 28px 20px;
    padding-bottom: 28px;
  }

  .moto-footer__brand,
  .moto-footer__news {
    grid-column: 1 / -1;
  }

  .moto-footer .moto-footer__form {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .moto-footer a,
  .moto-footer__social a,
  .moto-footer .moto-footer__form input,
  .moto-footer .moto-footer__form button,
  .moto-footer .moto-footer__form button svg {
    transition: none;
  }

  .moto-footer .moto-footer__form button:active:not(:disabled) {
    scale: none;
  }
}
