/* ==========================================================
   Footer: grass edge + main + bottom bar
   ========================================================== */

/* .page-wrapper prefix: custommobile.css / styles-l.css load after this file */
.page-wrapper .page-footer {
  margin-top: 0;
  padding: 0;
  background: #fbf9f4;
}

.ml-footer {
  font-family: 'DM Sans', 'Lato', sans-serif;
  color: #fff4d8;
}

.ml-footer a,
.ml-footer a:visited {
  color: #fff4d8;
  text-decoration: none;
}

.ml-footer a:hover,
.ml-footer a:focus {
  color: #fff;
  text-decoration: none;
}

/* ---------- Grass edge ---------- */
/* The PNG is drawn by tile-aligned slices (footer.phtml), each skewed from its bottom edge:
   the base stays put, only the tips bend. Two motions are layered:
   - the slice (span) follows slow gusts of changing strength; neighbouring slices run a
     little later, so each gust travels left to right across the strip;
   - its image (::before) flutters back and forth on top, every slice at its own speed,
     strength and phase (--fa / --fd / --fdl), so blades never move in lockstep.
   Slices overlap by 16px so no seam opens while neighbours lean differently.
   Hover: the slice under the pointer (and, a little less, its neighbours) rustles harder.
   --boost scales the flutter; it is a registered property so the change eases in and out
   instead of jumping. */
@property --boost {
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}

.ml-footer-grass {
  --grass-tile: 1144px;
  --grass-h: 101px;
  --grass-slice: calc(var(--grass-tile) / 8);
  position: relative;
  height: 100px;
  margin-bottom: -1px;
  overflow: hidden;
}

.ml-footer-grass span {
  --boost: 1;
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--i) * var(--grass-slice));
  width: calc(var(--grass-slice) + 16px);
  transform-origin: 50% 100%;
  animation: ml-grass-gust 7s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.35s);
  will-change: transform;
  transition: --boost 0.5s ease-out;
}

@media (hover: hover) {
  .ml-footer-grass span:hover {
    --boost: 3;
    transition-duration: .5s;
  }

  .ml-footer-grass span:hover + span,
  .ml-footer-grass span:has(+ span:hover) {
    --boost: 2;
    transition-duration: .5s;
  }
}

.ml-footer-grass span::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/footer-grass.png') repeat-x;
  background-size: var(--grass-tile) var(--grass-h);
  background-position: calc(var(--i) * var(--grass-slice) * -1) bottom;
  transform-origin: 50% 100%;
  animation: ml-grass-flutter var(--fd) ease-in-out var(--fdl) infinite alternate;
  will-change: transform;
}

/* Negative skew = tips lean right. A light push, a strong gust, a slight back-swing,
   a medium gust, then calm - so the wind never feels like a metronome. */
@keyframes ml-grass-gust {
  0%,
  100% {
    transform: skewX(0deg);
  }
  12% {
    transform: skewX(calc(var(--amp) * -0.55deg));
  }
  22% {
    transform: skewX(calc(var(--amp) * -0.2deg));
  }
  38% {
    transform: skewX(calc(var(--amp) * -1deg));
  }
  50% {
    transform: skewX(calc(var(--amp) * -0.35deg));
  }
  58% {
    transform: skewX(calc(var(--amp) * 0.12deg));
  }
  70% {
    transform: skewX(calc(var(--amp) * -0.7deg));
  }
  84% {
    transform: skewX(calc(var(--amp) * -0.25deg));
  }
  92% {
    transform: skewX(calc(var(--amp) * 0.05deg));
  }
}

