/* Himeros Core — brand bar (Warm Linen). Horizontal row of brand tiles above
   the catalogue; scrolls on small screens. */

.himeros-brandnav {
	position: relative;
	margin: 0 0 .6em;
}

/* The full brand band — now in normal flow at the top (no longer sticky). */
.himeros-brandbar {
	border-bottom: 1px solid #E4D9CB;
	padding: .4em 0;
	background: #FAF6F0;
}

/* Collapsed pinned trigger — hidden while the band is open. */
.himeros-brandnav__toggle {
	/* Collapsed state: a thin full-width bar with the brand-dropdown affordance centered.
	   Flush (border-radius:0) so it reads as part of the page — overrides the theme's
	   global pill `button` style (background:clay, border-radius:999px). */
	display: none;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: .5em;
	padding: .55em 1em;
	font: inherit;
	font-size: .9rem;
	letter-spacing: .04em;
	color: #2B2724;
	background: #FAF6F0;
	border: 0;
	border-bottom: 1px solid #E4D9CB;
	border-radius: 0;
	cursor: pointer;
}
/* Hover: NO background fill (override the theme's button:hover clay background) — only the
   label + chevron recolor to terracotta. */
.himeros-brandnav__toggle:hover {
	color: #B9743F;
	background: #FAF6F0;
	border-bottom-color: #E4D9CB;
}
/* Current brand's logo shown inside the collapsed trigger (brand archives). */
.himeros-brandnav__logo {
	display: block;
	height: 26px;
	width: auto;
}
.himeros-brandnav__chev { transition: transform .2s ease; }

/* Pinned states: the wrapper sticks just under the fixed header. */
.himeros-brandnav.is-collapsed,
.himeros-brandnav.is-expanded {
	position: sticky;
	top: var(--himeros-hh, 108px);
	z-index: 150;
}
.admin-bar .himeros-brandnav.is-collapsed,
.admin-bar .himeros-brandnav.is-expanded { top: calc( var(--himeros-hh, 108px) + 32px ); }
@media ( max-width: 782px ) {
	.admin-bar .himeros-brandnav.is-collapsed,
	.admin-bar .himeros-brandnav.is-expanded { top: calc( var(--himeros-hh, 108px) + 46px ); }
}

/* Collapsed: band hidden, trigger shown. */
.himeros-brandnav.is-collapsed .himeros-brandbar { display: none; }
.himeros-brandnav.is-collapsed .himeros-brandnav__toggle { display: flex; }

/* Expanded-in-place: trigger stays, full band overlays directly below it. */
.himeros-brandnav.is-expanded .himeros-brandnav__toggle { display: flex; }
.himeros-brandnav.is-expanded .himeros-brandnav__chev { transform: rotate( 180deg ); }
.himeros-brandnav.is-expanded .himeros-brandbar {
	display: block;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	padding: .6em 1em;
	background: #FAF6F0;
	border-bottom: 1px solid #E4D9CB;
	box-shadow: 0 8px 16px rgba( 43, 39, 36, .10 );
	max-height: 60vh;
	overflow-y: auto;
}

.himeros-brandbar__list {
	display: flex;
	flex-wrap: wrap;
	gap: .6em;
	margin: 0;
	padding: 0;
	list-style: none;
	align-items: stretch;
}

.himeros-brandbar__item {
	margin: 0;
}

.himeros-brandbar__item a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: .5em 1.15em;
	border: 1px solid rgba(201, 139, 107, .30);
	border-radius: 999px;
	background: transparent;
	color: #F0E9E4;
	text-decoration: none;
	transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.himeros-brandbar__item a:hover {
	border-color: #C98B6B;
	background: rgba(201, 139, 107, .10);
	color: #F0E9E4;
}

/* Wordmark-style fallback for brands that have no logo image yet — designed to
   sit naturally next to the real logos (uppercase serif, charcoal). */
.himeros-brandbar__text {
	font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
	font-size: 1.2rem;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
	line-height: 30px;
	white-space: nowrap;
	/* No explicit color: inherit from the link so the "Všetko" reset and the
	   active/hover states (cream / terracotta) keep working. */
}

.himeros-brandbar__logo {
	height: 30px;
	width: auto;
	max-width: 190px;
	object-fit: contain;
	object-position: center;
	display: block;
}

.himeros-brandbar__item.is-all a {
	background: #C98B6B;
	color: #1A1016;
	border-color: #C98B6B;
}
.himeros-brandbar__item.is-all a:hover {
	background: #E4BDB6;
	border-color: #E4BDB6;
	color: #1A1016;
}

