/* site header, wordmark, primary nav and its dropdowns
   Part of the split style.css. inc/enqueue.php enqueues each file as
   its own <link>, in filename order -- they are NOT concatenated, so a
   comment or a rule cut across the join does not heal at the seam. It
   breaks both files, and the browser drops everything it cannot parse
   without saying so. Keep every construct whole inside one file.
   Source order is still the cascade, so moving a rule between files
   can change which one wins. */

/* overflow-x: auto as a safety net at every width, not just the narrower
   breakpoints below that already set it explicitly: nav items have
   white-space: nowrap and don't shrink, so at in-between viewport widths
   where 5 items at this font-size don't fit the clamped column, they used
   to silently overflow and visually sit underneath the centered logo
   instead of scrolling -- harmless (no-op) once content actually fits. */
/* max-width, not a fixed width: the header is now a real minmax(0,1fr) grid
   column (see .pet-site-header > .wp-block-group above), so nav must be
   able to shrink to whatever share of that column it's actually given
   instead of forcing a viewport-relative size that can overflow into the
   logo's column on medium-wide screens. */
.pet-primary-nav { max-width: clamp(320px, 44vw, 640px); min-width: 0; overflow-x: auto; scrollbar-width: none; width: 100%; }
.pet-primary-nav::-webkit-scrollbar { display: none; }
/* align-items: center, not the flex default (stretch): plain <a> links and
   the dropdown <button>s are different element types with different
   natural heights, so stretching each <li> to the tallest sibling then
   left each child sitting at its own top instead of a shared baseline. */
.pet-primary-nav > ul { align-items: center; display: flex; gap: clamp(8px, 1vw, 16px); justify-content: space-between; list-style: none; margin: 0; padding: 0; width: 100%; }
.pet-primary-nav a { border-radius: 10px; color: var(--pet-text); font-size: 1.09rem; font-weight: 700; letter-spacing: -.01em; padding: .35rem .55rem; text-decoration: none; transition: background .15s, color .15s; white-space: nowrap; }
/* Each link its own highlight, not just a colour change -- matches the
   dropdown-menu rows below, which already got a background+radius on
   hover/focus. The top-level links never had one, so hovering across the
   nav used to read as one continuous strip lighting up by letter colour
   alone rather than five distinct, separately-clickable targets. */
.pet-primary-nav a:hover,
.pet-primary-nav a:focus-visible { background: var(--pet-surface-muted); color: var(--pet-primary); }
.pet-primary-nav a:focus-visible { outline: 2px solid var(--pet-focus); outline-offset: -2px; }
/* Negative margin cancels the padding above so it doesn't widen the row
   itself or nudge neighbouring items apart -- the highlight grows inward
   into space the link already occupied, not outward into its siblings'. */
.pet-primary-nav > ul { margin-inline: -.55rem; }
.pet-nav-dropdown { align-items: center; display: flex; position: relative; }
/* inline-flex, not flex: a block-level toggle sitting next to plain inline
   <a> siblings is the other half of the same misalignment. */
.pet-nav-dropdown-toggle { align-items: center; background: none; border: 0; border-radius: 10px; color: var(--pet-text); cursor: pointer; display: inline-flex; font: inherit; font-size: 1.09rem; font-weight: 700; gap: .3rem; letter-spacing: -.01em; padding: .35rem .55rem; transition: background .15s, color .15s; white-space: nowrap; }
.pet-nav-dropdown-toggle::after { content: "▾"; font-size: .65em; }
.pet-nav-dropdown.is-open .pet-nav-dropdown-toggle::after { content: "▴"; }
.pet-nav-dropdown-toggle:hover,
.pet-nav-dropdown-toggle:focus-visible { background: var(--pet-surface-muted); color: var(--pet-primary); }
.pet-nav-dropdown-toggle:focus-visible { outline: 2px solid var(--pet-focus); outline-offset: -2px; }
/* assets/nav-dropdown.js sets position:fixed top/left from the button's own
   getBoundingClientRect() on open, so this always renders next to the
   button regardless of .pet-primary-nav's horizontal scroll on mobile --
   no CSS positioning trick needed (a transform-escape-hatch version of this
   didn't reliably stay visible on iOS Safari). */
