/* Store header. Tokens: theme.json presets. Mobile first: the 390 px bar is 60 px + search row. */

.an-header { --an-wrap: 1280px; position: relative; z-index: 40; font-size: 15px; }
.an-icon { width: 20px; height: 20px; flex: none; }
html.an-no-scroll { overflow: hidden; }

/* Utility bar (desktop only) */
.an-utility { display: none; background: var(--wp--preset--color--deep); color: #CFE3E5; font-size: 13.5px; }
.an-utility__row { display: flex; align-items: center; justify-content: space-between; gap: 22px; height: 36px; }
.an-utility__list { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.an-utility__list li { display: flex; align-items: center; gap: 8px; }
.an-utility__list li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--wp--preset--color--lime); }
.an-utility a { color: #fff; }
.an-utility__links { display: flex; gap: 18px; }

/* Main bar */
.an-bar { background: var(--wp--preset--color--surface); box-shadow: 0 1px 0 var(--wp--preset--color--border); }
.an-bar__row { display: flex; align-items: center; gap: 8px; height: 60px; }
.an-bar__search { display: none; }
.an-bar__msearch { padding-bottom: 12px; }
.an-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.an-act { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 10px; border-radius: var(--wp--custom--radius--control); border: 0; background: none; color: var(--wp--preset--color--text) !important; font: inherit; font-weight: 510; text-decoration: none !important; cursor: pointer; }
.an-act:hover { background: #EEF1F3; }
.an-act__label { display: none; }
.an-act--quote { display: none; }
.an-act--cart { padding: 0; }
.an-act--cart .wc-block-mini-cart__button { min-height: 44px; min-width: 44px; padding: 0 10px; color: var(--wp--preset--color--text); }
.an-act--cart .wc-block-mini-cart__badge { background: var(--wp--preset--color--action); color: #fff; font-weight: 700; }

/* Search */
.an-search { position: relative; margin: 0; }
.an-search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--wp--preset--color--muted); pointer-events: none; }
.an-search__input { width: 100%; height: 44px; padding: 0 12px 0 42px !important; border: 1px solid var(--wp--preset--color--border) !important; border-radius: var(--wp--custom--radius--control); background: var(--wp--preset--color--bg); font-size: 16px; color: var(--wp--preset--color--text); }
.an-search__input:focus { background: #fff; border-color: var(--wp--preset--color--brand) !important; outline: 2px solid var(--wp--preset--color--brand); outline-offset: 0; }
.an-search__panel { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border-radius: var(--wp--custom--radius--card); box-shadow: var(--wp--preset--shadow--raised); padding: 8px; z-index: 60; max-height: min(70vh, 560px); overflow: auto; }
.an-sr__head { font-size: 12px; font-weight: 590; letter-spacing: .06em; text-transform: uppercase; color: var(--wp--preset--color--muted); padding: 6px 8px; }
.an-sr__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; }
.an-sr__chip { border: 0; background: var(--wp--preset--color--bg); box-shadow: var(--wp--preset--shadow--ring); border-radius: 9999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--wp--preset--color--text); }
.an-sr__item { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: var(--wp--custom--radius--tile); color: var(--wp--preset--color--text) !important; text-decoration: none !important; }
.an-sr__item:hover, .an-sr__item.is-sel { background: #EEF1F3; }
.an-sr__item img, .an-sr__noimg { width: 56px; height: 42px; object-fit: contain; background: #fff; border-radius: 4px; box-shadow: var(--wp--preset--shadow--ring); flex: none; }
.an-sr__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.an-sr__model { font-family: var(--wp--preset--font-family--mono); font-size: 12px; color: var(--wp--preset--color--brand); }
.an-sr__name { font-size: 14.5px; font-weight: 510; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-sr__price { font-weight: 590; font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-sr__all { display: block; padding: 10px 8px 4px; border-top: 1px solid var(--wp--preset--color--border); margin-top: 6px; font-weight: 590; font-size: 14px; }
.an-sr__empty { padding: 18px 12px; color: var(--wp--preset--color--muted); font-size: 14.5px; text-align: center; }
.an-sr__empty b { color: var(--wp--preset--color--text); }

/* Nav row + mega menus (desktop only) */
.an-nav { display: none; background: var(--wp--preset--color--surface); box-shadow: 0 1px 0 var(--wp--preset--color--border); position: relative; }
.an-nav__row { display: flex; align-items: center; gap: 4px; height: 48px; overflow-x: auto; scrollbar-width: none; }
.an-nav__btn { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-weight: 510; color: var(--wp--preset--color--text) !important; text-decoration: none !important; white-space: nowrap; cursor: pointer; }
.an-nav__btn .an-icon { width: 16px; height: 16px; transition: transform .15s; }
.an-nav__btn:hover, .an-nav__btn[aria-expanded="true"], .an-nav__btn.is-current { color: var(--wp--preset--color--brand) !important; border-bottom-color: var(--wp--preset--color--brand); }
.an-nav__btn[aria-expanded="true"] .an-icon { transform: rotate(180deg); }
/* Resold brand (Atlas Scientific): reachable, but quieter than our own product links. */
.an-nav__btn--quiet { font-weight: 400; color: var(--wp--preset--color--muted) !important; }
.an-nav__sep { width: 1px; height: 22px; background: var(--wp--preset--color--border); margin: 0 6px; }
.an-mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; box-shadow: 0 1px 0 var(--wp--preset--color--border), var(--wp--preset--shadow--raised); }
.an-mega__grid { display: grid; grid-template-columns: repeat(3, 1fr) 1.1fr; grid-auto-rows: min-content; align-content: start; gap: 8px 28px; padding-top: 28px; padding-bottom: 28px; }
.an-mega__link { display: flex; gap: 14px; padding: 10px; border-radius: var(--wp--custom--radius--tile); color: var(--wp--preset--color--text) !important; text-decoration: none !important; }
.an-mega__link:hover { background: #EEF1F3; }
.an-mega__ic { width: 40px; height: 40px; border-radius: var(--wp--custom--radius--tile); background: var(--wp--preset--color--tint); color: var(--wp--preset--color--brand); display: grid; place-items: center; flex: none; }
.an-mega__link b { display: block; font-weight: 590; font-size: 15.5px; }
.an-mega__link span span { font-size: 13.5px; color: var(--wp--preset--color--muted); }
.an-mega__feature { grid-column: 4; grid-row: 1 / span 4; background: var(--wp--preset--color--deep); color: #fff; border-radius: var(--wp--custom--radius--card); padding: 22px; display: flex; flex-direction: column; gap: 10px; align-self: start; text-decoration: none !important; }
.an-mega__feature b { font-size: 20px; font-weight: 590; color: #fff; }
.an-mega__feature p { margin: 0; color: #CFE3E5; font-size: 14.5px; }
.an-mega__feature .an-btn { align-self: flex-start; }
.an-mega__feature img { background: #fff; border-radius: var(--wp--custom--radius--tile); width: 100%; height: 96px !important; object-fit: contain; margin-top: 4px; }

.an-mega__all { grid-column: 1 / 4; display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin: 6px 0 0 10px; font-weight: 590; font-size: 15px; }
.an-mega__all .an-icon { width: 18px; height: 18px; }
.an-drawer__link--all { font-weight: 590; color: var(--wp--preset--color--brand) !important; }
.an-drawer__link--all .an-icon { width: 18px; height: 18px; }

/* Drawer (mobile) */
.an-scrim { position: fixed; inset: 0; background: rgba(6, 28, 30, .5); z-index: 90; }
.an-drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(88vw, 360px); background: #fff; z-index: 91; transform: translateX(-100%); transition: transform .22s ease; display: flex; flex-direction: column; visibility: hidden; }
.an-drawer.is-open { transform: none; visibility: visible; }
.an-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--wp--preset--color--border); }
.an-drawer__body { overflow: auto; flex: 1; padding: 4px 0 12px; }
.an-acc { border-bottom: 1px solid var(--wp--preset--color--border); }
.an-acc summary { display: flex; justify-content: space-between; align-items: center; height: 52px; padding: 0 16px; font-weight: 590; font-size: 16px; cursor: pointer; list-style: none; }
.an-acc summary::-webkit-details-marker { display: none; }
.an-acc summary .an-icon { transition: transform .2s; }
.an-acc[open] summary .an-icon { transform: rotate(180deg); }
.an-acc > .an-drawer__link { margin: 0 8px; }
.an-acc[open] { padding-bottom: 10px; }
.an-drawer__link { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border-radius: var(--wp--custom--radius--tile); color: var(--wp--preset--color--text) !important; text-decoration: none !important; font-size: 15.5px; }
.an-drawer__link:hover { background: #EEF1F3; }
.an-drawer__link small { color: var(--wp--preset--color--muted); font-size: 13px; }
.an-drawer__link--top { margin: 4px 8px 0; }
.an-drawer__foot { padding: 16px; border-top: 1px solid var(--wp--preset--color--border); display: flex; flex-direction: column; gap: 10px; }

/* Desktop */
@media (min-width: 901px) {
	.an-utility { display: block; }
	.an-bar__row { height: 76px; gap: 28px; }
	.an-bar__msearch, .an-act--menu, .an-drawer, .an-scrim { display: none !important; }
	.an-bar__search { display: block; flex: 1; max-width: 620px; }
	.an-logo img { width: auto; height: 54px; }
	.an-act { padding: 0 12px; }
	.an-act__label, .an-act--quote { display: inline-flex; }
	.an-nav { display: block; }
}
/* Desktop: the whole header sticks, the 36 px utility bar scrolls away. */
@media (min-width: 901px) {
	header.wp-block-template-part:has(.an-header) { position: sticky; top: -36px; z-index: 40; }
	.admin-bar header.wp-block-template-part:has(.an-header) { top: -4px; }
}
/* Narrow desktops: tighter links, then the Atlas link goes (still in the utility bar above). The row
   scrolls rather than widening the page if a long category name ever pushes it. */
@media (max-width: 1240px) and (min-width: 901px) { .an-nav__btn { padding: 0 10px; } }
@media (max-width: 1100px) and (min-width: 901px) { .an-nav__btn--quiet, .an-nav__sep--quiet { display: none; } }
@media (max-width: 980px) and (min-width: 901px) { .an-nav__btn { padding: 0 7px; } }
@media (max-width: 1180px) and (min-width: 901px) { .an-mega__grid { grid-template-columns: repeat(2, 1fr) 1fr; } .an-mega__feature { grid-column: 3; } .an-mega__all { grid-column: 1 / 3; } }
