/* ============================================================
   Collibre — HEADER
   Wygląd nagłówka (poziom Astry). Bloki/builder trzymamy chude,
   cały wygląd tutaj. Źródło: mockup Strona-glowna.html (sekcje 1–2).
   ============================================================ */

/* ---------- 1. PASEK GÓRNY (ticker) ---------- */
/* Render: inc/pasek-gorny.php (hook astra_header_before). Animacja: assets/js/ticker.js. */

.tech-topbar {
	background: var(--tech-ink);
	color: var(--tech-white);
	font-size: var(--tech-fs-xs);
}

.tech-topbar__inner {
	max-width: var(--tech-container);
	margin-inline: auto;
	min-height: 2.25rem;            /* h-9 */
	display: flex;
	align-items: center;
	justify-content: center;
	padding-inline: var(--tech-gutter);
}

@media (min-width: 640px) {
	.tech-topbar {
		font-size: var(--tech-fs-sm);
	}
	.tech-topbar__inner {
		padding-inline: var(--tech-gutter-sm);
	}
}

/* Rotator: wszystkie komunikaty w jednej komórce gridu, widoczny tylko .is-active */
.tech-topbar__track {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	width: 100%;
}

.tech-topbar__item {
	grid-area: 1 / 1;               /* stos w jednej komórce */
	text-align: center;
	font-weight: var(--tech-fw-medium);
	letter-spacing: 0.03em;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.tech-topbar__item.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* ---------- 2. NAVBAR (primary header Astry) ---------- */
/* Builder trzymamy chude (logo + Menu główne + Konto/Szukaj/Koszyk); wygląd tutaj.
   Selektory z realnego markupu Astry (#ast-desktop-header .ast-primary-header-bar). */

/* Sticky navbar — cały #masthead przykleja się do góry przy scrollu.
   (Pasek górny jest osobnym elementem PRZED #masthead => zostaje nie-sticky i odjeżdża.) */
#masthead {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 99;
}

#ast-desktop-header .ast-primary-header-bar {
	background: rgba(255, 255, 255, 0.95);   /* mockup: bg-white/95 */
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);               /* mockup: backdrop-blur */
	border-bottom: 1px solid var(--tech-border);
}

/* Szerokość kontenera jak w mockupie (max-w-7xl = 1280px) */
#ast-desktop-header .ast-primary-header-bar .site-primary-header-wrap.ast-container {
	max-width: var(--tech-container);
}

/* Wysokość paska ~80px (h-20), pion wyśrodkowany */
#ast-desktop-header .ast-primary-header-bar .ast-builder-grid-row {
	min-height: 5rem;
	align-items: center;
}

/* Logo — zmniejsz z natywnego 400×80 do ~40px wys. */
#ast-desktop-header .ast-site-identity .custom-logo {
	height: 40px !important;
	width: auto !important;
	max-width: none !important;
}

/* Menu — 15px, medium, slate -> ink na hover, bez podkreślenia */
#ast-desktop-header .ast-primary-header-bar .main-header-menu > .menu-item > .menu-link {
	font-size: 15px;
	font-weight: var(--tech-fw-medium);
	color: var(--tech-slate);
	padding-inline: 1rem;
	text-decoration: none;
	transition: color 0.2s ease;
}

#ast-desktop-header .ast-primary-header-bar .main-header-menu > .menu-item > .menu-link:hover,
#ast-desktop-header .ast-primary-header-bar .main-header-menu > .menu-item.current-menu-item > .menu-link {
	color: var(--tech-ink);
}

/* Wyróżniona pozycja menu — „Jaki kolagen wybrać?" (mockup: semibold, ink) */
#ast-desktop-header .ast-primary-header-bar .main-header-menu > .menu-item.tech-nav-highlight > .menu-link {
	font-weight: var(--tech-fw-semibold);
	color: var(--tech-ink);
}

#ast-desktop-header .ast-primary-header-bar .main-header-menu > .menu-item.tech-nav-highlight > .menu-link:hover {
	opacity: 0.7;
}

