/* Classic slot: header and navigation (owner H). Loaded on every page after the theme CSS.
 *
 * Only what the classic markup or WordPress 5.6 / WooCommerce 5.1 need on top of the design's own
 * parts/header.css, parts/navigation.css and components/header-motion.css (copied unchanged):
 * 1. the admin bar height variable WordPress 5.9+ defines and 5.6 does not;
 * 2. logos that keep their size in WooCommerce pages (finding R-3), the site-name brand when the logo
 *    attachment is missing;
 * 3. menu parents without a link (production's "#" items): a label button plus a chevron, laid out
 *    like the design's link plus chevron button; dropdown cards sized as on site-next;
 * 4. the cart page: the header cart button is hidden there, as on site-next;
 * 5. the skip link (and any other visually hidden text) shown on focus on every page (finding RA-1).
 */

/* 1. Admin bar ----------------------------------------------------------------------------------
 * The design's sticky header, skip link, sticky gallery and drawers read --wp-admin--admin-bar--height,
 * which WordPress 5.9+ sets on <html> in admin-bar.css. WordPress 5.6 does not, so for a logged-in user
 * the sticky header would slide under the admin bar. Defined while the admin bar shows, with 5.6's own
 * bump sizes (_admin_bar_bump_cb: 32px, 46px up to 782px). On <html> (where components/header-motion.css
 * resolves --revita-adminbar and the anchor scroll padding) and, for browsers without :has(), on <body>. */
body.admin-bar {
	--wp-admin--admin-bar--height: 32px;
}

html:has(> body.admin-bar) {
	--wp-admin--admin-bar--height: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--wp-admin--admin-bar--height: 46px;
	}

	html:has(> body.admin-bar) {
		--wp-admin--admin-bar--height: 46px;
	}
}

/* 2. Logos --------------------------------------------------------------------------------------
 * WooCommerce 5.1 sets ".woocommerce-page img { height: auto; max-width: 100% }" on its pages, and core's
 * site-logo CSS caps the image at its box too: in the no-wrap header rows a shrinking logo box squashed
 * the 46px logo (finding R-3). The logo boxes never shrink and the images keep their printed size. */
:is(.revita-header, .revita-checkout-header) .wp-block-site-logo {
	flex-shrink: 0;
}

:is(.revita-header, .revita-checkout-header) .wp-block-site-logo img {
	max-width: none;
}

/* Brand without a logo: when the logo attachment is missing, the site name is the brand, as parts/header.css's
 * honey wordmark, in the top bar and (template-parts/header/site-header.php) in the navigation bar. Both are
 * home links, and the purple section's link colours (Honey Cream, white on hover) would replace the
 * wordmark's honey: the link keeps the title's colour. In the desktop layout the navigation bar shows the
 * name only after the top bar has tucked away, in the bar's first column, which is narrow (about 70px at
 * 1100px wide, 110px at 1200px, 165px at 1440px): there it takes the size the design gives the site title
 * in a one-row header (large, as .revita-header--compact .revita-header__title), so "Revita.mk" fits from
 * 1200px; below that the wordmark's own ellipsis shortens it. */
.revita-header .revita-header__title a {
	color: inherit;
}

@media (min-width: 1100px) and (min-height: 501px) {
	.revita-header .revita-header__nav .revita-header__title {
		font-size: var(--wp--preset--font-size--large);
	}
}

/* The checkout header's brand group (container 85193e1b) takes its layout rule from
 * generated/block-supports.css (added there by the integrator on 2026-11-21 from site-next's checkout). */

/* 3. Menu parents without a link ----------------------------------------------------------------
 * inc/nav.php prints such a parent as core's click-to-open submenu: the label is the toggle button
 * (button.wp-block-navigation-item__content) and the chevron a span after it. The design styles the
 * label like a link and the chevron like its 24px (desktop bar) or 44px (overlay) toggle button: the
 * button loses the browser's own padding and margin, and the chevron is part of the same control
 * (assets/js/nav.js forwards its clicks to the button). */
.revita-header .wp-block-navigation-item > button.wp-block-navigation-item__content {
	margin: 0;
	padding-inline: 0;
	border-radius: 0;
	cursor: pointer;
}

.revita-header .wp-block-navigation-item > button.wp-block-navigation-item__content + span.wp-block-navigation__submenu-icon {
	box-sizing: border-box;
	cursor: pointer;
}

/* WordPress 7.1's list CSS ("ol, ul { box-sizing: border-box }") prints on site-next only on pages that
 * hold a list block; the classic core-blocks.css carries it on every page. The dropdown cards keep the
 * content-box size site-next shows on most pages (17rem plus padding and border). */
.revita-header .wp-block-navigation__submenu-container {
	box-sizing: content-box;
}

/* 4. Cart page ----------------------------------------------------------------------------------
 * site-next's mini-cart hides itself on the cart page (visibility: hidden, out of the tab order and
 * the accessibility tree); its place in the bar stays, so the bar does not shift. */
body.woocommerce-cart .revita-header .wc-block-mini-cart {
	visibility: hidden;
}

/* 5. Visually hidden text on focus --------------------------------------------------------------
 * WooCommerce 5.1's woocommerce.css (woocommerce-general, printed on every page) hides .screen-reader-text
 * with the legacy "clip: rect(1px, 1px, 1px, 1px)" (and Elementor's frontend CSS, where it loads, with
 * "clip: rect(0, 0, 0, 0)"). Core's and the design's focus rules (generated/core-blocks.css, global.css
 * section 5) reset only clip-path, so the focused skip link stayed clipped (invisible) on every page that
 * does not load WooCommerce Blocks' wc-blocks.css, i.e. every page that is not WooCommerce's (finding RA-1).
 * This is wc-blocks.css's own reset, which site-next prints on every page: focused visually hidden text
 * shows, as core intends. */
.screen-reader-text:focus {
	clip: auto !important;
}
