/* Vibepic Menu Kapsuła – komputer: kapsuła w górnym pasku; telefon: kapsuła na dole ekranu */

.vpk-menu {
	--vpk-purple: #554178;
	--vpk-soft: #efecf6;
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border-radius: 999px;
	padding: 6px 8px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	position: relative;
}

.vpk-brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	text-decoration: none;
	color: var(--vpk-purple);
	font-weight: 700;
}

.vpk-brand img {
	display: block;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

/* Nazwa i hasło strony obok rybki */
.vpk-brand__txt {
	display: none;
	flex-direction: column;
	line-height: 1.15;
	text-align: left;
}

.vpk-brand__txt strong {
	font-family: 'Playfair Display', 'Playfair-Fallback', Georgia, serif;
	font-weight: 700;
	font-size: 18px;
	color: var(--vpk-purple);
}

.vpk-brand__txt small {
	display: none;
}

/* Komputer: sama nazwa w kapsule, tylko gdy jest miejsce */
@media (min-width: 1101px) {
	.vpk-brand {
		gap: 9px;
		padding-right: 8px;
	}

	.vpk-brand__txt {
		display: flex;
	}
}

.vpk-nav {
	flex: 1 1 auto;
}

.vpk-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 2px;
}

.vpk-item {
	position: relative;
	margin: 0;
	padding: 0;
}

.vpk-link {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 9px 14px;
	border-radius: 999px;
	color: var(--vpk-purple) !important;
	text-decoration: none !important;
	font-family: 'Karla', 'Karla-Fallback', sans-serif;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.15s ease;
}

.vpk-link:hover,
.vpk-item:focus-within > .vpk-link,
.vpk-item.is-open > .vpk-link,
.vpk-item.is-current > .vpk-link {
	background: var(--vpk-soft);
}

.vpk-svg {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
}

/* --- Szukaj --- */
.vpk-search-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--vpk-purple);
	cursor: pointer;
}

.vpk-search-btn:hover {
	background: var(--vpk-soft);
}

