/* ==========================================================================
 Footer and the floating Call and WhatsApp buttons with their popups
 Also holds the reduced-motion overrides for shared components.
 ========================================================================== */

/* A deep navy band that closes every page: a closing title with the contact buttons, four columns, then the
   copyright line. Built by renderFooter() in templates/parts.mjs */
.site-footer {
  --footer-text: rgba(222, 231, 243, 0.7);
  --footer-strong: #f4f7fb;
  --footer-line: rgba(255, 255, 255, 0.09);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 56px 0 104px; /* room at the foot for the floating Contact us button */
  background:
    radial-gradient(ellipse 70% 55% at 88% 0%, rgba(163, 38, 31, 0.38), transparent 65%),
    radial-gradient(ellipse 55% 45% at 0% 100%, rgba(90, 190, 235, 0.1), transparent 60%),
    radial-gradient(ellipse 40% 40% at 100% 100%, rgba(200, 50, 43, 0.1), transparent 60%), var(--carbon);
  color: var(--footer-text);
  font-size: 15px;
  line-height: 1.6;
}
/* Fine grain over the gradients, for depth */
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (min-width: 768px) {
  .site-footer {
    padding-top: 80px;
  }
}

/* Closing title and the main contact buttons */
.footer-top {
  display: grid;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--footer-line);
}
@media (min-width: 960px) {
  .footer-top {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 48px;
    padding-bottom: 56px;
  }
}
.footer-logo {
  display: inline-block;
  border-radius: 999px;
}
.footer-logo .brand-logo {
  height: 40px;
}
.footer-title {
  margin-top: 24px;
  max-width: 13em;
  color: var(--footer-strong);
  font-size: clamp(40px, 9vw, 64px);
  line-height: 1.04;
}
.footer-title em {
  color: var(--accent-ink-dark);
}
.footer-lead {
  margin-top: 16px;
  max-width: 34em;
  line-height: 1.7;
}
.footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .footer-actions {
    display: flex;
    flex-wrap: wrap;
  }
}
.footer-actions .btn {
  padding-inline: 20px;
}
.footer-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--footer-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.footer-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 10px 28px rgba(163, 38, 31, 0.3);
}
.footer-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

/* The four columns: two side by side on phones, four across on wide screens */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 24px;
  padding-block: 40px;
}
.footer-grid > .footer-column:nth-child(n + 3) {
  grid-column: 1 / -1;
}
@media (min-width: 640px) {
  .footer-grid > .footer-column:nth-child(n + 3) {
    grid-column: auto;
  }
}
@media (min-width: 1100px) {
  .footer-grid {
    grid-template-columns: 0.8fr 1.1fr 1.25fr 1.1fr;
    gap: 40px;
    padding-block: 56px;
  }
}
.footer-column {
  min-width: 0;
}
.footer-column h2 {
  margin-bottom: 16px;
  color: var(--footer-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.footer-links,
.footer-contact {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a:not(.btn) {
  border-radius: 6px;
  transition: color 0.2s ease;
}
.footer-links a,
.footer-contact a,
.footer-policies a,
.footer-top-link {
  color: var(--footer-text);
}
.footer-links a {
  display: inline-block;
  transition:
    color 0.2s ease,
    transform 0.3s var(--ease-spring);
}
.site-footer :is(.footer-links, .footer-contact, .footer-policies) a:hover,
.footer-top-link:hover,
.footer-directions:hover {
  color: #fff;
}
.footer-links a:hover {
  transform: translateX(4px);
}
.site-footer a:active {
  color: var(--accent-ink-dark);
}
.site-footer a:focus-visible {
  outline: 2px solid var(--accent-ink-dark);
  outline-offset: 3px;
}

/* Contact: each number with a WhatsApp chip beside it, then email and Instagram */
.footer-note {
  margin: -8px 0 14px;
  font-size: 13px;
}
.footer-contact li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}
.footer-contact a,
.footer-number,
.footer-place {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.footer-number {
  color: var(--footer-strong);
  font-weight: 600;
  white-space: nowrap;
}
.site-footer svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--accent-ink-dark);
}
.site-footer .footer-contact .footer-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(18, 140, 74, 0.2);
  box-shadow: inset 0 0 0 1px rgba(80, 200, 130, 0.35);
  color: #9fe3bb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition:
    background-color 0.2s ease,
    transform 0.25s var(--ease-spring);
}
.footer-contact .footer-chip:hover {
  background: rgba(18, 140, 74, 0.36);
  color: #fff;
  transform: translateY(-1px);
}
.footer-contact .footer-chip:active {
  transform: none;
}

