/* =========================================
   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 { padding-right: 16px; }
.footer-brand__logo { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer-brand__logo svg { width: 32px; height: 32px; }
.footer-brand__logo span { font-size: 24px; font-weight: 700; color: #fff; }
.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-payments { display: flex; gap: 8px; align-items: center; }
.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;
}

@media (max-width: 980px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1/-1; }
}
@media (max-width: 600px) {
  .chf-footer .site-footer__inner { padding: 48px 20px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-cta { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; align-items: flex-start; text-align: left; }
}
/* Footer logo: centered and responsive on every device — no fixed
   square size (which distorted non-square logos) and no longer
   hidden on tablet/mobile. */
.footer-brand__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px;
}

.footer-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
    margin: 0 auto;
}

@media screen and (max-width: 980px) {
    /* footer-brand spans the full row once the grid collapses to 2
       columns, so center the whole brand block (logo + tagline +
       social icons) rather than just the logo. */
    .footer-brand {
        text-align: center;
    }
    .footer-brand .footer-social {
        justify-content: center;
    }
    .footer-brand p {
        margin-left: auto;
        margin-right: auto;
    }
}

@media screen and (max-width: 480px) {
    .footer-logo {
        max-width: 140px;
        max-height: 70px;
    }
}