.himeros-brandbar__item.is-active a {
	border-color: #C98B6B;
	background: rgba(201, 139, 107, .16);
	color: #F0E9E4;
}
.himeros-brandbar__item.is-active.is-all a {
	background: #C98B6B;
	border-color: #C98B6B;
	color: #1A1016;
}

/* Active brand WITH a logo: subtle copper ring on the dark pill (the cream logo
   stays readable on the transparent/dark bar). */
.himeros-brandbar__item.has-logo.is-active a {
	background: rgba(201, 139, 107, .16);
	border-color: #C98B6B;
	box-shadow: inset 0 0 0 1px #C98B6B;
}

/* Z16: brand-archive heading = the selected brand's logo (styled text fallback). */
.himeros-brandhead {
	text-align: center;
	margin: 0 0 .25em;
}
.himeros-brandhead__logo {
	height: 64px;
	width: auto;
	max-width: 300px;
	object-fit: contain;
	display: inline-block;
}
/* Storefront pads the products header heavily for a big page title; with the
   compact logo heading that left a large empty gap before the products. The
   margin-bottom needs !important — a Storefront rule of equal specificity
   loads after ours and otherwise wins (computed 2.6179em ≈ 36px gap). */
.tax-product_brand .woocommerce-products-header {
	padding-bottom: 0;
	margin-bottom: .6rem !important;
}

/* Relocated breadcrumb — on listing archives the top breadcrumb is removed (see
   Himeros_Core_Shop_Nav::maybe_relocate_breadcrumb) and re-rendered here, full-width
   just above the sort toolbar. Left-aligned (it sits in #main, not the centered
   products-header). */
.himeros-crumb {
	margin: 0 0 .6em;
}
.himeros-crumb .woocommerce-breadcrumb {
	margin: 0;
}

/* N7: category accordion — normal sidebar on desktop, collapsible on mobile. */
.himeros-cats-acc { margin: 0; }
.himeros-cats-acc > summary { display: none; }                 /* desktop: toggle hidden, JS keeps it open */
.himeros-cats-acc__sum { list-style: none; }
.himeros-cats-acc__sum::-webkit-details-marker { display: none; }
@media ( max-width: 768px ) {
	.himeros-cats-acc > summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: .5em;
		cursor: pointer;
		font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
		font-weight: 600;
		font-size: 1.05rem;
		letter-spacing: .04em;
		text-transform: uppercase;
		color: #2B2724;
		padding: .6em .85em;
		border: 1px solid #E4D9CB;
		border-radius: 10px;
		background: #FAF6F0;
	}
	.himeros-cats-acc > summary::after { content: "\25BE"; font-size: .8em; transition: transform .2s; }
	.himeros-cats-acc[open] > summary::after { transform: rotate( 180deg ); }
	.himeros-cats-acc[open] > summary { margin-bottom: .6em; }
	.himeros-cats-acc .himeros-cats__title { display: none; }   /* the summary is the heading on mobile */
}
.himeros-brandhead__title {
	font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
	font-weight: 600;
	letter-spacing: .04em;
	color: #2B2724;
	margin: 0;
}

@media ( max-width: 768px ) {
	.himeros-brandbar__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: .4em;
	}
	.himeros-brandbar__item a { white-space: nowrap; }
}

/* ---- Left category sidebar + products grid ---- */
.himeros-catalogue {
	display: grid;
	grid-template-columns: 230px 1fr;
	gap: 2.4em;
	align-items: start;
}

.himeros-cats__title {
	font-family: 'Cormorant', Georgia, serif;
	font-size: 1.5rem;
	font-weight: 500;
	color: #2B2724;
	margin: 0 0 .7em;
	padding-bottom: .5em;
	border-bottom: 1px solid #E4D9CB;
}