/* Opening hours, the town and directions */
.footer-hours {
  display: grid;
  gap: 14px;
  margin: 0;
}
.footer-hours dt {
  color: var(--footer-strong);
  font-weight: 600;
}
.footer-hours dd {
  margin: 0;
}
.footer-place {
  margin-top: 20px;
  align-items: flex-start;
}
.footer-place svg {
  margin-top: 2px;
}
.footer-directions {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-ink-dark);
  font-weight: 600;
}
.footer-directions span {
  display: inline-block;
  transition: transform 0.3s var(--ease-spring);
}
.footer-directions:hover span {
  transform: translateX(4px);
}

/* Copyright, the policy pages and back to top */
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--footer-line);
  font-size: 13px;
}
.footer-policies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
@media (min-width: 768px) {
  .footer-policies {
    margin-right: auto;
  }
}
.footer-top-link span {
  display: inline-block;
  transition: transform 0.3s var(--ease-spring);
}
.footer-top-link:hover span {
  transform: translateY(-3px);
}

/* Floating Contact button in the corner of every page. A tap fans out Instagram, Directions, Call and WhatsApp
   above it (js/main.js); Call and WhatsApp then open a popup listing both numbers */
.contact-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45; /* above the page, under the header so the open mobile menu covers it */
  transition:
    opacity 0.35s ease,
    transform 0.6s var(--ease-spring);
}
.float-button {
  --float-color: var(--blue);
  --float-glow: rgba(42, 93, 154, 0.32);
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--float-color);
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 8px 24px var(--float-glow),
    0 2px 6px rgba(20, 45, 80, 0.18);
  transition:
    transform 0.3s var(--ease-spring),
    box-shadow 0.3s var(--ease-spring);
}
.float-button svg {
  width: 24px;
  height: 24px;
}
.float-button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 14px 32px var(--float-glow),
    0 2px 6px rgba(20, 45, 80, 0.18);
}
.float-button:active {
  transform: scale(0.94);
}
.whatsapp-float {
  --float-color: var(--whatsapp);
  --float-glow: rgba(18, 140, 74, 0.34);
}
.instagram-float {
  --float-color: radial-gradient(circle at 30% 110%, #fdc468 0%, #f77737 25%, #e1306c 55%, #c13584 75%, #833ab4 100%);
  --float-glow: rgba(193, 53, 132, 0.32);
}
.directions-float {
  --float-color: #c8322b; /* the red of the logo */
  --float-glow: rgba(200, 50, 43, 0.32);
}
.facebook-float {
  --float-color: #1b5fc2;
  --float-glow: rgba(27, 95, 194, 0.32);
}
/* The Contact us button: icon and name in one blue pill. A light rises and fades inside it, while a blue glow
   breathes and a ring ripples around it. All of it stops while the options are open, and for visitors who ask for
   less motion */
.float-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(150deg, #3a74bd 0%, var(--blue) 45%, var(--blue-dark) 100%);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 10px 28px rgba(31, 71, 118, 0.38),
    0 2px 6px rgba(20, 45, 80, 0.18);
  transition: transform 0.3s var(--ease-spring);
}
.float-toggle:hover {
  transform: translateY(-2px);
}
.float-toggle:active {
  transform: scale(0.96);
}
.float-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
}
.float-toggle[hidden] {
  display: none;
}
.float-toggle-icon,
.float-toggle-text {
  position: relative; /* above the light */
}
.float-toggle-icon {
  display: grid;
}
.float-toggle-icon svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  transition:
    opacity 0.2s ease,
    transform 0.35s var(--ease-spring);
}
/* A chat bubble while closed, a cross while open */
.float-toggle-icon svg:last-child,
.contact-float.is-open .float-toggle-icon svg:first-child {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}
.contact-float.is-open .float-toggle-icon svg:last-child {
  opacity: 1;
  transform: none;
}
/* Inside the pill: its whole blue background pulses brighter, and a light rises from the bottom and fades */
.float-toggle-light {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.float-toggle-light::before,
.float-toggle-light::after {
  content: '';
  position: absolute;
  inset: 0;
}
.float-toggle-light::before {
  background: linear-gradient(150deg, #5d9cf0 0%, #3b7fd6 55%, #2a5d9a 100%);
  animation: float-pulse 2s ease-in-out infinite;
}
.float-toggle-light::after {
  background: radial-gradient(70% 90% at 50% 100%, rgba(190, 222, 255, 0.85), transparent 70%);
  animation: float-light 2s ease-in-out infinite;
}
@keyframes float-pulse {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
@keyframes float-light {
  0% {
    opacity: 0;
    transform: translateY(60%);
  }
  50% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-60%);
  }
}
/* Around the pill: a breathing blue glow and a rippling ring, both behind it */
.float-toggle::before,
.float-toggle::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}
.float-toggle::before {
  inset: -10px;
  background: radial-gradient(closest-side, rgba(70, 145, 245, 0.85), rgba(42, 93, 154, 0.4) 60%, transparent);
  animation: float-glow 2s ease-in-out infinite;
}
.float-toggle::after {
  border: 2px solid rgba(110, 165, 235, 0.9);
  animation: float-ripple 2s var(--ease-exit) infinite;
}
@keyframes float-glow {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.12, 1.3);
  }
}
@keyframes float-ripple {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.15, 1.55);
  }
}
.contact-float.is-open .float-toggle::before,
.contact-float.is-open .float-toggle::after,
.contact-float.is-open .float-toggle-light::before,
.contact-float.is-open .float-toggle-light::after {
  animation: none;
  opacity: 0;
}

