/* Offer bar and site header. */
/* Offer bar: one line on computers; on phones smaller and lighter, so it stays within two lines */
.cc-announcement {
	background: var(--cc-ink);
	color: var(--cc-white);
	font-size: var(--cc-size-small);
	text-align: center;
}

.cc-announcement p {
	margin: 0;
	padding-block: var(--cc-space-2);
}

.cc-announcement a {
	color: var(--cc-white);
}

.cc-announcement :focus-visible {
	outline-color: var(--cc-white);
}

@media (max-width: 719px) {
	.cc-announcement {
		font-size: var(--cc-size-label);
		line-height: 1.45;
	}

	.cc-announcement strong {
		font-weight: 600;
	}
}

/*
 * Header: three layouts, described in parts/site-header.php.
 */
.cc-header {
	border-bottom: var(--cc-line) solid var(--cc-grey-200);
	background: var(--cc-white);
}

.cc-header__bar {
	display: grid;
	grid-template-areas:
		"brand toggle tools"
		"nav nav nav"
		"search search search";
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: var(--cc-space-3);
	padding-block: var(--cc-space-3);
}

.cc-header__brand {
	grid-area: brand;
	display: flex;
	align-items: center;
	gap: var(--cc-space-2);
	min-width: 0;
	text-decoration: none;
}

.cc-header__logo {
	flex: none;
	width: 2.25rem;
	height: 2.25rem;
	object-fit: contain;
}

.cc-header__name {
	overflow: hidden;
	font-family: var(--cc-font-heading);
	font-size: var(--cc-size-small);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.cc-icon {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
}

/* .cc-header in front: components.css (loaded later) gives every .cc-button a wide padding */
.cc-header .cc-header__toggle {
	grid-area: toggle;
	gap: var(--cc-space-2);
	min-height: var(--cc-control-height);
	padding-inline: var(--cc-space-3);
}

.cc-header__toggle[aria-expanded="true"] {
	background: var(--cc-ink);
	color: var(--cc-white);
}

/* Three lines while the menu is folded, a cross while it is open */
.cc-header__toggle[aria-expanded="true"] .cc-icon__open,
.cc-header__toggle:not([aria-expanded="true"]) .cc-icon__close {
	display: none;
}

.cc-header__nav {
	grid-area: nav;
}

.cc-js .cc-header__toggle[aria-expanded="false"] ~ .cc-header__nav {
	display: none;
}

/* The button needs assets/js/menu.js; without JavaScript it stays out and the menu stays open */
html:not(.cc-js) .cc-header .cc-header__toggle {
	display: none;
}

.cc-header__search {
	grid-area: search;
}

.cc-menu,
.cc-header__tools {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cc-menu a {
	display: block;
	padding-block: var(--cc-space-3);
	border-bottom: var(--cc-line) solid var(--cc-grey-200);
	font-family: var(--cc-font-heading);
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.cc-menu a:hover,
.cc-menu .current-menu-item > a {
	text-decoration: underline;
	text-decoration-thickness: var(--cc-line);
	text-underline-offset: 0.4em;
}

.cc-header__tools {
	grid-area: tools;
	display: flex;
	align-items: center;
	gap: var(--cc-space-4);
	font-family: var(--cc-font-heading);
	font-size: var(--cc-size-small);
	font-weight: 500;
	white-space: nowrap;
}

.cc-header__tools > li {
	display: flex;
	align-items: center;
}

.cc-header__tools a {
	display: inline-flex;
	align-items: center;
	min-height: var(--cc-control-height);
	text-decoration: none;
}

.cc-header__tools a:hover {
	text-decoration: underline;
}

.cc-header__cart,
.cc-header__favourites {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--cc-space-1);
	min-width: var(--cc-control-height);
	min-height: var(--cc-control-height);
}

.cc-header__tools .cc-header__account {
	display: none;
}

/*
 * Phones: the whole name always fits. Under 520px the buttons show their icons only, closer together; under 480px the
 * name is a little smaller; under 390px the Favourites heart leaves the bar (it stays in the folding menu, by
 * Account), as name, Menu, heart and Cart do not fit side by side there.
 */
@media (max-width: 519px) {
	.cc-header__tools {
		gap: var(--cc-space-2);
	}

	.cc-header .cc-header__toggle {
		width: var(--cc-control-height);
		padding: 0;
	}

	.cc-header__word {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}
}

@media (max-width: 479px) {
	.cc-header__bar {
		gap: var(--cc-space-2);
	}

	.cc-header__logo {
		width: 2rem;
		height: 2rem;
	}

	.cc-header__name {
		font-size: 0.8125rem;
		letter-spacing: 0.03em;
	}
}

@media (max-width: 389px) {
	.cc-header__tools .cc-header__favourites-item {
		display: none;
	}
}

/* Tablets and small laptops: search beside the name, the menu on its own line */
@media (min-width: 768px) {
	.cc-header__bar {
		grid-template-areas:
			"brand search tools"
			"nav nav nav";
		grid-template-columns: auto minmax(12rem, 1fr) auto;
		gap: var(--cc-space-2) var(--cc-space-5);
	}

	.cc-header__logo {
		width: 2.75rem;
		height: 2.75rem;
	}

	.cc-header .cc-header__toggle,
	.cc-header .cc-menu--phone {
		display: none;
	}

	.cc-header__nav,
	.cc-js .cc-header__toggle[aria-expanded="false"] ~ .cc-header__nav {
		display: block;
	}

	.cc-menu {
		display: flex;
		flex-wrap: wrap;
		gap: 0 var(--cc-space-5);
	}

	.cc-menu a {
		padding-block: var(--cc-space-2);
		border-bottom: 0;
		font-size: var(--cc-size-card);
	}

	.cc-header__tools .cc-header__account {
		display: flex;
	}
}

/*
 * Computers at the full page width (1200px plus the 24px gutters): everything on one line. The menu's column never
 * gets narrower than the menu and the search box gives way down to 12rem; five items of today's length, with Account,
 * Favourites and Cart, fit with about 30px to spare. With six or more the menu keeps its own line at every width, and
 * so do browsers without :has(), so the menu never runs under the search box.
 */
@media (min-width: 1248px) {
	.cc-header__bar:not(:has(.cc-menu > li:nth-child(6))) {
		grid-template-areas: "brand nav search tools";
		grid-template-columns: max-content minmax(max-content, 1fr) minmax(12rem, 20rem) max-content;
		gap: var(--cc-space-5);
		min-height: 5rem;
	}

	.cc-header__logo {
		width: 3rem;
		height: 3rem;
	}

	.cc-header__name {
		font-size: var(--cc-size-body);
		letter-spacing: 0.08em;
	}
}
