/* Header: top row (logo, search, account, cart) that scrolls away, a sticky navy menu bar with the Products picture menu, and a slide-in menu for small screens. Colours come from the colour system (tokens.css). */

:root {
  --hd-top: 80px;
  --hd-bar: 52px;
  --hd-ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

.pg-skip { position: absolute; left: -9999px; top: 8px; z-index: 200; padding: 10px 14px; border-radius: 8px; background: var(--pg-navy); color: var(--pg-on-navy); font-weight: 600; }
.pg-skip:focus { left: 12px; }

/* ---------- Frame ---------- */
.pg-header { position: sticky; top: 0; z-index: 60; background: #ffffff; transition: box-shadow 0.25s ease; }
.admin-bar .pg-header { top: var(--wp-admin--admin-bar--height, 32px); }
.pg-header.is-scrolled { box-shadow: 0 1px 0 var(--pg-line), 0 6px 16px rgba(20, 33, 61, 0.05); }
.pg-logo { display: flex; align-items: center; flex: none; }
.pg-logo img { height: 48px; width: auto; display: block; }
.pg-logo:hover { opacity: 1; }

/* ---------- Top row ---------- */
.pg-hd-top { position: relative; background: #ffffff; box-shadow: inset 0 -1px 0 var(--pg-line); }
.pg-hd-top-in { display: flex; align-items: center; gap: 32px; height: 72px; }
.pg-hd-search { display: none; flex: 1 1 auto; max-width: 640px; min-width: 0; }
.pg-hd-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pg-hd-btn { position: relative; flex: none; }
.pg-hd-btn svg { display: block; }
.pg-hd-account { width: auto; padding: 0 14px; gap: 10px; background: transparent; font-size: 15px; font-weight: 600; }
.pg-hd-account:hover { background: var(--pg-chip); opacity: 1; }
.pg-hd-account-t { display: none; }
.pg-cart-link { position: relative; }
.pg-hd-tools .pg-cart-link { display: flex; background: transparent; }
.pg-hd-tools .pg-cart-link:hover { background: var(--pg-chip); opacity: 1; }
.pg-hd-sbtn, .pg-hd-burger { background: transparent; }
.pg-hd-sbtn:hover, .pg-hd-burger:hover { background: var(--pg-chip); opacity: 1; }
.pg-cart-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--pg-navy);
  color: var(--pg-on-navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.2s ease, visibility 0s;
}
.pg-cart-count[data-n="0"] { opacity: 0; transform: scale(0.4); pointer-events: none; visibility: hidden; transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.2s ease, visibility 0s linear 0.3s; }

/* Search panel under the top row (small screens). It fades in, so nothing jumps. */
.pg-hd-spanel { position: absolute; top: 100%; left: 0; right: 0; z-index: 4; padding: 12px 0 16px; background: #ffffff; border-bottom: 1px solid var(--pg-line); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 0.22s ease, transform 0.28s var(--hd-ease), visibility 0s linear 0.28s; }
.pg-hd-spanel.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.22s ease, transform 0.28s var(--hd-ease), visibility 0s; }

/* ---------- Search field ---------- */
.pg-hs { position: relative; width: 100%; }
.pg-hs-form { --r: var(--pg-r-control); position: relative; display: flex; align-items: center; height: 48px; margin: 0; background: var(--pg-field-bg); border: 1px solid var(--pg-field-border); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.pg-hs-form:focus-within { border-color: var(--pg-field-border-focus); box-shadow: inset 0 0 0 1px var(--pg-field-border-focus); }
.pg-hs-ic { position: absolute; left: 14px; top: 0; bottom: 0; display: flex; align-items: center; color: var(--pg-muted); pointer-events: none; }
.pg-hs-form input[type="search"] { flex: 1 1 auto; min-width: 0; width: 100%; height: 100%; padding: 0 56px 0 44px; border: 0; border-radius: 0; background: transparent; color: var(--pg-field-ink); font: inherit; font-size: 15px; outline: 0; -webkit-appearance: none; appearance: none; }
.pg-hs-form input[type="search"]::placeholder { color: var(--pg-subtle); opacity: 1; }
.pg-hs-form input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.pg-hs-go { position: absolute; right: 5px; top: 5px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 8px; background: var(--pg-btn-bg); color: var(--pg-btn-fg); cursor: pointer; transition: background-color 0.2s ease; }
.pg-hs-go:hover { background: var(--pg-btn-bg-hover); }
.pg-hs-go:active { background: var(--pg-btn-bg-active); }
.pg-hs-go svg { width: 18px; height: 18px; }

/* Suggestions: the list is a squircle, so its soft shadow sits on the wrapper around it. */
.pg-hs-pop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 70; filter: drop-shadow(0 8px 18px rgba(20, 33, 61, 0.1)); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.18s ease, transform 0.24s var(--hd-ease), visibility 0s linear 0.24s; }
.pg-hs-pop.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.18s ease, transform 0.24s var(--hd-ease), visibility 0s; }
.pg-hs-list { --r: var(--pg-r-pop); margin: 0; padding: 8px; list-style: none; max-height: min(80vh, 600px); overflow-y: auto; overscroll-behavior: contain; background: #ffffff; color: var(--pg-ink); border: 1px solid var(--pg-line); }
.pg-hs-head { padding: 8px 10px 4px; color: var(--pg-subtle); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pg-hs-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--pg-ink); transition: background-color 0.15s ease; cursor: pointer; }
.pg-hs-item:hover { opacity: 1; }
.pg-hs-item:hover,
.pg-hs-list li[aria-selected="true"] > .pg-hs-item { background: var(--pg-navy-100); }
.pg-hs-img { flex: none; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--pg-navy-50); border: 1px solid var(--pg-line); display: block; }
.pg-hs-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-hs-text { display: grid; min-width: 0; line-height: 1.3; }
.pg-hs-title { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-hs-meta { font-size: 12.5px; color: var(--pg-muted); }
.pg-hs-all { color: var(--pg-brand-text); font-weight: 600; font-size: 14.5px; margin-top: 4px; border-top: 1px solid var(--pg-line); border-radius: 0 0 10px 10px; padding-top: 12px; }
.pg-hs-all svg { width: 16px; height: 16px; margin-left: auto; transition: transform 0.2s ease; }
.pg-hs-item:hover .pg-hs-all svg, .pg-hs-all:hover svg { transform: translateX(3px); }
.pg-hs-none { padding: 14px 10px; color: var(--pg-muted); font-size: 14px; }

/* ---------- Menu bar (desktop) ---------- */
.pg-hd-bar { display: none; background: var(--pg-navy-900); }
.pg-hd-bar-in { position: relative; display: flex; align-items: center; gap: 16px; height: var(--hd-bar); }
.pg-nav { flex: 1 1 auto; min-width: 0; }
.pg-menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pg-mi { position: relative; display: flex; align-items: center; height: var(--hd-bar); }
.pg-ml { position: relative; display: inline-flex; align-items: center; height: 100%; padding: 0 16px; color: var(--pg-ink); font-size: 15px; font-weight: 600; white-space: nowrap; transition: color 0.2s ease; }
.pg-ml:hover { opacity: 1; }
.pg-ml::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--pg-accent); transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--hd-ease); }
.pg-mi.has-sub > .pg-ml { padding-right: 2px; }
.pg-mi.has-sub > .pg-ml::after { right: 2px; }
.pg-mi.is-current > .pg-ml { color: var(--pg-brand-text); }
.pg-mi.is-current > .pg-ml::after { transform: scaleX(1); }
.pg-mt { display: flex; align-items: center; justify-content: center; width: 28px; height: 100%; margin-right: 6px; padding: 0; border: 0; background: none; color: var(--pg-subtle); cursor: pointer; transition: color 0.2s ease; }
.pg-mt svg { width: 16px; height: 16px; transition: transform 0.3s var(--hd-ease); }
.pg-mi.is-open > .pg-mt { color: var(--pg-ink); }
.pg-mi.is-open > .pg-mt svg { transform: rotate(180deg); }
.pg-mi.is-open > .pg-ml { color: var(--pg-brand-text); }
.pg-mi.is-open > .pg-ml::after { transform: scaleX(1); }

