/*
 * tech-storefront — site footer + flash toast (Balanced + Regular + Light only).
 *
 * Ported intent from the Claude Design prototype (.site-footer, .cols, .legal,
 * .flash-toast). No data-theme / data-dark / data-density qualifiers permitted.
 */

/* ------------------------------------------------------------------
 * Footer shell
 * ------------------------------------------------------------------ */

.site-footer {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  margin-top: 3rem;
}

.site-footer .wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1rem 1.25rem;
}

.site-footer .cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.site-footer h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

/* ------------------------------------------------------------------
 * Brand column (logo + tagline + WhatsApp CTA)
 * ------------------------------------------------------------------ */

.site-footer .col-brand .logo {
  display: inline-block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 0.85rem;
  text-decoration: none;
}
.site-footer .col-brand .logo:hover { text-decoration: none; }
.site-footer .col-brand .logo .dot { color: var(--brand); font-size: 1.05em; font-weight: 900; }

.site-footer .col-brand .soft {
  color: var(--ink-3);
  margin: 0 0 1rem;
  font-size: 0.875rem;
  max-width: 32ch;
}

.site-footer .btn.primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--brand);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.site-footer .btn.primary:hover { background: var(--accent); text-decoration: none; }
.site-footer .btn.primary.sm { padding: 0.45rem 0.85rem; font-size: 0.875rem; }
.site-footer .btn.primary svg.tech-icon { width: 16px; height: 16px; }

/* ------------------------------------------------------------------
 * Menu columns (WP nav menu output: <ul class="footer-menu">…)
 * ------------------------------------------------------------------ */

.site-footer .footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.site-footer .footer-menu li { line-height: 1.4; }

.site-footer .footer-menu a {
  color: var(--ink-2);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 160ms ease;
}
.site-footer .footer-menu a:hover { color: var(--brand); text-decoration: none; }

/* ------------------------------------------------------------------
 * Legal row
 * ------------------------------------------------------------------ */

.site-footer .legal {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--ink-3);
  font-size: 0.8125rem;
}

/* ------------------------------------------------------------------
 * Responsive: ≤720px collapses to single column
 * ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .site-footer .cols { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .site-footer .col-brand { grid-column: 1 / -1; }
}

/* T-129: compact mobile footer — single column with collapsible menu sections.
 * Replaces the 560px two-column collapse so the four blocks stack tightly
 * instead of stretching the page. footer-accordion.js toggles data-open=1. */
@media (max-width: 720px) {
  .site-footer { margin-top: 2rem; }
  .site-footer .wrap { padding: 1.5rem 1rem 1rem; }

  .site-footer .cols {
    display: flex;
    flex-direction: column;
    gap: 0;
    grid-template-columns: none;
  }

  .site-footer .col-brand {
    grid-column: auto;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
  }
  .site-footer .col-brand .logo { font-size: 19px; margin-bottom: 0.5rem; }
  .site-footer .col-brand .soft {
    font-size: 0.8125rem;
    line-height: 1.5;
    max-width: none;
    margin: 0 0 0.75rem;
  }
  .site-footer .col-brand .btn.primary.sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
  }

  /* Menu columns become accordions. h4 is the toggle; the menu list collapses. */
  .site-footer .cols > .col {
    border-bottom: 1px solid var(--line);
    padding: 0;
  }
  .site-footer .cols > .col h4 {
    margin: 0;
    padding: 0.75rem 0;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
  }
  .site-footer .cols > .col h4::after {
    content: "+";
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--ink-3);
    line-height: 1;
    transition: transform 0.15s ease;
  }
  .site-footer .cols > .col[data-open="1"] h4::after { content: "−"; }

  .site-footer .cols > .col .footer-menu {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    transition: max-height 0.2s ease;
  }
  .site-footer .cols > .col[data-open="1"] .footer-menu {
    max-height: 600px;
    padding: 0 0 0.75rem 0;
  }
  .site-footer .cols > .col .footer-menu li { padding: 2px 0; }
  .site-footer .cols > .col .footer-menu a { font-size: 0.875rem; }

  .site-footer .legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    font-size: 0.75rem;
  }
}

/* ------------------------------------------------------------------
 * Flash toast (global; positioned bottom-center, fades in/out)
 * ------------------------------------------------------------------ */

.flash-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 12px);
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  max-width: min(92vw, 480px);
  text-align: center;
}
.flash-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.flash-toast[data-tone="error"]   { background: #B3261E; }
.flash-toast[data-tone="warning"] { background: var(--accent-2); color: var(--ink); }
.flash-toast[data-tone="info"]    { background: var(--accent); }