/* Ikony Konto / Szukaj / Koszyk — kolor ink, hover lekkie wygaszenie */
#ast-desktop-header .ast-header-account-link,
#ast-desktop-header .ast-header-search .astra-search-icon,
#ast-desktop-header .ast-site-header-cart .cart-container {
	color: var(--tech-ink) !important;
	transition: opacity 0.2s ease;
}

#ast-desktop-header .ast-header-account-link:hover,
#ast-desktop-header .ast-header-search .astra-search-icon:hover,
#ast-desktop-header .ast-site-header-cart .cart-container:hover {
	opacity: 0.6;
}

#ast-desktop-header .ast-header-account svg,
#ast-desktop-header .ast-header-search .ast-icon svg,
#ast-desktop-header .ast-site-header-cart svg {
	fill: currentColor;
}

/* Ikona torby — Astra koloruje ją przez color na .ast-addon-cart-wrap (var(--ast-global-color-0)).
   Nadpisujemy bezpośrednio na tym elemencie, bo to wyższa specyficzność niż .cart-container. */
#ast-desktop-header .ast-site-header-cart .ast-addon-cart-wrap,
.ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap {
	color: var(--tech-ink) !important;
}

/* Wyrównanie ikon Konto / Szukaj / Koszyk: jedna linia, pion na środku, równy rozmiar.
   Bezpośrednie dzieci prawej sekcji wyrównujemy do środka i zerujemy ich własne marginesy. */
#ast-desktop-header .site-header-primary-section-right {
	display: flex;
	align-items: center;
	gap: 0.625rem;        /* ciasny odstęp wg wzorca (~10px) */
}
/* Pusty kontener środkowy „zjadał" dodatkowy gap — chowamy go */
#ast-desktop-header .site-header-primary-section-right > .site-header-primary-section-right-center:empty {
	display: none !important;
}
/* Zeruj własne marginesy/paddingi Astry na elementach nagłówka (źródło dużych odstępów) */
#ast-desktop-header .site-header-primary-section-right > .ast-builder-layout-element {
	display: flex !important;
	align-items: center !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Każdy kontener ikony: inline-flex wyśrodkowany, bez line-height psującego baseline */
#ast-desktop-header .ast-header-account-wrap,
#ast-desktop-header .ast-header-account-link,
#ast-desktop-header .ast-header-search .ast-search-menu-icon,
#ast-desktop-header .ast-header-search .astra-search-icon,
#ast-desktop-header .ast-site-header-cart-li,
#ast-desktop-header .ast-site-header-cart .cart-container,
#ast-desktop-header .ast-site-header-cart .ast-addon-cart-wrap,
#ast-desktop-header .ast-site-header-cart .astra-icon {
	display: inline-flex !important;
	align-items: center !important;
	line-height: 1 !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ---- Podmiana ikon na własne liniowe SVG (1:1 z mockupem): Szukaj · Konto · Koszyk ----
   Astra ma ikony wypełnione; my hidujemy je i wstawiamy thin-line SVG jako maskę
   wypełnioną kolorem ink. Trzy identyczne pola 22px => równy pion z automatu. */

/* Kolejność wg mockupu (flex order, bez ruszania Header Buildera) */
#ast-desktop-header .site-header-primary-section-right > .ast-header-search  { order: 1; }
#ast-desktop-header .site-header-primary-section-right > .ast-header-account { order: 2; }
#ast-desktop-header .site-header-primary-section-right > .ast-header-woo-cart { order: 3; }

/* Ukryj natywne SVG Astry */
#ast-desktop-header .ast-header-account .ahfb-svg-iconset svg,
#ast-desktop-header .ast-header-search .astra-search-icon .ast-icon.icon-search svg,
#ast-desktop-header .ast-site-header-cart .ast-icon.icon-bag svg {
	display: none !important;
}