/* Drop-down panels: a white squircle with a light shadow around it. */
.pg-sub { position: absolute; top: 100%; left: 0; z-index: 65; padding-top: 8px; filter: drop-shadow(0 10px 22px rgba(20, 33, 61, 0.12)); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.28s var(--hd-ease), visibility 0s linear 0.28s; }
.pg-mi.is-open > .pg-sub { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s ease, transform 0.28s var(--hd-ease), visibility 0s; }
.pg-sub-in { --r: var(--pg-r-pop); min-width: 260px; padding: 12px; background: #ffffff; color: var(--pg-ink); border: 1px solid var(--pg-line); }
.pg-sub-grid { display: grid; gap: 2px; }
.pg-mg-link { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--pg-ink); transition: background-color 0.15s ease; }
.pg-mg-link:hover { opacity: 1; background: var(--pg-navy-100); }
.pg-mg-img { flex: none; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--pg-navy-50); border: 1px solid var(--pg-line); display: block; }
.pg-mg-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-mg-name { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.pg-mg-all { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--pg-line); color: var(--pg-brand-text); font-size: 14.5px; font-weight: 700; }
.pg-mg-all:hover { opacity: 1; color: var(--pg-brand-text-hover); }
.pg-mg-all svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.pg-mg-all:hover svg { transform: translateX(3px); }

