/**
 * Berlin site chrome — header + footer (TASK-0092).
 * Prefixed selectors avoid collision with legacy .header / .footer in main.css.
 */
body.pk-berlin-chrome {
  /* 44px bar control (hamburger) + 14px vertical breathing room each side */
  --pk-chrome-header-height: 72px;
}

body.pk-berlin-chrome,
body.pk-berlin-chrome *,
body.pk-berlin-chrome *::before,
body.pk-berlin-chrome *::after {
  box-sizing: border-box;
}

body.pk-berlin-chrome .wrap {
  max-width: var(--pk-abs-container, 1280px);
  margin: 0 auto;
  padding: 0 32px;
}

/* Skip link */
.pk-site-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.pk-site-skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  background: var(--pk-abs-black, #202a37);
  color: #fff;
  z-index: 10000;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

/* Header */
body.pk-berlin-chrome > .pk-site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--pk-abs-border, #e5e5e5);
}

body.search-mailer-form-in-header.pk-berlin-chrome > .pk-site-header {
  background: #fff;
}

.pk-site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--pk-chrome-header-height, 72px);
  min-height: var(--pk-chrome-header-height, 72px);
  max-height: var(--pk-chrome-header-height, 72px);
  padding-top: 0;
  padding-bottom: 0;
}

.pk-site-header__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.pk-site-header__logo img {
  display: block;
  height: 28px;
  width: auto;
}
.pk-site-header__logo:hover {
  opacity: 0.85;
  transition: opacity 0.18s;
}

.pk-site-header__bar-actions {
  display: none;
  align-items: center;
  flex-shrink: 0;
}

.pk-site-header__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--pk-abs-green, #17a24c);
  border-radius: 8px;
}

.pk-site-header__menu-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 162, 76, 0.15);
}

.pk-site-header__menu-toggle-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.pk-site-header__menu-toggle-icon span {
  position: relative;
  display: block;
  width: 24px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--pk-abs-green, #17a24c);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.pk-site-header__menu-toggle-icon span::before,
.pk-site-header__menu-toggle-icon span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 24px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--pk-abs-green, #17a24c);
  transition: transform 0.2s ease;
}

.pk-site-header__menu-toggle-icon span::before {
  top: -7px;
}

.pk-site-header__menu-toggle-icon span::after {
  top: 7px;
}

.pk-site-header__menu-toggle[aria-expanded="true"] .pk-site-header__menu-toggle-icon span {
  transform: rotate(45deg);
}

.pk-site-header__menu-toggle[aria-expanded="true"] .pk-site-header__menu-toggle-icon span::before {
  transform: rotate(90deg) translateX(-7px);
  top: 0;
}

.pk-site-header__menu-toggle[aria-expanded="true"] .pk-site-header__menu-toggle-icon span::after {
  opacity: 0;
}

.pk-site-header__scrim {
  display: none;
}

.pk-site-header__drawer-auth {
  display: none;
}

.pk-site-header__panel {
  display: flex;
  align-items: center;
  gap: 36px;
  flex: 1;
  justify-content: flex-end;
}