/* Small side-to-side flutter, both directions, like leaves in a soft breeze */
@keyframes ml-grass-flutter {
  from {
    transform: skewX(calc(var(--fa) * var(--boost) * 1deg));
  }
  to {
    transform: skewX(calc(var(--fa) * var(--boost) * -1deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ml-footer-grass span,
  .ml-footer-grass span::before {
    animation: none;
    transition: none;
  }
}

/* ---------- Main ---------- */
.ml-footer-main {
  background: #1f7a68;
}

.ml-footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 52px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 20px 30px;
  box-sizing: border-box;
}

.ml-footer-logo {
  flex: 0 0 auto;
  width: 122px;
  margin-right: 20px;
}

.ml-footer-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.ml-footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ml-footer-links li {
  margin: 0 0 12px;
}

.ml-footer-links a,
.ml-footer-address,
.ml-footer-contact a,
.ml-footer-email {
  font-size: 12px;
  line-height: 1.5;
}

.ml-footer-address {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-style: normal;
}

.ml-footer-address strong {
  font-weight: 600;
}

.ml-footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ml-footer-contact a,
.ml-footer-email {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ml-footer-email {
  cursor: pointer;
}

.ml-footer-email:hover {
  color: #fff;
}

.ml-footer-address svg,
.ml-footer-contact svg {
  display: block;
  margin-bottom: 2px;
}

/* Location pin: a ring keeps spreading on the ground under it */
.ml-footer-pin {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  margin-bottom: 2px;
}

.ml-footer-address .ml-footer-pin svg {
  position: relative;
  z-index: 1;
  margin: 0;
}

.ml-footer-pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 12px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  translate: -50% 0;
  opacity: 0;
  animation: ml-pin-ring 2.4s ease-out infinite;
}

@keyframes ml-pin-ring {
  0%, 48% { opacity: 0; scale: .3; }
  50%     { opacity: .9; scale: .3; }
  85%     { opacity: 0; scale: 1.8; }
  100%    { opacity: 0; scale: 1.8; }
}

@media (prefers-reduced-motion: reduce) {
  .ml-footer-pin::after {
    animation: none;
  }
}

.ml-footer-heading {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
}

.ml-footer-social ul {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ml-footer-social li {
  margin: 0;
}

.ml-footer .ml-footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #1f7a68;
  background: #fff4d8;
  border-radius: 50%;
  text-decoration: none;
  transition: background .2s;
}

.ml-footer .ml-footer-social a:hover,
.ml-footer .ml-footer-social a:focus {
  color: #1f7a68;
  background: #fff;
}

/* ---------- Bottom bar ---------- */
.ml-footer-bottom {
  padding: 12px 20px 10px;
  text-align: center;
  background: #261a00;
}

.ml-footer-bottom p {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.ml-footer-legal {
  display: flex;
  justify-content: center;
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.ml-footer-legal li {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.ml-footer-legal li + li:before {
  content: '|';
  margin: 0 8px;
}

.ml-footer-bottom .ml-footer-made {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 7px;
}

.ml-footer-made svg {
  transform-origin: center;
  animation: plus-heart 1s infinite;
  -webkit-animation: plus-heart 1s infinite;
}

@keyframes plus-heart {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

@-webkit-keyframes plus-heart {
  0% {
    -webkit-transform: scale(1);
  }
  50% {
    -webkit-transform: scale(1.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ml-footer-made svg {
    animation: none;
  }
}

/* ---------- Tablet ---------- */
@media screen and (max-width: 1023px) {
  .ml-footer-inner {
    flex-wrap: wrap;
    gap: 30px 40px;
  }

  .ml-footer-logo {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
    margin: 0;
  }

  .ml-footer-logo img {
    width: 122px;
  }
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 767px) {
  .ml-footer-grass {
    --grass-tile: 686px;
    --grass-h: 61px;
    height: 61px;
  }

  .ml-footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 16px;
    padding: 18px 20px 26px;
    text-align: center;
  }

  /* Logo: centred on its own row (the box is only 122px wide, so centre the box itself) */
  .ml-footer-logo {
    grid-column: 1 / -1;
    justify-self: center;
    width: 104px;
  }

  .ml-footer-logo img {
    width: 104px;
  }

  .ml-footer-links li {
    margin-bottom: 10px;
  }

  /* Address and contact: full width, centred, separated by a thin line */
  .ml-footer-address,
  .ml-footer-contact {
    grid-column: 1 / -1;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 244, 216, .2);
  }

  .ml-footer-contact {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 28px;
  }

  .ml-footer-contact a,
  .ml-footer-email {
    align-items: center;
  }

  .ml-footer-social {
    grid-column: 1 / -1;
    padding-top: 18px;
    text-align: center;
    border-top: 1px solid rgba(255, 244, 216, .2);
  }

  .ml-footer-social ul {
    justify-content: center;
  }

  .ml-footer-bottom {
    padding: 12px 16px 10px;
  }
}
