/*
 * One site header for every page (owner, 23 Oct night). Markup: template-parts/site/header-real.php; base styles:
 * homepage-shadow.css (the approved homepage header). This file only adds what the shared header needs.
 */

/* wrapper on inner pages: the header paints itself */
html:not(#em26-hd) .em26-site-header--real {
  position: relative;
  z-index: 100;
  border-bottom: 0;
  background: transparent;
  overflow: visible;
}

/* mega menu: every sub-section chip is its own link above the card link, with a real hit area */
html:not(#em26-hd) .em26-home-real .em26-home-real-nav-route li { padding: 0; }
html:not(#em26-hd) .em26-home-real .em26-home-real-nav-route li a {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}
html:not(#em26-hd) .em26-home-real .em26-home-real-nav-route li:hover { border-color: var(--em26-home-ink); }
html:not(#em26-hd) .em26-home-real .em26-home-real-nav-route li a:focus-visible { outline: 3px solid var(--em26-home-cobalt, #1d5dbb); outline-offset: 2px; }
@media (pointer: coarse) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-nav-route li a { min-height: 2.75rem; }
}

/* desktop row: direct links to the main directions, the current one marked */
html:not(#em26-hd) .em26-home-real .em26-home-real-catalogue-control > a[aria-current="page"]:not(:hover):not(:focus-visible) { color: var(--em26-home-magenta, #b31368); }
html:not(#em26-hd) .em26-home-real .em26-home-real-catalogue-control > a[aria-current="page"]::before { transform: scaleX(1); }
@media (max-width: 1023px) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-catalogue-control > .em26-home-real-quick { display: none; }
}
/* 1024–1199 px (small laptops, iPad landscape): the direct links fit when the row is a little tighter (QA 23 Oct). */
@media (min-width: 1024px) and (max-width: 1199px) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-catalogue-control > .em26-home-real-quick { display: inline-flex; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-catalogue-control > :is(a, button) { padding-inline: 12px !important; font-size: 13px !important; }
}

/* inner pages: the page title area starts right under the header, as before */
html:not(#em26-hd) body:not(.home) .em26-site-header--real + .em26-site-main,
html:not(#em26-hd) body:not(.home) .em26-site-header--real ~ .em26-site-main { margin-top: 0; }

/*
 * Cart and account are reachable at every width (23 Oct night QA: below 1024px the header had no cart at all).
 * Tablet keeps the two text buttons; phones get icon buttons (menu | logo | search | cart), account moves to the drawer.
 */
html:not(#em26-hd) .em26-home-real .em26-hd-icon { display: none; flex: 0 0 auto; }
@media (min-width: 768px) and (max-width: 1023px) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-mainbar { grid-template-columns: 170px minmax(0, 1fr) auto; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-utilities { display: flex; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand,
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand img { width: 160px; max-width: 100%; height: auto; }
}
@media (max-width: 767px) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-mainbar { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand { width: auto; max-width: 142px; min-width: 0; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand img { width: 100%; height: auto; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-search { order: 9; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-utilities { display: flex; }
  html:not(#em26-hd) .em26-home-real .em26-hd-account { display: none; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-search-toggle,
  html:not(#em26-hd) .em26-home-real .em26-hd-cart {
    position: relative;
    display: inline-flex;
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: var(--em26-home-ink);
    background: var(--em26-home-surface);
    border: 1px solid var(--em26-home-line-strong);
    border-radius: var(--em26-home-r8);
  }
  html:not(#em26-hd) .em26-home-real .em26-hd-icon { display: block; }
  html:not(#em26-hd) .em26-home-real .em26-hd-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  html:not(#em26-hd) .em26-home-real .em26-hd-cart small {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 18px;
    width: auto;
    height: 18px;
    padding: 0 4px;
    font-size: 10px;
    border-radius: 9px;
  }
  html:not(#em26-hd) .em26-home-real .em26-hd-cart:focus-visible,
  html:not(#em26-hd) .em26-home-real .em26-home-real-search-toggle:focus-visible { outline: 3px solid var(--em26-home-cobalt, #1d5dbb); outline-offset: 2px; }
}

/*
 * Logo size (owner, 30 Oct: «лого замале відносно кнопок»). Measured on every page: the visible lockup was 220×34 px next to
 * 48 px buttons on a laptop and 132×20 px on a 390 px phone, under the brand minimum of 144 px for the horizontal lockup
 * (LOGO_AND_TYPE_RULES.md). The SVG keeps its own clear space; only the rendered width changes.
 */
@media (min-width: 1200px) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand,
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand img { width: 272px; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-mainbar { grid-template-columns: 272px minmax(260px, 1fr) auto; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand,
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand img { width: 248px; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-mainbar { grid-template-columns: 248px minmax(240px, 1fr) auto; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-mainbar { grid-template-columns: 210px minmax(0, 1fr) auto; }
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand,
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand img { width: 200px; }
}
/* phones: as wide as the space between the menu and the search/cart buttons allows, up to 186 px (≥144 px from 360 px up) */
@media (max-width: 767px) {
  html:not(#em26-hd) .em26-home-real .em26-home-real-brand { max-width: 186px; }
}