/* Wspólny styl podmienionej ikony (maska + kolor ink) */
#ast-desktop-header .ast-header-account .ahfb-svg-iconset::before,
#ast-desktop-header .ast-header-search .astra-search-icon::before,
#ast-desktop-header .ast-site-header-cart .ast-icon.icon-bag::before {
	content: "";
	display: inline-block;
	width: 22px;
	height: 22px;
	background-color: var(--tech-ink);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

/* Szukaj — lupa */
#ast-desktop-header .ast-header-search .astra-search-icon::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3-3'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3-3'/%3E%3C/svg%3E");
}

/* Konto — sylwetka (outline) */
#ast-desktop-header .ast-header-account .ahfb-svg-iconset::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
}

/* Fallback: przeglądarki bez mask-image — pokaż natywne ikony Astry, ukryj ::before
   (kolor i tak ink dzięki globalnemu tokenowi). */
@supports not ((-webkit-mask-image: url("#")) or (mask-image: url("#"))) {
	#ast-desktop-header .ast-header-account .ahfb-svg-iconset svg,
	#ast-desktop-header .ast-header-search .astra-search-icon .ast-icon.icon-search svg,
	#ast-desktop-header .ast-site-header-cart .ast-icon.icon-bag svg {
		display: inline-block !important;
	}
	#ast-desktop-header .ast-header-account .ahfb-svg-iconset::before,
	#ast-desktop-header .ast-header-search .astra-search-icon::before,
	#ast-desktop-header .ast-site-header-cart .ast-icon.icon-bag::before {
		display: none !important;
	}
}

/* Koszyk — wózek (outline, z kółkami) */
#ast-desktop-header .ast-site-header-cart .ast-icon.icon-bag::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 6h15l-1.5 9h-12z'/%3E%3Cpath d='M6 6 5 3H3'/%3E%3Ccircle cx='9' cy='20' r='1.4' fill='black'/%3E%3Ccircle cx='18' cy='20' r='1.4' fill='black'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 6h15l-1.5 9h-12z'/%3E%3Cpath d='M6 6 5 3H3'/%3E%3Ccircle cx='9' cy='20' r='1.4' fill='black'/%3E%3Ccircle cx='18' cy='20' r='1.4' fill='black'/%3E%3C/svg%3E");
}

/* Koszyk — zdejmij niebieską ramkę outline (mockup: czysta ikona torby).
   Ramkę "outline" Astra wiesza na .ast-addon-cart-wrap; czyścimy wszystkie warianty. */
.ast-site-header-cart.ast-menu-cart-outline .ast-addon-cart-wrap,
.ast-site-header-cart.ast-menu-cart-with-border .ast-addon-cart-wrap,
#ast-desktop-header .ast-site-header-cart .cart-container,
#ast-desktop-header .ast-site-header-cart .astra-icon {
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
}

/* Licznik koszyka — mały, okrągły, ink (jak mockup). Astra renderuje liczbę
   różnie zależnie od stylu — pokrywamy oba warianty (.count oraz ::after z data-cart-total). */
#ast-desktop-header .ast-site-header-cart .astra-icon {
	position: relative;
}
#ast-desktop-header .ast-site-header-cart .count,
#ast-desktop-header .ast-site-header-cart .astra-icon::after {
	position: absolute;
	top: -7px;
	right: -9px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	box-sizing: border-box;
	font-size: 10px;
	font-weight: var(--tech-fw-bold);
	line-height: 16px;
	text-align: center;
	border-radius: var(--tech-radius-pill) !important;
	background-color: var(--tech-ink) !important;
	color: var(--tech-white) !important;
	border-color: var(--tech-ink) !important;
}

/* Mini-koszyk (rozwijany) — kolorystyka marki zamiast niebieskiego Woo/Astra.
   Łapiemy WSZYSTKIE przyciski w panelu (też „Kontynuuj zakupy" w pustym koszyku). */