.pet-nav-dropdown-menu { background: var(--pet-surface); border: 1px solid var(--pet-border); border-radius: 16px; box-shadow: 0 16px 34px color-mix(in srgb, var(--pet-shadow-color) 14%, transparent); display: grid; gap: .15rem; list-style: none; margin: 0; padding: .5rem; position: fixed; z-index: 60; }
.pet-nav-dropdown-menu[hidden] { display: none; }
.pet-nav-dropdown-menu a { color: var(--pet-text); display: block; font-size: .92rem; font-weight: 700; padding: .55rem .8rem; text-decoration: none; white-space: nowrap; }
.pet-nav-dropdown-menu a:hover { background: var(--pet-surface-muted); border-radius: 10px; color: var(--pet-primary); }
/* "Аквариумистика" row inside the shop dropdown: a real link plus its own
   nested toggle exposing the 13 aquascaping specialty groups -- reuses the
   exact same .pet-nav-dropdown-toggle/-menu classes and nav-dropdown.js
   logic one level deeper, just laid out inline with the link instead of
   being the whole row. */
.pet-nav-dropdown-menu li.pet-nav-dropdown { align-items: center; display: flex; justify-content: space-between; padding: 0; position: relative; }
.pet-nav-dropdown-menu li.pet-nav-dropdown > a { flex: 1 1 auto; }
/* A plain textless button here was too subtle to notice or reliably tap --
   a filled circle with a visible border reads unambiguously as its own
   separate control, distinct from the link text next to it. */
.pet-nav-subdropdown-toggle { align-items: center; background: var(--pet-surface-muted); border: 1px solid var(--pet-border-input); border-radius: 999px; color: var(--pet-text); cursor: pointer; display: inline-flex; flex: 0 0 auto; font-size: .8rem; height: 32px; justify-content: center; margin-inline-end: .5rem; width: 32px; }
.pet-nav-subdropdown-toggle::after { content: "▾"; }
.pet-nav-dropdown.is-open > .pet-nav-subdropdown-toggle::after { content: "▴"; }
.pet-nav-subdropdown-toggle:hover, .pet-nav-dropdown.is-open > .pet-nav-subdropdown-toggle { background: var(--pet-primary-soft); border-color: var(--pet-primary); }
.pet-nav-subdropdown-menu { min-width: 240px; }

/* Hover feedback on every dropdown row, at both levels.
   A submenu parent row is an <a> next to its own <button>, so highlighting
   only the <a> lit up part of a row and left the rest inert -- the one row in
   the menu that behaved differently from its neighbours. Highlight the row and
   the link together instead.
   :focus-visible carries the same styling, because a keyboard user needs to
   see which row they are on just as much as a pointer user does. */
.pet-nav-subdropdown:hover,
.pet-nav-subdropdown:focus-within { background: var(--pet-surface-muted); border-radius: 10px; }
.pet-nav-subdropdown:hover > a,
.pet-nav-subdropdown:focus-within > a { color: var(--pet-primary); }
.pet-nav-dropdown-menu a:focus-visible { background: var(--pet-surface-muted); border-radius: 10px; color: var(--pet-primary); outline: 2px solid var(--pet-focus); outline-offset: -2px; }
.pet-header-actions { align-items: center; display: flex !important; flex-wrap: nowrap !important; gap: 8px; min-width: max-content; white-space: nowrap; }

/* Hamburger toggle -- hidden here (desktop default); 60-legal.css shows it
   and hides .pet-primary-nav's inline row below the same breakpoint that
   used to stack the header into 2-3 rows instead. Plain CSS bars, not an
   SVG/emoji, matching .pet-nav-dropdown-toggle::after's own plain-glyph
   arrow elsewhere in this file. */