/* The options: a column above the toggle, each with its name beside it */
.float-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.float-label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    0 0 0 1px var(--line),
    0 6px 18px rgba(20, 45, 80, 0.16);
}
/* Once js/main.js has set it up, the options sit hidden until the toggle opens them */
.contact-float.is-collapsible .float-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
}
.contact-float.is-collapsible .float-menu .float-button {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.7);
  transition:
    opacity 0.2s ease,
    transform 0.35s var(--ease-spring),
    visibility 0s linear 0.35s;
}
.contact-float.is-open .float-menu .float-button {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.25s ease calc(var(--i) * 45ms),
    transform 0.45s var(--ease-spring) calc(var(--i) * 45ms),
    visibility 0s;
}
.contact-float.is-open .float-menu .float-button:hover {
  transform: translateY(-2px) scale(1.05);
}
.contact-float.is-open .float-menu .float-button:active {
  transform: scale(0.94);
}
.float-menu .float-button:nth-last-child(1) {
  --i: 0;
}
.float-menu .float-button:nth-last-child(2) {
  --i: 1;
}
.float-menu .float-button:nth-last-child(3) {
  --i: 2;
}
.float-menu .float-button:nth-last-child(4) {
  --i: 3;
}
.float-menu .float-button:nth-last-child(5) {
  --i: 4;
}
@media (max-width: 420px) {
  .contact-float {
    right: 14px;
    bottom: 14px;
  }
  .float-button {
    width: 52px;
    height: 52px;
  }
  .float-menu {
    gap: 10px;
  }
}
/* The car animation and the top of every inner page carry their own WhatsApp and Call buttons, so the Contact us
   button waits until those have scrolled past (js/main.js removes .is-tucked) */
.contact-float.is-tucked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px);
  transition:
    opacity 0.3s ease,
    transform 0.6s var(--ease-spring),
    visibility 0s linear 0.6s;
}

/* The Call and WhatsApp popups: a centred card on desktop, a sheet at the foot of the screen on phones */
.contact-popup {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--ink);
  box-shadow:
    0 0 0 1px var(--line),
    0 24px 64px rgba(20, 45, 80, 0.28);
}
.contact-popup::backdrop {
  background: rgba(11, 18, 28, 0.55);
  backdrop-filter: blur(4px);
}
.contact-popup[open] {
  animation: popup-in 0.35s var(--ease-spring);
}
@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}
.contact-popup-panel {
  padding: 20px 12px 12px;
}
.contact-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 0 16px;
}
.contact-popup-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.contact-popup-text {
  margin: 4px 16px 8px;
  color: var(--muted);
  font-size: 15px;
}
.contact-popup-close {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--mist);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}
.contact-popup-close:hover {
  transform: rotate(90deg);
}
.contact-popup-close:active {
  transform: scale(0.92);
}
.contact-popup-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.contact-popup-close svg {
  width: 18px;
  height: 18px;
}
@media (max-width: 560px) {
  .contact-popup {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .contact-popup-panel {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Visitors who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  :is(
    .btn,
    .card,
    .img-wrap img,
    .contact-float,
    .float-button,
    .float-toggle,
    .float-toggle-icon svg,
    .step-rail li,
    .contact-row,
    .mobile-nav
  ) {
    transition: none !important;
  }
  .scroll-cue i,
  .contact-popup[open],
  .float-toggle::before,
  .float-toggle::after,
  .float-toggle-light::before,
  .float-toggle-light::after {
    animation: none;
  }
}

/* The site in each language, beside the policy links */
.footer-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.footer-languages a {
  color: var(--footer-text);
}
.footer-languages a[aria-current] {
  color: #fff;
  font-weight: 700;
}
.footer-languages a:hover {
  color: #fff;
}