.ast-site-header-cart-data .button,
.ast-site-header-cart-data a.button,
.ast-site-header-cart-data .wp-element-button {
	border-radius: var(--tech-radius-pill) !important;
	font-weight: var(--tech-fw-semibold) !important;
	border: 1px solid var(--tech-ink) !important;
	background: var(--tech-ink) !important;
	color: var(--tech-white) !important;
	box-shadow: none !important;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
}
.ast-site-header-cart-data .button:hover,
.ast-site-header-cart-data a.button:hover,
.ast-site-header-cart-data .wp-element-button:hover {
	background: var(--tech-ink-hover) !important;
	border-color: var(--tech-ink-hover) !important;
	color: var(--tech-white) !important;
}

/* „Zobacz koszyk" (wc-forward bez .checkout) = wariant outline */
.ast-site-header-cart-data .button.wc-forward:not(.checkout) {
	background: transparent !important;
	color: var(--tech-ink) !important;
}
.ast-site-header-cart-data .button.wc-forward:not(.checkout):hover {
	background: var(--tech-ink) !important;
	color: var(--tech-white) !important;
}

/* Komunikat pustego koszyka */
.ast-site-header-cart-data .woocommerce-mini-cart__empty-message {
	text-align: center;
	color: var(--tech-slate);
}

/* Krzyżyk usuwania produktu — niewidoczny w domyślnym stylu; robimy ink i wyraźny */
.ast-site-header-cart-data a.remove,
.ast-site-header-cart-data .woocommerce-mini-cart__remove {
	color: var(--tech-ink) !important;
	opacity: 1 !important;
	border: 1px solid var(--tech-border) !important;
	background: var(--tech-white) !important;
}
.ast-site-header-cart-data a.remove:hover,
.ast-site-header-cart-data .woocommerce-mini-cart__remove:hover {
	color: var(--tech-white) !important;
	background: var(--tech-ink) !important;
	border-color: var(--tech-ink) !important;
}

/* ---------- 3. NAGŁÓWEK MOBILNY (#ast-mobile-header) ---------- */
/* Builder mobilny: logo (lewo) + hamburger (prawo). Sticky obejmuje go przez #masthead. */

#ast-mobile-header .ast-primary-header-bar {
	background: var(--tech-white);
	border-bottom: 1px solid var(--tech-border);
}
#ast-mobile-header .ast-builder-grid-row {
	min-height: 4rem;
	align-items: center;
}

/* Logo — zmniejsz natywne 400×80 do ~34px wys. */
#ast-mobile-header .ast-site-identity .custom-logo {
	height: 34px !important;
	width: auto !important;
	max-width: none !important;
}

/* Hamburger — ink, równy rozmiar */
#ast-mobile-header .ast-mobile-menu-trigger-minimal,
#ast-mobile-header .mobile-menu-toggle-icon {
	color: var(--tech-ink) !important;
}
#ast-mobile-header .ast-mobile-svg {
	width: 24px !important;
	height: 24px !important;
	fill: var(--tech-ink) !important;
}

/* Menu mobilne (dropdown) — typografia i kolory jak desktop, bez podkreśleń */
#ast-mobile-header .main-header-menu .menu-link,
.ast-mobile-popup-drawer .main-header-menu .menu-link {
	color: var(--tech-slate) !important;
	font-weight: var(--tech-fw-medium);
	text-decoration: none !important;
}
#ast-mobile-header .main-header-menu .menu-item.current-menu-item > .menu-link,
#ast-mobile-header .main-header-menu .menu-link:hover,
.ast-mobile-popup-drawer .main-header-menu .menu-link:hover {
	color: var(--tech-ink) !important;
}

/* ---------- 3b. KOSZYK W NAGŁÓWKU MOBILNYM (feedback testerów 2026-09-11) ----------
   Tester: „nie widzę ikony koszyka na froncie, jest dopiero w hamburgerze".
   Element „Koszyk" dodaje się w Wygląd → Dostosuj → Nagłówek → Nagłówek mobilny
   (natywna Astra; drawer #astra-mobile-cart-drawer już działa). Tu tylko wygląd —
   ta sama technika co na desktopie: natywne SVG Astry ukryte, w zamian maska
   thin-line w kolorze ink + mały okrągły licznik.
   Reguły są no-opem, dopóki element nie zostanie dodany w Customizerze. */