.vpk-search {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100000;
	background: var(--vpk-purple);
	padding: 16px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.vpk-search[hidden] {
	display: none;
}

.vpk-search form {
	display: flex;
	gap: 8px;
	max-width: 640px;
	margin: 0 auto;
}

.vpk-search input[type='search'] {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	border-radius: 999px;
	padding: 12px 18px;
	font-size: 16px;
}

.vpk-search button {
	border: 0;
	border-radius: 999px;
	padding: 12px 20px;
	background: #ff8c00;
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

/* --- Panel z podkategoriami (komputer: rozwija się pod kapsułą) --- */
.vpk-panel {
	position: absolute;
	left: 0;
	top: 100%;
	margin-top: 12px;
	min-width: 240px;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 9995;
}

/* mostek, żeby panel nie znikał przy przesuwaniu myszy z ikony na panel */
.vpk-panel::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: -14px;
	height: 14px;
}

@media (hover: hover) and (min-width: 783px) {
	.vpk-item:hover > .vpk-panel,
	.vpk-item:focus-within > .vpk-panel {
		opacity: 1;
		visibility: visible;
		transform: none;
	}
}

/* Ekran dotykowy: panel rozwija się jako osobna karta (.vpk-sheet) dodawana do <body>, więc nic jej nie przycina */
@media (hover: none), (max-width: 782px) {
	.vpk-panel {
		display: none !important;
	}
}

.vpk-sheet {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 9980;
	background: rgba(32, 20, 52, 0.28);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.vpk-sheet[hidden] {
	display: none;
}

.vpk-sheet__card {
	position: absolute;
	left: 50%;
	bottom: calc(86px + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	width: calc(100% - 24px);
	max-width: 460px;
	max-height: 62vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border-radius: 22px;
	padding: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	cursor: default;
}

.vpk-sheet__card ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vpk-sheet__card li {
	margin: 0;
	padding: 0;
}

.vpk-sheet__card a {
	display: block;
	padding: 13px 14px;
	border-radius: 12px;
	color: #554178 !important;
	text-decoration: none !important;
	font-family: 'Karla', 'Karla-Fallback', sans-serif;
	font-size: 16px !important;
	font-weight: 600 !important;
	line-height: 1.25;
}

.vpk-sheet__card a:active {
	background: #efecf6;
}

.vpk-sheet__card .vpk-panel__all {
	background: #efecf6;
	font-weight: 800 !important;
	margin-bottom: 6px;
}

.vpk-panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vpk-panel li {
	margin: 0;
	padding: 0;
}

.vpk-panel a {
	display: block;
	padding: 10px 14px;
	border-radius: 12px;
	color: var(--vpk-purple) !important;
	text-decoration: none !important;
	font-family: 'Karla', 'Karla-Fallback', sans-serif;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.25;
}

.vpk-panel a:hover,
.vpk-panel a:focus-visible {
	background: var(--vpk-soft);
}

.vpk-panel .vpk-panel__all {
	background: var(--vpk-soft);
	font-weight: 800 !important;
	margin-bottom: 6px;
}

/* --- Węższy komputer / tablet poziomo: podpisy tylko przy aktualnej pozycji (reszta w dymku title) --- */
@media (min-width: 783px) and (max-width: 1100px) {
	.vpk-item:not(.is-current) .vpk-lab {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.vpk-link {
		padding: 10px 12px;
	}
}

/* Konto jest w kapsule (komputer i telefon), więc oddzielny blok "Moje konto" w pasku znika */
.wp-site-blocks > :first-child:has(.vpk-menu) .wp-block-woocommerce-customer-account {
	display: none;
}

/* Przyciski w kapsule wyglądają jak linki */
button.vpk-link {
	background: transparent;
	border: 0;
	margin: 0;
	cursor: pointer;
	width: 100%;
}

/* Lupa jako pozycja kapsuły – tylko telefon */
.vpk-item--lupa {
	display: none;
}

/* --- Telefon / ekran dotykowy: kapsuła na dole --- */
@media (max-width: 782px) {
	.vpk-item--lupa {
		display: block;
	}

	.vpk-search-btn {
		display: none;
	}

	.vpk-menu {
		flex: 1 1 auto;
		width: 100%;
		background: transparent;
		box-shadow: none;
		padding: 0;
		gap: 10px;
	}

	.vpk-brand {
		margin-right: auto;
		gap: 11px;
		padding-right: 0;
	}

	/* Telefon: logo na przezroczystym tle (bez białego kółka), zawsze po lewej, a napis po jego prawej */
	.vpk-brand {
		flex-direction: row;
	}

	.vpk-brand img {
		width: 42px;
		height: 42px;
		background: transparent;
		order: 0;
	}

	.vpk-brand__txt {
		order: 1;
	}

	/* Telefon: nazwa + hasło w górnym fioletowym pasku (zastępują blok "vibepic / Drukuj & Twórz" pod falą) */
	.vpk-brand__txt {
		display: flex;
	}

	.vpk-brand__txt strong {
		color: #fff;
		font-size: 20px;
	}

	.vpk-brand__txt small {
		display: block;
		color: rgba(255, 255, 255, 0.88);
		font-family: 'Playfair Display', 'Playfair-Fallback', Georgia, serif;
		font-size: 11.5px;
		font-weight: 400;
	}

	.vpk-search-btn {
		color: #fff;
	}

	.vpk-search-btn:hover {
		background: rgba(255, 255, 255, 0.16);
	}

	.vpk-nav {
		position: fixed;
		left: 0;
		right: 0;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		width: calc(100% - 24px);
		max-width: 460px;
		margin: 0 auto;
		background: #fff;
		border-radius: 999px;
		box-shadow: 0 6px 26px rgba(0, 0, 0, 0.3);
		padding: 6px;
		z-index: 9990;
	}

	/* kapsuła przewija się palcem w bok: Kartki … Blog, Szukaj, Konto */
	.vpk-list {
		width: 100%;
		justify-content: flex-start;
		gap: 0;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
	}

	.vpk-list::-webkit-scrollbar {
		display: none;
	}

	.vpk-list {
		position: relative;
	}

	/* przyciemnione brzegi = podpowiedź, że kapsułę można przesuwać palcem */
	.vpk-nav::before,
	.vpk-nav::after {
		content: '';
		position: absolute;
		top: 6px;
		bottom: 6px;
		width: 34px;
		pointer-events: none;
		opacity: 0;
		transition: opacity 0.15s ease;
		z-index: 2;
	}

	.vpk-nav::before {
		left: 6px;
		border-radius: 999px 0 0 999px;
		background: linear-gradient(to right, #fff 25%, rgba(255, 255, 255, 0));
	}

	.vpk-nav::after {
		right: 6px;
		border-radius: 0 999px 999px 0;
		background: linear-gradient(to left, #fff 25%, rgba(255, 255, 255, 0));
	}

	.vpk-nav.can-left::before,
	.vpk-nav.can-right::after {
		opacity: 1;
	}

	.vpk-item {
		position: static;
		flex: 0 0 62px;
		min-width: 0;
		scroll-snap-align: start;
	}

	.vpk-link {
		flex-direction: column;
		gap: 3px;
		padding: 7px 2px 6px;
		font-size: 10.5px !important;
		letter-spacing: 0;
		justify-content: center;
		border-radius: 24px;
	}

	.vpk-lab {
		display: block;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.vpk-svg {
		width: 23px;
		height: 23px;
	}

	/* baner cookies (wtyczka z #cookie-notice) stoi nad kapsułą, a nie na niej – inaczej zasłania ikony przy pierwszej wizycie */
	#cookie-notice {
		bottom: calc(94px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* miejsce na kapsułę, żeby nie zasłaniała końca strony */
	.wp-site-blocks {
		padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.vpk-panel,
	.vpk-link {
		transition: none;
	}
}