.himeros-cats__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.himeros-cats__item a {
	display: block;
	padding: .42em 0;
	color: #4A433C;
	text-decoration: none;
	font-size: .95rem;
	border-bottom: 1px solid #F1E9DE;
	transition: color .18s ease, padding-left .18s ease;
}
.himeros-cats__item a:hover {
	color: #B9743F;
	padding-left: .35em;
}
.himeros-cats__item.is-active a {
	color: #B9743F;
	font-weight: 600;
}
.himeros-cats__empty { color: #8A7E72; font-size: .9rem; }

/* The sidebar is part of the loop area; keep products tidy beside it. */
.himeros-catalogue__main { min-width: 0; }

/* Desktop: pin the category sidebar below the fixed header (+ the pinned brand nav
   height, exposed by JS as --himeros-navh). Inner scroll if the list is taller than
   the viewport. Needs the archive overflow-drop from Task 1 to pin to the viewport. */
@media ( min-width: 769px ) {
	.himeros-cats {
		position: sticky;
		top: calc( var(--himeros-hh, 108px) + var(--himeros-navh, 0px) + 1em );
		align-self: start;
		max-height: calc( 100vh - var(--himeros-hh, 108px) - var(--himeros-navh, 0px) - 2em );
		overflow-y: auto;
	}
	.admin-bar .himeros-cats {
		top: calc( var(--himeros-hh, 108px) + var(--himeros-navh, 0px) + 32px + 1em );
		max-height: calc( 100vh - var(--himeros-hh, 108px) - var(--himeros-navh, 0px) - 32px - 2em );
	}
}

@media ( min-width: 769px ) and ( max-width: 782px ) {
	.admin-bar .himeros-cats {
		top: calc( var(--himeros-hh, 108px) + var(--himeros-navh, 0px) + 46px + 1em );
	}
	.admin-bar .himeros-cats {
		max-height: calc( 100vh - var(--himeros-hh, 108px) - var(--himeros-navh, 0px) - 46px - 2em );
	}
}

@media ( max-width: 768px ) {
	.himeros-catalogue {
		grid-template-columns: 1fr;
		gap: 1.2em;
	}
	.himeros-cats {
		border: 1px solid #E4D9CB;
		border-radius: 10px;
		padding: 1em 1.2em;
	}
	.himeros-brandnav { display: none; }
	.himeros-cats { display: none; }            /* the sidebar accordion is replaced by the sub-nav dropdown */
}

/* ---------- "Načítať ďalšie" load-more button ---------- */
.himeros-loadmore {
	margin: 2em 0 .5em;
	text-align: center;
}
.himeros-loadmore__btn {
	display: inline-block;
	padding: .85em 2.4em;
	font-size: .95rem;
	letter-spacing: .04em;
	color: #2B2724;
	background: #fff;
	border: 1px solid #B9743F;
	border-radius: 999px;
	cursor: pointer;
	transition: background .18s ease, color .18s ease, opacity .18s ease;
}
.himeros-loadmore__btn:hover {
	background: #B9743F;
	color: #fff;
}
.himeros-loadmore__btn.is-loading {
	opacity: .6;
	cursor: default;
}
.himeros-loadmore__btn.is-loading::after {
	content: "…";
}
.himeros-loadmore__status {
	display: block;
	margin-top: .6em;
	color: #8A7E72;
	font-size: .9rem;
}

/* ---------- Sort toolbar (icon buttons, replaces the orderby dropdown) ---------- */
.himeros-sort {
	display: flex;
	flex-wrap: wrap;
	gap: .5em;
	justify-content: flex-end;
	margin: 0 0 1.2em;
	max-width: 100%;
}
/* The sort toolbar is NOT sticky (owner choice, v2): it stays at the top and scrolls away
   with the products. Only the full-width brand bar + the category sidebar pin on scroll. */
.himeros-sort__btn {
	display: inline-flex;
	align-items: center;
	gap: .45em;
	padding: .42em .9em;
	font-size: .85rem;
	line-height: 1;
	color: #4A433C;
	background: #fff;
	border: 1px solid #E4D9CB;
	border-radius: 999px;
	text-decoration: none;
	white-space: nowrap;
	transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.himeros-sort__btn:hover {
	color: #B9743F;
	border-color: #B9743F;
}
.himeros-sort__btn.is-active {
	/* Darker terracotta so white label text passes WCAG AA (4.5:1) for small text;
	   the lighter brand terracotta #B9743F was only 3.73:1. */
	color: #fff;
	background: #A05E2E;
	border-color: #A05E2E;
}
.himeros-sort__icon {
	flex-shrink: 0;
}
/* The toolbar floats right next to Storefront's result count; clear the loop. */
.himeros-catalogue__main .woocommerce-result-count {
	margin-bottom: 1.2em;
}
@media ( max-width: 600px ) {
	.himeros-sort {
		float: none;
		justify-content: flex-start;
		margin-top: .2em;
	}
	.himeros-sort__label {
		/* keep labels — they disambiguate the icons; just tighten spacing */
		font-size: .8rem;
	}
}

/* ---------- Category icons in the sidebar ---------- */
.himeros-cats__item a {
	display: flex;
	align-items: center;
	gap: .65em;
}
.himeros-cats__ico {
	flex-shrink: 0;
	color: #A99E90;
	transition: color .16s ease;
}
.himeros-cats__item a:hover .himeros-cats__ico,
.himeros-cats__item.is-active .himeros-cats__ico {
	color: #B9743F;
}
.himeros-cats__name { min-width: 0; }

/* ---------- Subcategory tree (expands along the active branch) ---------- */
.himeros-cats__sublist {
	list-style: none;
	margin: 0 0 .15em .6em;
	padding-left: 1em;
	border-left: 1px solid #EBE0D2;
}
.himeros-cats__sublist .himeros-cats__item a {
	font-size: .88rem;
	color: #6C6359;
	border-bottom-color: #F4EEE4;
	padding: .55em 0;
}
.himeros-cats__sublist .himeros-cats__ico {
	width: 17px;
	height: 17px;
}
/* The expanded parent on the active path reads as a heading for its children. */
.himeros-cats__item.is-active > a .himeros-cats__name { font-weight: 600; }

/* ---------- Mobile sticky sub-nav (two dropdowns) ---------- */
/* position:relative here so that on desktop (display:none) it is harmless; on mobile
   the @media block below overrides to position:sticky which is also a containing block
   for the absolutely-positioned panels — anchoring them correctly to the row. */
.himeros-msubnav { display: none; position: relative; }
@media ( max-width: 768px ) {
	.himeros-msubnav {
		display: flex;
		gap: .5em;
		position: sticky;
		top: var(--himeros-hh, 108px);
		z-index: 150;
		margin: 0 0 1em;
		padding: .5em 0;
		background: #16101A;
	}
	.admin-bar .himeros-msubnav { top: calc( var(--himeros-hh, 108px) + 46px ); }

	.himeros-msubnav__d { flex: 1 1 0; min-width: 0; position: static; }
	.himeros-msubnav__sum {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: .4em;
		list-style: none;
		cursor: pointer;
		padding: .55em .6em;
		font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
		font-weight: 600;
		letter-spacing: .03em;
		text-transform: uppercase;
		color: #F0E9E4;
		background: rgba(201, 139, 107, .10);
		border: 1px solid rgba(201, 139, 107, .30);
		border-radius: 10px;
	}
	.himeros-msubnav__sum::-webkit-details-marker { display: none; }
	.himeros-msubnav__chev { transition: transform .2s ease; }
	.himeros-msubnav__d[open] .himeros-msubnav__chev { transform: rotate( 180deg ); }

	/* Full-width panel under the row. */
	.himeros-msubnav__panel {
		position: absolute;
		left: 0;
		right: 0;
		margin-top: .5em;
		padding: .8em 1em;
		background: #1A1420;
		border: 1px solid rgba(201, 139, 107, .22);
		border-radius: 10px;
		box-shadow: 0 8px 16px rgba( 0, 0, 0, .35 );
		max-height: 60vh;
		overflow-y: auto;
		z-index: 151;
	}
	.himeros-msubnav__panel--brands .himeros-brandbar__list { flex-wrap: wrap; }
}

/* Honour reduced-motion: no chevron/panel animation (state still changes instantly). */
@media ( prefers-reduced-motion: reduce ) {
	.himeros-brandnav__chev,
	.himeros-msubnav__chev,
	.himeros-brandnav__toggle { transition: none; }
}

/* ---- Descriptive term content (Himeros_Core_Term_Content) ---- */

/* Brand archive: the native WooCommerce term description rendered under the logo
   (woocommerce_taxonomy_archive_description). Constrained to a readable, centered
   column to suit a short brand blurb. Part of the page header, so it scrolls away
   naturally with the logo when the shopper browses products. */
body.tax-product_brand .term-description {
	max-width: 640px;
	margin: 0 auto 1.2em;
	text-align: center;
	color: #4A433C;
	font-size: 1.02rem;
	line-height: 1.65;
}
body.tax-product_brand .term-description p { margin: 0; }

/* Category archive: longer SEO text below the product grid (full content width,
   constrained to a readable column). Separated from the products by a hairline. */
.himeros-cat-seo {
	max-width: 820px;
	margin: 2.6em auto 0;
	padding-top: 1.6em;
	border-top: 1px solid #E4D9CB;
	color: #4A433C;
	font-size: .98rem;
	line-height: 1.7;
}
.himeros-cat-seo p { margin: 0 0 .8em; }
.himeros-cat-seo p:last-child { margin-bottom: 0; }