/* Ikona + licznik wyrównane w pasku, bez marginesów Astry */
#ast-mobile-header .ast-header-woo-cart,
#ast-mobile-header .ast-site-header-cart-li,
#ast-mobile-header .ast-site-header-cart .cart-container,
#ast-mobile-header .ast-site-header-cart .ast-addon-cart-wrap,
#ast-mobile-header .ast-site-header-cart .astra-icon {
	display: inline-flex !important;
	align-items: center !important;
	line-height: 1 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	box-shadow: none !important;
	color: var(--tech-ink) !important;
}

/* Odstęp między koszykiem a hamburgerem */
#ast-mobile-header .site-header-primary-section-right {
	display: flex;
	align-items: center;
	gap: 0.875rem;
}

/* Podmiana ikony na wózek (identyczna maska jak w desktopie) */
#ast-mobile-header .ast-site-header-cart .ast-icon.icon-bag svg {
	display: none !important;
}
#ast-mobile-header .ast-site-header-cart .ast-icon.icon-bag::before {
	content: "";
	display: inline-block;
	width: 24px;
	height: 24px;
	background-color: var(--tech-ink);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 6h15l-1.5 9h-12z'/%3E%3Cpath d='M6 6 5 3H3'/%3E%3Ccircle cx='9' cy='20' r='1.4' fill='black'/%3E%3Ccircle cx='18' cy='20' r='1.4' fill='black'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 6h15l-1.5 9h-12z'/%3E%3Cpath d='M6 6 5 3H3'/%3E%3Ccircle cx='9' cy='20' r='1.4' fill='black'/%3E%3Ccircle cx='18' cy='20' r='1.4' fill='black'/%3E%3C/svg%3E");
}

/* Fallback bez mask-image — pokaż natywną ikonę Astry (kolor i tak ink) */
@supports not ((-webkit-mask-image: url("#")) or (mask-image: url("#"))) {
	#ast-mobile-header .ast-site-header-cart .ast-icon.icon-bag svg {
		display: inline-block !important;
	}
	#ast-mobile-header .ast-site-header-cart .ast-icon.icon-bag::before {
		display: none !important;
	}
}

/* Licznik sztuk — mały okrągły badge ink (jak desktop) */
#ast-mobile-header .ast-site-header-cart .astra-icon {
	position: relative;
}
#ast-mobile-header .ast-site-header-cart .count,
#ast-mobile-header .ast-site-header-cart .astra-icon::after {
	position: absolute;
	top: -7px;
	right: -9px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	box-sizing: border-box;
	font-size: 10px;
	font-weight: var(--tech-fw-bold);
	line-height: 16px;
	text-align: center;
	border-radius: var(--tech-radius-pill) !important;
	background-color: var(--tech-ink) !important;
	color: var(--tech-white) !important;
	border-color: var(--tech-ink) !important;
}

/* Pole dotyku ≥44 px (WCAG 2.5.8) bez powiększania samej ikony */
#ast-mobile-header .ast-site-header-cart .cart-container {
	min-width: 44px;
	min-height: 44px;
	justify-content: center;
}

/* Drawer koszyka (mobilny) — przyciski w kolorystyce marki, jak mini-koszyk desktopowy */
.astra-cart-drawer .button,
.astra-cart-drawer a.button,
.astra-cart-drawer .wp-element-button {
	border-radius: var(--tech-radius-pill) !important;
	font-weight: var(--tech-fw-semibold) !important;
	border: 1px solid var(--tech-ink) !important;
	background: var(--tech-ink) !important;
	color: var(--tech-white) !important;
}
.astra-cart-drawer .astra-cart-drawer-title {
	color: var(--tech-ink);
	font-weight: var(--tech-fw-bold);
}
