/* ── Site Footer ────────────────────────────────────────────
   Figma node 5354-6889
   Layout: [logo flex-1] | [legal+social  nav+stores]
   ──────────────────────────────────────────────────────── */

.wp-block-yummo-site-footer {
  --c-primary:   var(--wp--preset--color--primary, #5c1a34);
  --c-cream:     var(--wp--preset--color--cream, #f6eddc);
  --c-cream-lt:  var(--wp--preset--color--cream-light, #fffbf3);
  --r-btn:       var(--wp--custom--radius--button, 0.75rem);
  --dur:         var(--wp--custom--transition--dur, .25s);
  --ease:        var(--wp--custom--transition--ease, cubic-bezier(.25,.46,.45,.94));

  background: var(--c-primary);
  /* Figma: p-[72px] = 4.5rem on all sides */
  padding: clamp(2rem, 5vw, 4.5rem);
  padding-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
  
  /* Maestro: Контекст контейнера для локальних запитів */
  container-type: inline-size;
  container-name: siteFooter;

  /* ── Main content row ───────────────────────────────────── */
  .footer-content {
    display: flex;
    flex-wrap: wrap; /* Maestro: Intrinsic sizing */
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    width: 100%;
  }

  /* ── Logo (left, flex-1) ────────────────────────────────── */
  .footer-logo {
    flex: 1 1 clamp(17.5rem, 30vw, 100%);
    display: block;

    img {
      /* Maestro: cqw для чуйності відносно контейнера */
      width: clamp(7rem, 20cqw, 17.75rem);
      height: auto;
      display: block;
    }
  }

  /* ── Right menu area (flex-1, two sub-columns) ──────────── */
  .footer-menu {
    flex: 2 1 clamp(20rem, 50vw, 100%);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: clamp(2rem, 5cqw, 3.5rem);
  }

  /* ── Sub-column 1: Legal links + Social buttons ─────────── */
  .footer-legal-social {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1 1 min(100%, 15rem);
    order: 1;
  }

  .footer-legal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* ── Sub-column 2: Main nav + App stores ────────────────── */
  .footer-main {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    align-items: flex-start;
    flex: 1 1 min(100%, 15rem);
    order: 2;
  }

  .footer-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* ── Nav links (shared base) ────────────────────────────── */
  .footer-nav__link {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 6.25rem;
    color: var(--c-cream);
    font-size: var(--body, 1.125rem);
    font-weight: 500;
    line-height: 1.375rem;
    white-space: nowrap;
    transition: background var(--dur) var(--ease);
    text-decoration: none;
    &:hover {
      background: rgb(255 255 255 / .1);
    }

    /* Bold nav links (Головна, Блог) */
    &--bold {
      font-size: var(--h4, 1.1875rem);
      font-weight: 700;
      line-height: 1.5rem;
    }
  }

  /* ── Social icon buttons ────────────────────────────────── */
  .footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .social-btn {
    width: 3rem;
    height: 3rem;
    border-radius: var(--r-btn);
    /* background: rgb(255 255 255 / .1);
    border: 1px solid rgb(255 255 255 / .25); */
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: background var(--dur) var(--ease);

    &:hover {
      background: rgb(255 255 255 / .2);
    }

    img {
      width: 1.5rem;
      height: 1.5rem;
    }
  }

  /* ── App store buttons ──────────────────────────────────── */
  .footer-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-left: 1rem;
  }

  /* ── App store / Google Play badge buttons ─────────────── */
  .btn-store {
    position: relative;
    display: block;
    flex: none;
    width: 9rem;
    height: 3rem;
    padding: 0;
    overflow: visible;
    border-radius: 0.75rem;
    background: var(--btn-bg) center / contain no-repeat;
  }

  .btn-store::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--btn-bg-hover) center / contain no-repeat;
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    pointer-events: none;
  }

  .btn-store:hover::before,
  .btn-store:focus-visible::before {
    opacity: 1;
  }

  /* Footer always uses reversed (cream) badges over primary bg */
  .btn-gplay {
    --btn-bg:       url('../../images/btn-google-play-sm-rev.svg');
    --btn-bg-hover: url('../../images/btn-google-play-sm-rev-hover.svg');
  }
  .btn-appstore {
    --btn-bg:       url('../../images/btn-app-store-sm-rev.svg');
    --btn-bg-hover: url('../../images/btn-app-store-sm-rev-hover.svg');
  }

  /* ── Copyright ──────────────────────────────────────────── */
  .footer-copy {
    font-size: var(--body-s);
    line-height: 1.25rem;
    color: var(--c-cream-lt);
    width: 100%;
  }

  /* ── Mobile (Figma 5387:11683) ──────────────────────────────
     Stack: logo → top-nav → stores → legal-nav → social → copy.
     Desktop nests stores under top-nav (.footer-main) and social
     under legal-nav (.footer-legal-social). On mobile we flatten
     those wrappers via `display: contents` and re-order the four
     remaining children with explicit `order` to match Figma. */
  @container siteFooter (max-width: 48rem) {
    .footer-content {
      flex-direction: column;
      align-items: center;
      gap: 1.25rem;             /* gap-[20] logo→menu */
      flex-wrap: nowrap;
    }

    .footer-logo img {
      width: 8.75rem;           /* 140px Figma */
    }

    .footer-menu {
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      gap: 1.5rem;              /* gap-[24] between menu sections */
      width: 100%;
      flex-wrap: nowrap;
    }

    .footer-main,
    .footer-legal-social {
      display: contents;
    }

    .footer-nav    { order: 1; }
    .footer-stores { order: 2; }
    .footer-legal  { order: 3; }
    .footer-social { order: 4; }

    .footer-nav,
    .footer-legal {
      align-items: stretch;
      width: 100%;
    }

    .footer-nav__link {
      width: 100%;
      text-align: center;
      white-space: normal;
    }

    /* Stores: two flex-1 buttons, native SVG (144×48) stays centered
       inside via `contain`; the cream button bg fills the rest. */
    .footer-stores {
      width: 100%;
      flex-wrap: nowrap;
      padding-inline: 1rem;     /* px-[16] from Figma actions */
      gap: 0.5rem;              /* gap-[8] */
    }

    .btn-store {
      flex: 1 1 0;
      width: auto;
      min-width: 0;
      background-color: var(--c-cream);
    }

    .btn-store::before {
      background-color: var(--c-cream);
    }

    .footer-social {
      width: 100%;
      justify-content: center;
      gap: 0.5rem;
    }

    .footer-copy {
      text-align: center;
    }
  }

  /* ── wp_nav_menu <ul> reset ───────────────────────────── */
  .footer-legal__list,
  .footer-main__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: contents; /* child <li> items participate in parent flex layout */

    li {
      display: contents;
    }
  }
}
/* ── Language offer ──────────────────────────────────────
   functions.php yummoapp_language_suggestion(), shown by view.js. Fixed, so it moves
   nothing on the page; under the header (1000) and the popups (9990+), and clear of the
   article's .arrow-up in the bottom-right corner. Outside <footer>, so it reads the
   global tokens from main.css, not the footer's scoped ones. */