.pk-site-header__nav-list,
.pk-site-header__panel .pk-site-header__nav-list {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pk-site-header__nav-list li,
.pk-site-header__panel .pk-site-header__nav-list li {
  margin: 0;
  padding: 0;
}

.pk-site-header__nav-list a,
.pk-site-header__panel .pk-site-header__nav-list a {
  font-size: 14px;
  font-weight: 600;
  color: var(--pk-abs-text-soft, #525252) !important;
  transition: color 0.18s;
  text-decoration: none;
  padding: 0 !important;
  margin: 0 !important;
}

.pk-site-header__nav-list a:hover,
.pk-site-header__panel .pk-site-header__nav-list a:hover {
  color: var(--pk-abs-text, #202a37) !important;
}

.pk-site-header__account {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.pk-site-header__signin {
  font-size: 14px;
  font-weight: 600;
  color: var(--pk-abs-text-soft, #525252);
  text-decoration: none;
}
.pk-site-header__signin:hover {
  color: var(--pk-abs-text, #202a37);
}

/* Compact header Sign up — 38px tall, site .btn radius; never stretch to bar height */
body.pk-berlin-chrome a.pk-site-header__signup.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 16px !important;
  font-size: 14px;
  line-height: 1 !important;
  border-radius: var(--pk-abs-r, 12px) !important;
  align-self: center;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.pk-site-header__phone.general-button.call {
  font-size: 14px;
}

.pk-site-header__greeting {
  font-size: 14px;
  font-weight: 600;
  color: var(--pk-abs-text-soft, #525252);
  margin-bottom: 8px;
}

.pk-site-header__mailer-search {
  padding: 0 32px 16px;
  max-width: var(--pk-abs-container, 1280px);
  margin: 0 auto;
}

body.pk-berlin-chrome.search-mailer-form-in-header {
  --pk-chrome-header-height: 120px;
}

/* Desktop header bar (761px+): unchanged Berlin horizontal layout */
@media (min-width: 761px) {
  .pk-site-header__bar-actions {
    display: none;
  }

  .pk-site-header__menu-toggle {
    display: none;
  }

  .pk-site-header__scrim {
    display: none !important;
  }

  .pk-site-header__panel {
    display: flex;
    flex: 1;
    flex-direction: row;
    align-items: center;
    align-self: stretch;
    justify-content: flex-end;
    order: initial;
    width: auto;
    height: auto;
    min-height: 0;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
  }

  .pk-site-header__signup--bar {
    display: none !important;
  }

  .pk-site-header__drawer-auth {
    display: none !important;
  }

  .pk-site-header__account--desktop {
    display: flex;
    align-items: center;
    align-self: center;
  }
}

/*
 * Mobile drawer v2 — Berlin md breakpoint (760px; matches FAQ/cornerstone canon).
 * Collapsed bar: logo | compact Sign up | green hamburger. Drawer: edge-to-edge rows + auth.
 */
@media (max-width: 760px) {
  body.pk-berlin-chrome > .pk-site-header {
    position: sticky;
  }

  body.pk-berlin-chrome .wrap,
  .pk-site-header__mailer-search {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pk-site-header__inner {
    flex-wrap: nowrap;
    gap: 8px;
    position: relative;
    z-index: 2;
  }

  .pk-site-header__logo img {
    height: 24px;
  }

  .pk-site-header__bar-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
  }

  body.logged-in .pk-site-header__menu-toggle {
    margin-left: auto;
  }

  .pk-site-header__signup--bar {
    display: inline-flex;
    flex-shrink: 0;
  }

  .pk-site-header__signup--bar.btn-primary:hover {
    transform: none;
    box-shadow: none;
  }

  .pk-site-header__menu-toggle {
    display: inline-flex;
    color: var(--pk-abs-green, #17a24c) !important;
    flex-shrink: 0;
  }

  .pk-site-header__signup--inline,
  .pk-site-header__account--desktop {
    display: none !important;
  }

  .pk-site-header__scrim {
    position: fixed;
    top: var(--pk-chrome-header-height, 72px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 199;
    background: rgba(32, 42, 55, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .pk-site-header__scrim:not([hidden]) {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  .pk-site-header__panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: calc(100% + 32px);
    max-width: none;
    margin-left: -16px;
    margin-right: -16px;
    flex: initial;
    justify-content: initial;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: var(--pk-abs-white, #fff);
    border-bottom: 1px solid var(--pk-abs-border, #e5e5e5);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    z-index: 201;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
  }

  body.pk-site-nav-open .pk-site-header__panel {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .pk-site-header__nav-list,
  .pk-site-header__panel .pk-site-header__nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .pk-site-header__nav-list li,
  .pk-site-header__panel .pk-site-header__nav-list li {
    width: 100%;
  }

  .pk-site-header__nav-list a,
  .pk-site-header__panel .pk-site-header__nav-list a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 54px;
    padding: 0 20px !important;
    font-size: 17px;
    font-weight: 600;
    color: var(--pk-abs-text, #202a37) !important;
    line-height: 1.25;
    border-bottom: 1px solid var(--pk-abs-surface-alt, #f5f5f5);
  }

  .pk-site-header__nav-list a:active,
  .pk-site-header__panel .pk-site-header__nav-list a:active {
    background: var(--pk-abs-green-lighter, #eaf7ee);
  }

  .pk-site-header__drawer-auth {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px 20px;
  }

  .pk-site-header__drawer-signin {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 40px;
    font-size: 16px;
    font-weight: 600;
    color: var(--pk-abs-green, #17a24c);
    text-decoration: none;
  }

  .pk-site-header__drawer-signup {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    border-radius: var(--pk-abs-r, 12px);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
  }

  .pk-site-header__drawer-account {
    display: flex;
    align-items: center;
    min-height: 40px;
    font-size: 17px;
    font-weight: 600;
    color: var(--pk-abs-text, #202a37);
    text-decoration: none;
  }

  .pk-site-header__drawer-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border-radius: var(--pk-abs-r, 12px);
    border: 1.5px solid var(--pk-abs-border, #e5e5e5);
    background: var(--pk-abs-white, #fff);
    color: var(--pk-abs-text-soft, #525252);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }

  body.pk-site-nav-open.pk-berlin-chrome {
    --pk-chrome-header-height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pk-site-header__menu-toggle-icon span,
  .pk-site-header__menu-toggle-icon span::before,
  .pk-site-header__menu-toggle-icon span::after,
  .pk-site-header__panel,
  .pk-site-header__scrim {
    transition: none !important;
  }
}

/* WooCommerce / affiliate nav in mobile drawer */
.pk-site-header__panel .woocommerce-MyAccount-navigation ul,
.pk-site-header__panel .affiliate-nav ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.pk-site-header__panel .woocommerce-MyAccount-navigation a,
.pk-site-header__panel .affiliate-nav a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--pk-abs-text-soft, #525252);
}

/* Footer — dark grid restyle (berlin-footer-design-reference; markup unchanged) */
.pk-site-footer {
  background: var(--pk-abs-black, #202a37);
  border-top: 3px solid var(--pk-abs-green, #17a24c);
  color: #aeb6be;
  padding: 56px 0 32px;
  min-width: 0;
  max-width: 100%;
}

.pk-site-footer__inner {
  min-width: 0;
  max-width: 100%;
}

.pk-site-footer__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr 1.1fr;
  gap: 40px;
  margin-bottom: 0;
  min-width: 0;
}

.pk-site-footer__brand,
.pk-site-footer__col,
.pk-site-footer__app {
  min-width: 0;
}

.pk-site-footer__brand .pk-site-footer__logo {
  display: block;
  margin-bottom: 18px;
}
.pk-site-footer__brand .pk-site-footer__logo img {
  height: 34px;
  width: auto;
  max-width: 100%;
}
.pk-site-footer__brand p {
  font-size: 14px;
  color: #aeb6be !important;
  max-width: 44ch;
  line-height: 1.65;
  font-weight: 400;
  margin: 0;
}

.pk-site-footer__col h4,
.pk-site-footer__app h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff !important;
  margin: 0 0 18px;
}

.pk-site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pk-site-footer__col a {
  display: block;
  font-size: 15px;
  color: #aeb6be !important;
  font-weight: 400;
  text-decoration: none;
  padding: 7px 0;
  width: fit-content;
  max-width: 100%;
  transition: color 0.15s ease;
}
.pk-site-footer__col a:hover {
  color: #fff !important;
  text-decoration: underline;
  text-decoration-color: #33d871;
  text-underline-offset: 3px;
}

.pk-site-footer__app-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* Same white SVG badges as Final CTA (.app-badge in final_cta-abs.php) */
.pk-site-footer .app-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 135px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.pk-site-footer .app-badge:hover {
  opacity: 0.92;
}

.pk-site-footer .app-badge svg {
  display: block;
  width: 135px;
  height: 40px;
  flex-shrink: 0;
}

.pk-site-footer .app-badge text {
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1;
}

.pk-site-footer .app-badge .badge-kicker {
  font-size: 8px !important;
}

.pk-site-footer .app-badge .badge-name {
  font-size: 14px !important;
  font-weight: 600 !important;
}

.pk-site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #323c49;
  font-size: 13px;
  color: #737b84;
  font-weight: 400;
}

.pk-site-footer__bottom > span {
  color: #737b84 !important;
}

.pk-site-footer__socials {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.pk-site-footer__socials a {
  width: 38px;
  height: 38px;
  border: 1px solid #323c49;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #aeb6be !important;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pk-site-footer__socials a:hover {
  border-color: #33d871;
  color: #fff !important;
}

@media (max-width: 1024px) {
  .pk-site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
  .pk-site-footer__brand,
  .pk-site-footer__app {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .pk-site-footer {
    padding: 40px 0 28px;
  }

  .pk-site-footer__grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .pk-site-footer__brand,
  .pk-site-footer__app {
    grid-column: span 1;
  }

  .pk-site-footer__brand p {
    max-width: none;
  }

  .pk-site-footer__bottom {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* Sticky offset helpers for Berlin surfaces */
body.pk-berlin-chrome .pk-toc-aside {
  top: calc(var(--pk-chrome-header-height, 72px) + 24px);
}

body.pk-berlin-chrome [id^="pk-faq-"] {
  scroll-margin-top: calc(var(--pk-chrome-header-height, 72px) + 24px);
}

body.pk-berlin-chrome .pk-listing-shell [id],
body.pk-berlin-chrome .pk-cornerstone-body [id] {
  scroll-margin-top: calc(var(--pk-chrome-header-height, 72px) + 16px);
}
