/* =========================================
   Custom Header Footer — shared design system
   Colors are also overridden inline per-site
   from Settings > Header/Footer (see PHP below)
========================================== */
:root {
  --chf-green: #0f3d2e;
  --chf-accent: #4caf7d;
  --chf-yellow: #f2b400;
  --chf-text-muted: #6b7280;
  --chf-border: #eef0ee;
  --chf-radius: 8px;
  --chf-max-width: 1280px;
  --chf-font: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}

.chf-header, .chf-header *,
.chf-footer, .chf-footer * {
  box-sizing: border-box;
}

.chf-header, .chf-footer {
  font-family: var(--chf-font);
}

.chf-header a, .chf-footer a { text-decoration: none; }

/* ---------- HEADER ---------- */
.chf-header { background: #fff; border-bottom: 1px solid var(--chf-border); color: #1c1c1c; }

.header-topbar { background: var(--chf-green); color: #e8ece9; font-size: 13px; }
.header-topbar__inner {
  max-width: var(--chf-max-width); margin: 0 auto; padding: 8px 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.header-topbar__links { display: flex; gap: 20px; }
.header-topbar a { color: inherit; }
.header-topbar a:hover { color: var(--chf-yellow); }

.header-main {
  max-width: var(--chf-max-width); margin: 0 auto; padding: 18px 24px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
}

.header-logo { display: flex; align-items: center; gap: 8px; color: var(--chf-green); }
.header-logo svg { width: 34px; height: 34px; }
.header-logo span { font-size: 24px; font-weight: 700; }

.header-search { max-width: 640px; width: 100%; justify-self: center; }
.header-search form { display: flex; width: 100%; position: relative; }
.header-search input[type="search"],
.header-search input[type="text"] {
  width: 100%; background: #f5f6f5; border: 1px solid var(--chf-border);
  border-radius: var(--chf-radius); padding: 12px 16px; font-size: 14px; outline: none;
  transition: border-color .2s ease;
}
.header-search input:focus { border-color: var(--chf-accent); }
.header-search button[type="submit"] {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--chf-accent); color: #fff; border: none; border-radius: 6px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
}

.header-actions { display: flex; align-items: center; gap: 22px; }
.header-icon-link {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 11px; color: var(--chf-text-muted);
}
.header-icon-link svg { width: 22px; height: 22px; color: #1c1c1c; transition: color .2s ease; }
.header-icon-link:hover svg,
.header-icon-link:hover { color: var(--chf-accent); }

.cart-count {
  position: absolute; top: -6px; right: -10px; background: var(--chf-accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 50%;
  min-width: 16px; text-align: center;
}

.header-burger { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.header-burger svg { width: 26px; height: 26px; color: #1c1c1c; }

.header-nav { background: #fff; border-top: 1px solid var(--chf-border); }
.header-nav__inner { max-width: var(--chf-max-width); margin: 0 auto; padding: 0 24px; }
.header-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 36px; flex-wrap: wrap; }
.header-nav li { position: relative; }
.header-nav__inner > ul > li > a {
  display: inline-block; padding: 14px 0; font-size: 14px; font-weight: 600;
  letter-spacing: .02em; color: #1c1c1c; border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.header-nav li a:hover { color: var(--chf-green); border-bottom-color: var(--chf-accent); }
.header-nav li.current-menu-item > a { color: var(--chf-green); border-bottom-color: var(--chf-accent); }

.header-nav .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; background: #fff;
  border: 1px solid var(--chf-border); border-radius: 0 0 var(--chf-radius) var(--chf-radius);
  box-shadow: 0 12px 24px rgba(0,0,0,.08); min-width: 200px; padding: 10px 0; z-index: 20;
}
.header-nav li:hover > .sub-menu { display: block; }
.header-nav .sub-menu li a { padding: 10px 18px; font-weight: 400; font-size: 13px; display: block; border-bottom: none; }
.header-nav .sub-menu li a:hover { background: #f5f6f5; color: var(--chf-green); }

@media (max-width: 900px) {
  .header-main { grid-template-columns: auto auto 1fr; }
  .header-search { order: 3; grid-column: 1/-1; max-width: none; }
  .header-nav ul { display: none; }
  .header-nav.chf-nav-open ul { display: flex; flex-direction: column; gap: 0; }
  .header-nav.chf-nav-open li a { padding: 12px 0; }
  .header-burger { display: inline-flex; }
}
@media (max-width: 480px) {
  .header-topbar__links { display: none; }
  .header-main { padding: 14px 16px; gap: 14px; }
  .header-actions { gap: 14px; }
}

/* =========================================
   FOOTER
========================================== */
.chf-footer { background: var(--chf-green); color: #d7e0da; }
.chf-footer .site-footer__inner { max-width: var(--chf-max-width); margin: 0 auto; padding: 64px 24px 0; }

.footer-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px; padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-cta h3 { margin: 0 0 4px; font-size: 20px; color: #fff; }
.footer-cta p { margin: 0; font-size: 14px; opacity: .85; }

.footer-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.footer-form input[type="email"] {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff;
  padding: 12px 16px; border-radius: var(--chf-radius); font-size: 14px; min-width: 240px; outline: none;
}
.footer-form input::placeholder { color: #d7e0da; opacity: .6; }
.footer-form button {
  background: var(--chf-accent); color: #fff; border: none; padding: 12px 22px;
  border-radius: var(--chf-radius); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: filter .2s ease;
}
.footer-form button:hover { filter: brightness(1.1); }
.footer-form button[disabled] { opacity: .6; cursor: not-allowed; }
.chf-newsletter-msg { font-size: 13px; }
.chf-newsletter-msg.success { color: #8ee6b3; }
.chf-newsletter-msg.error { color: #ff9d9d; }

.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; padding-bottom: 48px; }

/* ===== FOOTER BRAND COLUMN =====
 * FIX: Merged two conflicting .footer-brand__logo rule blocks that
 * existed in this file (one at original line 147, one appended later
 * at line 194). The second block was overriding justify-content and
 * margin, causing visual inconsistency. Now there is exactly one
 * definitive rule per selector.
 */
.footer-brand { padding-right: 16px; }

.footer-brand__logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px;
}

/* The footer logo image itself.
   The Everwow logo is a wide landscape shape (roughly 3:1), so we allow
   a generous max-width and cap height to keep it in proportion. */
.footer-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
  margin: 0 auto;
}

.footer-brand p { font-size: 14px; opacity: .85; max-width: 280px; margin: 0 0 20px; }

.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .2s ease;
}
.footer-social a:hover { background: var(--chf-accent); transform: translateY(-2px); }
.footer-social svg { width: 16px; height: 16px; fill: #fff; }

.footer-col h4 {
  color: var(--chf-yellow); font-size: 15px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin: 0 0 18px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a {
  font-size: 14px; color: #d7e0da;
  transition: color .2s ease, padding-left .2s ease;
  display: inline-block;
}
.footer-col ul li a:hover { color: #fff; padding-left: 3px; }
.footer-col ul li a.badge { display: inline-flex; align-items: center; gap: 6px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 13px; color: #d7e0da; opacity: .75;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-legal a { color: inherit; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }
.footer-copy { font-size: 13px; }

.footer-payments { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Legacy text badge (kept for backwards compat, hidden when SVG icons are present) */
.footer-payments span {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 4px;
  padding: 4px 8px; font-size: 11px; font-weight: 600; color: #fff;
}
/* SVG payment icons */
.footer-pay-icon {
  width: 44px;
  height: 28px;
  border-radius: 4px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

/* Made with Love */
.footer-made-with {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  opacity: .65;
  white-space: nowrap;
}
.footer-heart {
  width: 14px;
  height: 14px;
  color: #e05a5a;
  flex-shrink: 0;
  animation: chf-heartbeat 1.6s ease-in-out infinite;
}
@keyframes chf-heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.2); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.15); }
  56%       { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .footer-heart { animation: none; }
}

/* =============================================================
   RESPONSIVE FOOTER
   Desktop (> 980px) is completely unchanged above this line.
   All rules below are scoped to tablet / mobile only.
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   TABLET  ≤ 980 px
   • Grid collapses: brand spans full width, links go 2 × 2
   • Newsletter CTA centres
   • Footer-bottom stacks & centres
   ───────────────────────────────────────────────────────────── */
@media (max-width: 980px) {

  /* Newsletter: stack text above form, centre both */
  .footer-cta {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-form { justify-content: center; }

  /* Grid: brand full-width on first row, link cols 2 × 2 */
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }

  .footer-brand {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-right: 0;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    margin-bottom: 4px;
  }
  .footer-brand p       { margin-left: auto; margin-right: auto; }
  .footer-brand .footer-social { justify-content: center; }

  /* Logo – generous on tablet so the wide badge reads well */
  .footer-logo { max-width: 210px; max-height: 78px; }

  /* Link columns keep left-align (mirrors desktop feel) */
  .footer-col { text-align: left; }

  /* Bottom bar ------------------------------------------------ */
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 0 32px;
    gap: 16px;
  }
  .footer-copy  { width: 100%; text-align: center; }
  .footer-legal {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px;
  }
  .footer-payments {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }
  /* Slightly larger payment icons on tablet */
  .footer-pay-icon { width: 52px; height: 33px; }

  .footer-made-with {
    justify-content: center;
    width: 100%;
    margin-top: 2px;
    font-size: 13px;
    opacity: .70;
  }
  .footer-heart { width: 15px; height: 15px; }
}

/* ─────────────────────────────────────────────────────────────
   MOBILE  ≤ 600 px
   • Inner padding tightened
   • Newsletter form stacks to full-width column
   • Grid stays 2-col; brand panel centred
   • Bottom bar further refined
   ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .chf-footer .site-footer__inner { padding: 40px 20px 0; }

  /* Newsletter form: full-width column on small screens */
  .footer-cta { padding-bottom: 36px; margin-bottom: 36px; }
  .footer-form { flex-direction: column; width: 100%; gap: 10px; }
  .footer-form input[type="email"] { min-width: 0; width: 100%; }
  .footer-form button              { width: 100%; }

  /* Grid */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 18px; }
  .footer-brand { padding-bottom: 24px; }

  /* Logo */
  .footer-logo { max-width: 180px; max-height: 68px; }

  /* Link columns */
  .footer-col h4        { font-size: 13px; margin-bottom: 14px; }
  .footer-col ul li     { margin-bottom: 10px; }
  .footer-col ul li a   { font-size: 13px; }

  /* Bottom bar */
  .footer-bottom { padding: 20px 0 28px; gap: 14px; }
  .footer-payments { gap: 8px; }
  .footer-pay-icon { width: 46px; height: 30px; }
  .footer-made-with { font-size: 12px; }
  .footer-heart { width: 14px; height: 14px; }
}

/* ─────────────────────────────────────────────────────────────
   SMALL MOBILE  ≤ 480 px
   ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .chf-footer .site-footer__inner { padding: 36px 16px 0; }
  .footer-logo  { max-width: 160px; max-height: 60px; }
  .footer-grid  { gap: 20px 14px; }
  .footer-col h4      { font-size: 12px; }
  .footer-col ul li a { font-size: 12px; }
  .footer-pay-icon    { width: 42px; height: 27px; }
}
