/*
 * Site footer.
 *
 * Content AND design are editable in wp-admin (Appearance → Footer, plus the
 * "footer" menu location for the link column). The custom properties declared
 * below are only fallbacks — footer.php re-declares them on the <footer> element
 * from the saved settings, so this file owns layout and nothing else.
 *
 * Note: no hover state anywhere in the footer. The link column is meant to stay
 * static, and applying that consistently keeps the whole block calm.
 */

.bp-footer {
  --bp-footer-bg:        var(--oxa-footer-bg);      /* #fafafa */
  --bp-footer-fg:        var(--oxa-muted);          /* #6b7280 — everything except the link column */
  --bp-footer-link:      var(--oxa-link);           /* #000000 — the link column reads as black */
  --bp-footer-border:    var(--oxa-footer-border);  /* #f5f5f5 — the rule above the bottom bar */
  --bp-footer-size:      16px;
  --bp-footer-weight:    400;
  --bp-footer-line:      26px;
  --bp-footer-pad:       64px;   /* drives the footer's overall height */
  --bp-footer-gap:       32px;
  --bp-footer-logo-h:    68px;
  --bp-footer-item-gap:  12px;
  --bp-footer-loc-col:   240px;  /* width of each location column */
  --bp-footer-loc-gap:   24px;
  --bp-footer-social-size: 28px;
  --bp-footer-social-hover: #000000;
  --bp-footer-badge-h:   44px;
  --bp-footer-bottom-bg: #ffffff;
  --bp-footer-bottom-fg: #43454b;
  --bp-footer-bottom-size: 14px;
  --bp-footer-bottom-pad:  16px;
  --bp-footer-bottom-pad-x: 16px;  /* gap from the screen edge to the credit */
  --bp-footer-credit-fg: #131315;

  font-family: var(--oxa-font-sans);
}

/* ---------- Main block ---------- */
.bp-footer__main {
  background: var(--bp-footer-bg);
  color: var(--bp-footer-fg);
  font-size: var(--bp-footer-size);
  font-weight: var(--bp-footer-weight);
  line-height: var(--bp-footer-line);
  padding-block: var(--bp-footer-pad);
}

.bp-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--bp-footer-gap);
  align-items: start;
}

/* ---------- Brand column ---------- */
.bp-footer__logo { display: inline-block; text-decoration: none; }
/* .bp-footer__logo in front: WooCommerce's `.woocommerce-page img { height: auto }`
 * otherwise wins on shop/cart/checkout/account pages and the logo shows at its
 * file's full size. */
.bp-footer__logo .bp-footer__logo-img {
  height: var(--bp-footer-logo-h); width: auto; object-fit: contain; display: block;
}

.bp-footer__contact {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bp-footer-item-gap);
}
.bp-footer__contact li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.bp-footer__contact a {
  color: var(--bp-footer-fg);
  text-decoration: none;
}

.bp-footer__icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--bp-footer-fg);
}

.bp-social {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
/* The one hover state in the footer: the icons deepen. Asked for explicitly,
 * unlike the link column which stays static. */
.bp-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bp-footer-fg);
  text-decoration: none;
  transition: color 0.15s ease;
}
.bp-social__link:hover,
.bp-social__link:focus-visible {
  color: var(--bp-footer-social-hover);
}
.bp-social__link svg {
  width: var(--bp-footer-social-size);
  height: var(--bp-footer-social-size);
  display: block;
}

/* ---------- Locations ----------
 * Plain text, not links — these are shop addresses. Two columns filled
 * top-to-bottom, which is what `columns` does and CSS grid does not. */
/* Two real lists side by side, filled from the split point set in wp-admin.
 * CSS `columns` was wrong here: it balances by height, so a wrapping name
 * silently pushed the next entry into the other group. */
.bp-footer__locations {
  display: flex;
  gap: var(--bp-footer-loc-gap);
  max-width: 100%;
  /* Two fixed-width columns don't fit the narrower footer cell between the
   * tablet breakpoints; wrapping keeps the column width (and therefore where
   * long names break) without pushing the page sideways. */
  flex-wrap: wrap;
}
.bp-footer__location-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bp-footer-item-gap);
  /* Fixed width so long names wrap at a predictable point, but never wider
   * than the space available. */
  width: var(--bp-footer-loc-col);
  max-width: 100%;
  flex-shrink: 0;
}
.bp-footer__location-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.bp-footer__location-list .bp-footer__icon { margin-top: 0.15rem; }

/* ---------- Link column + app badges ---------- */
.bp-footer__end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2.5rem;
}

.bp-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.875rem;
  text-align: right;
}
.bp-footer__links a {
  color: var(--bp-footer-link);
  text-decoration: none;
}

.bp-footer__apps {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.bp-footer__app { display: inline-flex; text-decoration: none; }
.bp-footer__app img {
  height: var(--bp-footer-badge-h);
  width: auto;
  display: block;
}
/* Shown until the official store badge images are set in Appearance → Footer. */
.bp-footer__app-fallback {
  display: inline-flex;
  align-items: center;
  height: var(--bp-footer-badge-h);
  padding-inline: 1.25rem;
  border-radius: var(--oxa-radius);  /* 0 — was 8px */
  background: var(--oxa-accent);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Bottom bar ---------- */
.bp-footer__bottom {
  background: var(--bp-footer-bottom-bg);
  color: var(--bp-footer-bottom-fg);
  font-size: var(--bp-footer-bottom-size);
  border-top: 1px solid var(--bp-footer-border);  /* #f5f5f5 — was a stray #f0f0f0 */
  padding-block: var(--bp-footer-bottom-pad);
}
.bp-footer__bottom-inner {
  /* Full-bleed, not inside .bp-container: the credit has to reach the screen
   * edge. 1fr auto 1fr keeps the copyright centred on the viewport whatever the
   * credit's width, which a flex space-between could not do. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-inline: var(--bp-footer-bottom-pad-x);
}
/* Centre the copyright against the page, not against its neighbours. */
.bp-footer__legal {
  grid-column: 2;
  font-size: inherit;
  text-align: center;
}
.bp-footer__powered {
  grid-column: 3;
  font-size: inherit;
  text-align: right;
}
.bp-footer__powered a,
.bp-footer__powered strong {
  color: var(--bp-footer-credit-fg);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .bp-footer__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .bp-footer__end { grid-column: span 2; align-items: flex-start; }
  .bp-footer__links { align-items: flex-start; text-align: left; }
  .bp-footer__apps { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .bp-footer__grid { grid-template-columns: minmax(0, 1fr); }
  .bp-footer__end { grid-column: auto; }
  .bp-footer__locations { flex-direction: column; }
  .bp-footer__location-list { width: 100%; }
  .bp-footer__bottom-inner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 0.5rem;
  }
  .bp-footer__legal,
  .bp-footer__powered { grid-column: auto; text-align: center; }
}

/* Carnival AL: titles above the two store groups, as eflow's footer had them. */
.bp-footer__location-heading {
  margin-bottom: 1.5rem;
}
