/* Nagłówek i menu. Stary motyw ustawia "* { color }", "a:hover { color !important }" i "img { width: 100% }",
   stąd jawne dziedziczenie kolorów i !important przy odnośnikach. */
:root {
	--tpi-ink: #14181c;
	--tpi-ink-2: #4d565f;
	--tpi-line: #d9dee2;
	--tpi-fog: #f1f3f5;
	--tpi-night: #0d1114;
	--tpi-orange: #f47a20;
	--tpi-orange-dark: #b84f00;
	--tpi-pad: clamp(18px, 4vw, 64px);
	--tpi-list: #eaedf0;
	--tpi-r: 20px;
	--tpi-r-btn: 12px;
	--tpi-r-in: 10px;
}
@media (max-width: 640px) { :root { --tpi-r: 16px; --tpi-r-btn: 10px; } }

.tpi-wrap { max-width: 1440px; margin: 0 auto; padding-inline: var(--tpi-pad); position: relative; }

.tpi-skip { position: absolute; left: -9999px; top: 0; z-index: 1001; background: #fff; padding: 12px 20px; }
.tpi-skip:focus { left: 0; }

.tpi-header { position: fixed; inset: 0 0 auto; z-index: 999; background: #fff; color: var(--tpi-ink); font-size: 16px; line-height: 1.55; border-bottom: 1px solid var(--tpi-line); transition: background .25s, color .25s, box-shadow .25s; }
.tpi-header *, .tpi-header *::before { color: inherit; box-sizing: border-box; }
.tpi-header ul { list-style: none; margin: 0; padding: 0; }
.tpi-header a, .tpi-header a:hover { text-decoration: none !important; }
.tpi-header a:hover { color: var(--tpi-orange-dark) !important; }
.tpi-header button { background: none; border: 0; padding: 0; min-height: 0; cursor: pointer; box-shadow: none; }
.tpi-header :focus-visible { outline: 3px solid var(--tpi-orange); outline-offset: 2px; }
.admin-bar .tpi-header { top: 32px; }

/* Górny pasek */
.tpi-top { background: var(--tpi-fog); font-size: 14px; font-weight: 600; }
.tpi-top > .tpi-wrap { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
.tpi-top__list { display: flex; gap: 28px; align-items: center; }
.tpi-top .is-tel a::before { content: "\f095"; font: 900 13px "Font Awesome 6 Free"; margin-right: 8px; }

/* Logo, wyszukiwarka, ikony */
.tpi-mid { display: grid; grid-template-columns: auto minmax(220px, 520px) auto; justify-content: space-between; align-items: center; gap: 32px; padding-block: 12px; }
.tpi-logo img { width: auto; height: 66px; max-width: none; transition: height .2s; }
.tpi-logo .is-light { display: none; }
.tpi-icons { display: flex; gap: 10px; align-items: center; }
.tpi-icon { position: relative; }
.tpi-icon > a { position: relative; width: 46px; height: 46px; display: grid; place-items: center; font-size: 22px; }
.tpi-header .cart_counter { position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--tpi-orange); color: #14181c; font: 700 12px/19px proxima-nova, Arial, sans-serif; text-align: center; }
.tpi-burger { display: none; width: 46px; height: 46px; place-items: center; }
.tpi-burger svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tpi-burger .is-x { display: none; }

/* Podgląd koszyka */
.tpi-minicart { position: absolute; top: 100%; right: 0; width: 340px; max-height: 70vh; overflow: auto; background: #fff; color: var(--tpi-ink); padding: 20px; box-shadow: 0 18px 44px rgba(0, 0, 0, .25); border-top: 3px solid var(--tpi-orange); visibility: hidden; opacity: 0; transition: opacity .15s .1s, visibility .15s .1s; z-index: 4; }
.tpi-minicart img { width: 56px; height: 56px; object-fit: contain; float: right; margin-left: 12px; }
.tpi-minicart li { padding: 10px 0; border-bottom: 1px solid var(--tpi-line); overflow: hidden; }
.tpi-minicart p { margin: 12px 0 0; }
.tpi-minicart .buttons { display: flex; gap: 10px; }
.tpi-minicart .buttons a { flex: 1; text-align: center; padding: 10px; font-weight: 700; border: 2px solid var(--tpi-ink) !important; border-radius: var(--tpi-r-btn); background: #fff !important; color: var(--tpi-ink) !important; }
.tpi-minicart .buttons a.checkout { background: var(--tpi-orange) !important; border-color: var(--tpi-orange) !important; }

/* Wyszukiwarka FiboSearch */
.tpi-search .dgwt-wcas-search-wrapp { width: 100%; max-width: none; min-width: 0; margin: 0; }
.tpi-search .dgwt-wcas-search-wrapp form { margin: 0; }
.tpi-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp { background: transparent !important; padding: 0 !important; border: 0 !important; }
.tpi-search .dgwt-wcas-search-wrapp input.dgwt-wcas-search-input { height: 46px !important; min-height: 46px; border: 1px solid #c3cad0 !important; border-radius: var(--tpi-r-in) !important; background: var(--tpi-fog) !important; box-shadow: none !important; color: var(--tpi-ink) !important; font-size: 16px !important; padding: 0 46px 0 16px !important; }
.tpi-search .dgwt-wcas-search-wrapp input.dgwt-wcas-search-input::placeholder { color: var(--tpi-ink-2) !important; opacity: 1; font-style: normal; }
.tpi-search .dgwt-wcas-ico-magnifier, .tpi-search .dgwt-wcas-search-submit { left: auto !important; right: 14px !important; }
.tpi-search .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit { position: absolute !important; top: 50% !important; transform: translateY(-50%) !important; width: 24px !important; height: 24px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: none !important; }
.tpi-search .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit svg { position: absolute !important; inset: 3px !important; width: 18px !important; height: 18px !important; margin: 0 !important; transform: none !important; }
.tpi-search .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit svg path { fill: var(--tpi-ink) !important; }
.tpi-search form.woocommerce-product-search { display: flex; gap: 8px; margin: 0; }
.tpi-search .search-field { flex: 1; min-width: 0; height: 46px; background: var(--tpi-fog); padding: 0 16px; }

/* Menu główne */
.tpi-nav { position: relative; padding-top: 8px; font-weight: 600; font-size: 15.5px; }
.tpi-menu { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 14px; }
.tpi-menu > li { display: flex; align-items: center; padding-bottom: 12px; }
.tpi-menu > li > a { padding-block: 6px; }
.tpi-menu > li:hover > a, .tpi-menu > li.is-open > a, .tpi-header a[aria-current] { color: var(--tpi-orange-dark); }
.tpi-header .tpi-menu > li.is-hot > a { background: var(--tpi-orange); color: #14181c !important; padding: 3px 10px; border-radius: var(--tpi-r-in); }
.tpi-header .tpi-tg { width: 22px; height: 30px; display: grid; place-items: center; }
.tpi-tg svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; transition: transform .2s; }
.is-open > .tpi-tg svg { transform: rotate(180deg); }

@media (min-width: 1025px) {
	.tpi-menu > li.is-mobile { display: none; }
	.tpi-panel { position: absolute; top: 100%; left: 0; right: 0; background: #fff; color: var(--tpi-ink); border-top: 3px solid var(--tpi-orange); box-shadow: 0 24px 50px rgba(0, 0, 0, .3); padding: 30px 34px 34px; max-height: calc(100vh - 210px); overflow: auto; visibility: hidden; opacity: 0; transition: opacity .15s .1s, visibility .15s .1s; }
	.tpi-has:hover > .tpi-panel, .tpi-has.is-open > .tpi-panel { visibility: visible; opacity: 1; z-index: 3; }
	.tpi-menu:hover > .tpi-has.is-open:not(:hover) > .tpi-panel { visibility: hidden; opacity: 0; }
	.tpi-icon.is-cart:hover .tpi-minicart, .tpi-icon.is-cart:focus-within .tpi-minicart { visibility: visible; opacity: 1; }
	.tpi-l2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 32px; }
	.tpi-l2 a { display: block; padding: 6px 0; font-weight: 400; }
	.tpi-l2.is-deep { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 1fr; gap: 32px; }
	.tpi-l2.is-deep > li > a { font-weight: 700; font-size: 17px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--tpi-line); }
	.tpi-l2.is-deep > li.is-wide { min-width: 300px; }
	.is-wide > .tpi-l3 { columns: 2; column-gap: 24px; }
	.tpi-header .tpi-l2 .tpi-tg { display: none; }

	/* Przewinięta strona */
	.tpi-header.is-stuck .tpi-top { display: none; }
	.tpi-header.is-stuck .tpi-logo img { height: 60px; }
}
.tpi-header.is-stuck { box-shadow: 0 4px 22px rgba(0, 0, 0, .14); }

/* Strona główna: przezroczysty, dopóki strona nie jest przewinięta */
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) { background: linear-gradient(180deg, rgba(8, 11, 14, .6), rgba(8, 11, 14, 0)); color: #fff; border-bottom: 0; padding-bottom: 1px; }
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-top { background: transparent; }
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-logo .is-light { display: block; }
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-logo .is-dark { display: none; }
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-top a:hover, .tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-icon > a:hover, .tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-menu > li:not(.is-hot) > a:hover { color: #ffb27a !important; }
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-menu > li:hover > a, .tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-menu > li.is-open > a { color: #ffb27a; }
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-search input.dgwt-wcas-search-input { background: rgba(255, 255, 255, .16) !important; border-color: rgba(255, 255, 255, .5) !important; color: #fff !important; }
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-search input.dgwt-wcas-search-input::placeholder { color: #fff !important; }
.tpi-header.is-overlay:not(.is-stuck):not(.is-menu) .tpi-search .dgwt-wcas-search-submit svg path { fill: #fff !important; }

@media (min-width: 1025px) and (max-width: 1420px) {
	.tpi-nav { font-size: 14px; }
	.tpi-menu { gap: 0 8px; }
	.tpi-header .tpi-tg { width: 17px; }
	.tpi-tg svg { width: 11px; height: 11px; }
	.tpi-panel { font-size: 15px; }
}
@media (min-width: 1025px) and (max-width: 1250px) {
	.tpi-menu > li.is-in-top { display: none; }
	.tpi-nav { font-size: 13.5px; }
	.tpi-l2.is-deep { gap: 20px; }
	.tpi-l2.is-deep > li.is-wide { min-width: 230px; }
	.tpi-panel { padding-inline: 22px; }
}

@media (max-width: 1024px) {
	.tpi-top, .tpi-nav { display: none; }
	.tpi-mid { grid-template-columns: auto auto; gap: 10px; }
	.tpi-mid { padding-block: 10px; }
	.tpi-logo img { height: 40px; }
	.tpi-search { grid-column: 1 / -1; order: 3; min-width: 0; }
	.tpi-search .dgwt-wcas-search-wrapp input.dgwt-wcas-search-input { height: 44px !important; min-height: 44px; }
	.tpi-icons { gap: 0; }
	.tpi-icon:not(.is-cart), .tpi-minicart { display: none; }
	.tpi-burger { display: grid; }
	.tpi-header.is-menu { bottom: 0; overflow: auto; }
	.tpi-header.is-menu .tpi-nav { display: block; font-size: 19px; padding-bottom: 40px; }
	.is-menu .tpi-burger .is-bars { display: none; }
	.is-menu .tpi-burger .is-x { display: block; }
	.tpi-menu { display: block; }
	.tpi-menu > li, .tpi-l2 > li { display: grid; grid-template-columns: 1fr 48px; padding: 0; border-bottom: 1px solid var(--tpi-line); }
	.tpi-menu > li > a, .tpi-l2 > li > a { padding: 12px 0; }
	.tpi-menu > li.is-dup { display: none; }
	.tpi-menu > li.is-icon { display: inline-grid; grid-template-columns: 48px; border: 0; margin-top: 12px; }
	.tpi-menu > li.is-icon > a { position: relative; display: grid; place-items: center; height: 48px; padding: 0; font-size: 22px; }
	.tpi-header .tpi-menu > li.is-hot > a { justify-self: start; padding: 6px 12px; margin: 10px 0; }
	.tpi-header .tpi-tg { width: 48px; height: 100%; min-height: 48px; }
	.tpi-tg svg { width: 18px; height: 18px; }
	.tpi-panel, .tpi-l2 .tpi-l3 { display: none; grid-column: 1 / -1; }
	.tpi-has.is-open > .tpi-panel, .tpi-has3.is-open > .tpi-l3 { display: block; }
	.tpi-panel { padding: 0 0 10px 16px; font-size: 17px; font-weight: 400; }
	.tpi-l2 > li:last-child { border-bottom: 0; }
	.tpi-header .tpi-l3 { padding: 0 0 10px 16px; }
	.tpi-l3 a { display: block; padding: 9px 0; color: var(--tpi-ink-2); font-size: 16px; }
	body.tpi-menu-open { overflow: hidden; }
}
@media (max-width: 782px) { .admin-bar .tpi-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .tpi-header.is-stuck { top: 0; } }

/* Odstęp treści od przyklejonego nagłówka (nadpisuje !important ze starego motywu i Customizera) */
body:not(.home) .site-container-content-bnb { margin-top: 216px !important; }
@media (max-width: 1024px) { body:not(.home) .site-container-content-bnb { margin-top: 146px !important; } }

@media (prefers-reduced-motion: reduce) { .tpi-header, .tpi-header * { transition: none !important; } }