.pet-nav-hamburger { background: none; border: 0; border-radius: 10px; cursor: pointer; display: none; flex-direction: column; gap: 5px; height: 44px; justify-content: center; padding: 0 10px; width: 44px; }
.pet-nav-hamburger:hover, .pet-nav-hamburger:focus-visible { background: var(--pet-surface-muted); }
.pet-nav-hamburger:focus-visible { outline: 2px solid var(--pet-focus); outline-offset: -2px; }
.pet-nav-hamburger span { background: var(--pet-text); border-radius: 2px; display: block; height: 2px; transition: transform .2s, opacity .2s; width: 100%; }
/* The X: middle bar fades out, the outer two rotate to cross in its place.
   translateY matches the 5px gap + 2px bar height above (7px centre-to-centre). */
.pet-nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pet-nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pet-nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* Reuses .pet-nav-dropdown/-toggle/-menu (nav-dropdown.js attaches to any
   element with these classes) so the language switcher opens/positions/
   closes exactly like the Shop/Pets nav dropdowns. */
.pet-language-switcher { list-style: none; margin: 0; padding: 0; }

.pet-legal-table-wrap { overflow-x: auto; }
.pet-legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pet-legal-table th,
.pet-legal-table td { padding: .75rem; border: 1px solid var(--pet-border); text-align: start; vertical-align: top; }
.pet-legal-table th { background: var(--pet-surface-muted); color: var(--pet-text); }
.pet-language-menu { min-width: 130px; }
.pet-language-current { color: var(--pet-muted); display: block; font-size: .92rem; font-weight: 700; padding: .55rem .8rem; }
.pet-header-cart { align-items: center; background: var(--pet-primary); border-radius: 50%; color: var(--pet-surface); display: inline-flex; flex: 0 0 auto; height: 44px; justify-content: center; position: relative; text-decoration: none; width: 44px; }
.pet-header-cart:hover, .pet-header-cart:focus-visible { background: var(--pet-primary-hover); color: var(--pet-surface); transform: translateY(-2px); }
.pet-header-cart svg { fill: currentColor; height: 21px; width: 21px; }
.pet-header-cart-count { align-items: center; background: var(--pet-accent); border: 2px solid var(--pet-surface); border-radius: 999px; color: var(--pet-text); display: inline-flex; font-size: .65rem; font-weight: 900; height: 20px; justify-content: center; min-width: 20px; padding: 0 4px; position: absolute; right: -7px; top: -7px; }
.pet-header-dashboard { align-items: center; background: var(--pet-surface-muted); border: 1px solid var(--pet-border-input); border-radius: 999px; color: var(--pet-text); display: inline-flex; flex: 0 0 auto; font-size: .82rem; font-weight: 800; gap: .42rem; height: 44px; justify-content: center; padding: 0 .8rem; text-decoration: none; transition: background .2s, border-color .2s, color .2s, transform .2s; }
.pet-header-dashboard:hover, .pet-header-dashboard:focus-visible, .pet-header-dashboard[aria-current="page"] { background: var(--pet-primary-soft); border-color: var(--pet-primary); color: var(--pet-text); transform: translateY(-2px); }
.pet-header-dashboard:focus-visible { outline: 2px solid var(--pet-focus); outline-offset: 2px; }
.pet-header-dashboard svg { fill: currentColor; height: 17px; width: 17px; }
.pet-header-account { align-items: center; background: var(--pet-surface); border: 2px solid var(--pet-border-input); border-radius: 50%; display: inline-flex; flex: 0 0 auto; height: 44px; justify-content: center; overflow: hidden; text-decoration: none; transition: border-color .2s, transform .2s, box-shadow .2s; width: 44px; }
.pet-header-account.is-logged-out { border-color: var(--pet-accent-text); }