/* Products: every category at once, as a picture grid across the width of the page. */
.pg-mi.has-sub:has(.pg-sub--mega) { position: static; }
.pg-sub--mega { left: 24px; right: 24px; }
.pg-sub--mega .pg-sub-in { max-height: calc(100vh - var(--hd-bar) - 64px); overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 8px; }
.pg-sub--mega .pg-sub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 16px; }

/* Right end of the bar: shows when the top row has scrolled away. */
.pg-hd-mark { display: flex; flex: none; width: 0; margin-right: -16px; overflow: hidden; opacity: 0; visibility: hidden; transform: scale(0.6); transition: width 0.3s var(--hd-ease), margin 0.3s var(--hd-ease), opacity 0.3s ease, transform 0.3s var(--hd-ease), visibility 0s linear 0.3s; }
.pg-hd-mark:hover { opacity: 0; }
.pg-hd-mark img { box-sizing: border-box; flex: none; width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: #ffffff; }
.pg-header.is-condensed .pg-hd-mark { width: 32px; margin-right: 0; opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.pg-header.is-condensed .pg-hd-mark:hover { opacity: 1; }
.pg-hd-bar-end { display: flex; align-items: center; gap: 6px; margin-left: auto; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.pg-header.is-condensed .pg-hd-bar-end { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s; }
.pg-header.is-condensed { box-shadow: 0 8px 20px rgba(20, 33, 61, 0.12); }
.pg-hd-bar-cart { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--pg-ink); transition: background-color 0.2s ease; }
.pg-hd-bar-cart:hover { opacity: 1; background: var(--pg-navy-800); }
.pg-hd-bar .pg-cart-count { top: 0; right: -2px; background: #ffffff; color: var(--pg-navy-900); }

/* Round search in the bar: an icon that grows into a field. */
.pg-hs--bar { width: 38px; height: 38px; }
.pg-hs--bar .pg-hs-form { position: absolute; top: 0; right: 0; width: 38px; height: 38px; border-radius: 999px; border: 1px solid transparent; background: transparent; overflow: hidden; transition: width 0.4s var(--hd-ease), background-color 0.2s ease, border-color 0.2s ease; }
.pg-hs--bar.is-open .pg-hs-form { width: 17rem; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.55); }
.pg-hs--bar .pg-hs-form:focus-within { box-shadow: none; border-color: #ffffff; }
.pg-hs--bar .pg-hs-ic { left: 0; width: 38px; color: var(--pg-ink); pointer-events: auto; background: transparent; border: 0; padding: 0; justify-content: center; cursor: pointer; border-radius: 999px; transition: background-color 0.2s ease; }
.pg-hs--bar:not(.is-open) .pg-hs-ic:hover { background: var(--pg-navy-800); }
.pg-hs--bar input[type="search"] { padding: 0 14px 0 42px; color: var(--pg-ink); opacity: 0; transition: opacity 0.25s ease; }
.pg-hs--bar.is-open input[type="search"] { opacity: 1; }
.pg-hs--bar input[type="search"]::placeholder { color: var(--pg-navy-300); }
.pg-hs--bar .pg-hs-go { display: none; }
.pg-hs--bar .pg-hs-pop { left: auto; right: 0; width: 22rem; }

/* ---------- Phone and tablet menu ---------- */
.pg-drawer-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(13, 22, 41, 0.5); opacity: 0; transition: opacity 0.3s ease; }
.pg-drawer-overlay[hidden] { display: none; }
.pg-drawer-overlay.is-visible { opacity: 1; }
.pg-drawer { position: fixed; top: 0; right: 0; z-index: 90; display: flex; flex-direction: column; gap: 20px; width: min(26rem, 100%); height: 100dvh; padding: 20px 24px 28px; overflow-y: auto; overscroll-behavior: contain; background: #ffffff; transform: translateX(100%); visibility: hidden; transition: transform 0.34s var(--hd-ease), visibility 0s linear 0.34s; }
.pg-drawer.is-open { transform: none; visibility: visible; transition: transform 0.34s var(--hd-ease), visibility 0s; }
.pg-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pg-drawer-head .pg-logo img { height: 40px; }
.pg-drawer-account { --r: var(--pg-r-control); display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--pg-navy-50); color: var(--pg-ink); border: 1px solid var(--pg-line); transition: border-color 0.2s ease; }
.pg-drawer-account:hover { opacity: 1; border-color: var(--pg-navy-900); }
.pg-drawer-account span:nth-child(2) { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.pg-drawer-account small { color: var(--pg-muted); font-size: 13px; }
.pg-drawer-account > svg { flex: none; color: var(--pg-muted); }
.pg-drawer-ic { display: flex; flex: none; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; background: #ffffff; }
.pg-drawer .pg-hs-go { width: 36px; }
.pg-drawer .pg-menu { display: block; }
.pg-drawer .pg-mi { display: flex; flex-wrap: wrap; align-items: center; height: auto; border-bottom: 1px solid var(--pg-line); }
.pg-drawer .pg-ml { flex: 1; height: auto; padding: 14px 0; font-size: 18px; }
.pg-drawer .pg-ml::after { display: none; }
.pg-drawer .pg-mi.has-sub > .pg-ml { padding-right: 0; }
.pg-drawer .pg-mi.is-current > .pg-ml { color: var(--pg-brand-text); }
.pg-drawer .pg-mt { width: 44px; height: 44px; margin: 0; border-radius: 12px; background: var(--pg-navy-100); color: var(--pg-ink); transition: background-color 0.2s ease, color 0.2s ease; }
.pg-drawer .pg-mi.is-open > .pg-mt { background: var(--pg-navy-900); color: var(--pg-on-navy); }
.pg-drawer .pg-mi.is-open > .pg-ml { color: var(--pg-ink); }
.pg-drawer .pg-mi.is-current.is-open > .pg-ml { color: var(--pg-brand-text); }
.pg-drawer .pg-sub { position: static; display: grid; grid-template-rows: 0fr; flex-basis: 100%; padding: 0; filter: none; opacity: 0; visibility: hidden; transform: none; transition: grid-template-rows 0.32s var(--hd-ease), opacity 0.2s ease, visibility 0s linear 0.32s; }
.pg-drawer .pg-mi.is-open > .pg-sub { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows 0.32s var(--hd-ease), opacity 0.25s ease 0.05s, visibility 0s; }
.pg-drawer .pg-sub-in { --r: 0; min-height: 0; min-width: 0; overflow: hidden; padding: 0; border: 0; border-radius: 0; background: transparent; }
.pg-drawer .pg-sub-grid { grid-template-columns: 1fr; padding: 0 0 12px; }
.pg-drawer .pg-mg-link { margin: 0 -10px; }
.pg-drawer .pg-mg-all { margin: 0 0 12px; padding: 8px 0 0; border-top: 0; }
.pg-drawer-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 8px; }
.pg-drawer-foot .pg-btn svg { width: 18px; height: 18px; }

/* ---------- Widths ---------- */
@media (max-width: 719px) {
  .pg-hd-top-in { height: 64px; gap: 12px; }
  .pg-logo img { height: 40px; }
  .pg-hd-account { display: none; }
  .pg-hd-spanel { padding-inline: 0; }
}
@media (min-width: 720px) and (max-width: 1099px) {
  .pg-hd-account { width: 44px; padding: 0; }
}
@media (min-width: 1100px) {
  .pg-header { top: calc(var(--hd-top) * -1); }
  .admin-bar .pg-header { top: calc(var(--wp-admin--admin-bar--height, 32px) - var(--hd-top)); }
  .pg-hd-top-in { height: var(--hd-top); }
  .pg-hd-search { display: block; }
  .pg-hd-sbtn, .pg-hd-burger, .pg-hd-spanel { display: none; }
  .pg-hd-account-t { display: inline; }
  .pg-hd-bar { display: block; }
}
@media (min-width: 1440px) {
  .pg-hs--bar.is-open .pg-hs-form { width: 20rem; }
}
@media (hover: hover) and (min-width: 1100px) {
  .pg-ml:hover { color: var(--pg-brand-text); }
  .pg-ml:hover::after { transform: scaleX(1); }
  .pg-mi:hover > .pg-mt { color: var(--pg-ink); }
  .pg-mi:hover > .pg-mt svg { transform: rotate(180deg); }
  .pg-mi:hover > .pg-sub { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s ease, transform 0.28s var(--hd-ease), visibility 0s; }
}
@media (max-width: 1099px) {
  .pg-hd-bar, .pg-hd-bar-end { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-header, .pg-hd-spanel, .pg-hs-pop, .pg-sub, .pg-drawer, .pg-drawer-overlay, .pg-ml::after, .pg-mt svg, .pg-hd-mark, .pg-hd-bar-end, .pg-hs--bar .pg-hs-form { transition: none; }
  .pg-drawer .pg-sub { transition: none; }
}