.lang-suggest {
  position: fixed;
  z-index: 999;
  left: 1rem;
  right: 5.5rem;
  bottom: 1rem;
  max-width: 34rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--r-btn, 0.75rem);
  /* Mint, not the brand plum: the article hero and several sections are plum, and a plum
     bar vanished against them; mint reads on both the cream and the plum sections. */
  background: var(--c-mint, #b8f2ce);
  color: var(--c-primary, #5c1a34);
  font-family: var(--font, 'Mazzard Soft M', sans-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 0.18);
}

.lang-suggest[hidden] { display: none; }

.lang-suggest__text {
  flex: 1 1 12rem;
  margin: 0;
}

.lang-suggest__go {
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  background: var(--c-primary, #5c1a34);
  color: var(--c-cream-lt, #fffbf3);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.lang-suggest__go:hover,
.lang-suggest__go:focus-visible { background: var(--c-primary-hover, #a7436a); }

.lang-suggest__close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.lang-suggest__close:hover,
.lang-suggest__close:focus-visible { background: rgb(92 26 52 / 0.1); }

@media (min-width: 768px) {
  .lang-suggest { left: 2rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .lang-suggest:not([hidden]) { animation: lang-suggest-in 0.3s cubic-bezier(.25, .46, .45, .94); }
  @keyframes lang-suggest-in { from { opacity: 0; transform: translateY(0.5rem); } }
}

/* ── Cookie banner ───────────────────────────────────────
   functions.php yummoapp_consent_banner(); consent.js sets <html data-consent> in <head>, and the
   banner shows only while it says "pending" — no attribute (no JavaScript, so no Google tags
   either) keeps it hidden too. Same place, colours and layer as the language offer, which waits
   until the cookie choice is made: one notice at a time. Wider on phones, where the text is long. */
.consent { display: none; }

html[data-consent="pending"] .consent {
  position: fixed;
  z-index: 999;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 36rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem;
  border-radius: var(--r-btn, 0.75rem);
  background: var(--c-mint, #b8f2ce);
  color: var(--c-primary, #5c1a34);
  font-family: var(--font, 'Mazzard Soft M', sans-serif);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 0.18);
}

html[data-consent="pending"] .lang-suggest { display: none; }

.consent__text {
  flex: 1 1 16rem;
  margin: 0;
}

.consent__text a { color: inherit; text-decoration: underline; }

.consent__actions {
  display: flex;
  gap: 0.5rem;
}

.consent__btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--c-primary, #5c1a34);
  border-radius: 0.5rem;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.consent__btn--accept { background: var(--c-primary, #5c1a34); color: var(--c-cream-lt, #fffbf3); }
.consent__btn--decline { background: transparent; color: var(--c-primary, #5c1a34); }

.consent__btn--accept:hover,
.consent__btn--accept:focus-visible { background: var(--c-primary-hover, #a7436a); border-color: var(--c-primary-hover, #a7436a); }
.consent__btn--decline:hover,
.consent__btn--decline:focus-visible { background: rgb(92 26 52 / 0.1); }

.footer-copy__cookie {
  margin-inline-start: 0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

html:not([data-consent]) .footer-copy__cookie { display: none; }

@media (min-width: 768px) {
  html[data-consent="pending"] .consent { left: 2rem; right: 5.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html[data-consent="pending"] .consent { animation: lang-suggest-in 0.3s cubic-bezier(.25, .46, .45, .94); }
}
