/* =========================================================================
   КУЗНЯ КАВИ — кастомний хедер
   Токени зверху — міняй кольори/радіуси тут.
   ========================================================================= */

:root {
	--kk-bg:        #1B1A18;   /* тло хедера */
	--kk-bg-elev:   #262320;   /* підменю на мобілці */
	--kk-cream:     #F3EEE2;   /* кремові дропдауни та кнопки */
	--kk-text:      #FAFAF2;   /* світлий текст */
	--kk-text-dark: #1B1A18;   /* темний текст на кремі */
	--kk-accent:    #E0842F;   /* оранжевий акцент */
	--kk-muted:     rgba(244,239,228,.55);
	--kk-line:      rgba(244,239,228,.12);

	--kk-radius:    14px;
	--kk-pill:      999px;
	--kk-shadow:    0 18px 50px rgba(0,0,0,.35);
	--kk-container: 1280px;
	--kk-h:         76px;      /* висота бару */
	--kk-ease:      .25s cubic-bezier(.4,0,.2,1);
}

/* Нейтралізуємо дефолтний masthead GeneratePress */
#masthead.site-header {
	background: transparent;
	padding: 0;
	border: 0;
}
#masthead .inside-header { padding: 0; }

/* Прибираємо верхню панель GP (.top-bar) над нашим хедером */
.top-bar,
.top-bar.top-bar-align-right { display: none !important; }

/* ВАЖЛИВО: не даємо обрізати дропдауни батьківськими overflow */
#masthead,
.kk-header,
.kk-header__inner,
.kk-utils,
.kk-util,
.kk-nav,
.kk-menu,
.kk-menu > li { overflow: visible; }

/* ---------- Базовий бар ---------- */
.kk-header { background: var(--kk-bg); color: var(--kk-text); position: relative; z-index: 100; }

.kk-header__inner {
	max-width: var(--kk-container);
	margin: 0 auto;
	min-height: var(--kk-h);
	padding: 0 28px;
	display: flex;
	align-items: center;
	gap: 28px;
}

/* ---------- Лого ---------- */
.kk-logo { flex: 0 0 auto; text-decoration: none; color: var(--kk-text); display: inline-flex; align-items: center; }
.kk-logo__text {
	font-weight: 800;
	font-size: 22px;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1;
	color: var(--kk-text);
}
.kk-logo img { max-height: 40px; width: auto; }

/* ---------- Десктоп-меню ---------- */
.kk-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.kk-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 30px; }
.kk-menu > li { position: relative; }

.kk-nav__link {
	display: inline-flex; align-items: center; gap: 6px;
	color: var(--kk-text);
	text-decoration: none;
	font-size: 16px;
	font-weight: 500;
	padding: 8px 0;
	transition: color var(--kk-ease);
}
.kk-menu > li:hover > .kk-nav__link,
.kk-menu > li.current-menu-item > .kk-nav__link { color: var(--kk-accent); }

/* Каретка — залитий трикутник (вниз), перевертається вгору при відкритті */
.kk-caret {
	width: 0; height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid currentColor;
	transition: transform var(--kk-ease);
	transform: rotate(0deg);
}
/* переворот трикутника при наведенні / активному пункті меню */
.kk-menu > li:hover > .kk-nav__link .kk-caret,
.kk-menu > li.current-menu-item > .kk-nav__link .kk-caret { transform: rotate(180deg); }

/* Кнопка-тогл підменю — тільки для мобілки */
.kk-nav .kk-submenu-toggle { display: none; }

/* Дропдаун-підменю (десктоп, крем) */
.kk-submenu {
	list-style: none; margin: 0; padding: 10px;
	position: absolute; top: calc(100% + 14px); left: -14px;
	min-width: 240px;
	background: var(--kk-cream);
	border-radius: var(--kk-radius);
	box-shadow: var(--kk-shadow);
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity var(--kk-ease), transform var(--kk-ease), visibility var(--kk-ease);
	z-index: 120;
}
.kk-menu > li:hover > .kk-submenu {
	opacity: 1; visibility: visible; transform: translateY(0);
}
/* невидимий місток, щоб курсор не «провалювався» */
.kk-menu > li.menu-item-has-children::after {
	content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px;
}
.kk-submenu .kk-nav__link {
	color: var(--kk-text-dark);
	padding: 10px 14px;
	border-radius: 9px;
	width: 100%;
	font-weight: 500;
	transition: background var(--kk-ease), color var(--kk-ease);
}
.kk-submenu li:hover > .kk-nav__link { background: rgba(0,0,0,.06); color: var(--kk-accent); }

.kk-nav__empty { color: var(--kk-muted); font-size: 14px; margin: 0; }

/* ---------- Утиліти (права частина) ---------- */
.kk-utils { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; }

.kk-icon-btn {
	appearance: none; -webkit-appearance: none;
	background: transparent; border: 0; cursor: pointer;
	color: var(--kk-text);
	width: 40px; height: 40px;
	display: inline-flex; align-items: center; justify-content: center;
	position: relative;
	text-decoration: none;
	border-radius: 10px;
	padding: 0;
	transition: color var(--kk-ease), background var(--kk-ease);
}
.kk-icon-btn:hover { color: var(--kk-accent);  background: unset;}
.kk-icon-btn svg { width: 22px; height: 22px; display: block; }

/* дропдаун-утиліти (мова, телефон) */
.kk-util { position: relative; }
.kk-util__toggle {
	appearance: none; background: transparent; border: 0; cursor: pointer;
	color: var(--kk-text);
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px; border-radius: 10px;
	width: auto;
	transition: color var(--kk-ease);
}
.kk-util__toggle:hover { color: var(--kk-accent); }
.kk-util__toggle svg { width: 22px; height: 22px; display: block; }
.kk-util.is-open > .kk-util__toggle .kk-caret { transform: rotate(180deg); }

.kk-util__panel {
	position: absolute; top: calc(100% + 12px); left: 0; right: auto;
	background: var(--kk-cream);
	color: var(--kk-text-dark);
	border-radius: var(--kk-radius);
	box-shadow: var(--kk-shadow);
	padding: 14px;
	min-width: 220px;
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity var(--kk-ease), transform var(--kk-ease), visibility var(--kk-ease);
	z-index: 130;
}
/* місток на розрив 12px, щоб hover не зривався */
.kk-util__panel::after {
	content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.kk-util.is-open > .kk-util__panel { opacity: 1; visibility: visible; transform: translateY(0); }

/* HOVER-фолбек для десктопа — працює навіть якщо JS не завантажився */
@media (min-width: 1024px) {
	.kk-util:hover > .kk-util__panel { opacity: 1; visibility: visible; transform: translateY(0); }
	.kk-util:hover > .kk-util__toggle .kk-caret { transform: rotate(180deg); }
	.kk-header { position: sticky; top: 0; z-index: 200; }
}


/* Мова */
.kk-lang__flag { width: 26px; height: 18px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 3px; font-size: 16px; line-height: 1; }
.kk-lang__flag img { width: 100%; height: 100%; object-fit: cover; }
.kk-lang__panel ul { list-style: none; margin: 0; padding: 0; }
.kk-lang__panel a {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 10px; border-radius: 9px;
	color: var(--kk-text-dark); text-decoration: none; font-weight: 500;
	transition: background var(--kk-ease);
}
.kk-lang__panel a:hover { background: rgba(0,0,0,.06); }
.kk-lang__panel a.is-current { color: var(--kk-accent); }

/* Телефон-панель */
.kk-phone__panel { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.kk-phone__num { color: var(--kk-text-dark); font-weight: 600; font-size: 18px; text-decoration: none; }
.kk-phone__tag { color: rgba(27,26,24,.7); text-decoration: none; font-size: 15px; }
.kk-phone__tag:hover, .kk-phone__num:hover { color: var(--kk-accent); }

/* Соцмережі */
.kk-socials { display: flex; gap: 8px; margin-top: 8px; }
.kk-socials a {
	width: 34px; height: 34px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: #000; color: #fff;
	transition: background var(--kk-ease), color var(--kk-ease);
}
.kk-socials a:hover { background: var(--kk-accent); color: #fff; }
.kk-socials svg { width: 17px; height: 17px; display: block; }

/* Лічильник кошика */
.kk-cart-count {
	position: absolute; top: 2px; right: 2px;
	min-width: 16px; height: 16px; padding: 0 4px;
	background: #56694C; color: #fff;
	font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
	border-radius: var(--kk-pill);
}
.kk-cart-count.is-empty { display: none; }

/* Бургер */
.kk-burger { display: none; }
.kk-burger__close { display: none; }

/* ---------- Пошук-попап (повноекранний, з блюром) ---------- */
.kk-search-modal {
	position: fixed; inset: 0; z-index: 300;
	display: flex; align-items: flex-start; justify-content: center;
}
.kk-search-modal[hidden] { display: none; }
.kk-search-modal__backdrop {
	position: absolute; inset: 0;
	background: rgba(20,18,16,.5);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	animation: kkFade .2s ease;
}
.kk-search-modal__inner {
	position: relative; z-index: 1;
	width: min(830px, 92vw);
	margin-top: 16vh;
	animation: kkPop .25s cubic-bezier(.4,0,.2,1);
}

/* Кремова картка (поле + результати в одному блоці) */
.kk-search-card {
	background: #F6F2E9;
	border-radius: 16px;
	box-shadow: 0 30px 90px rgba(0,0,0,.45);
	overflow: hidden;
}

/* Рядок поля */
.kk-search-form {
	display: flex; align-items: center; gap: 14px;
	padding: 4px 16px 4px 22px;
}
.kk-search-form__icon { color: #4a4a4a; display: inline-flex; flex: 0 0 auto; }
.kk-search-form__icon svg { width: 24px; height: 24px; display: block; }

/* Інпут зливається з карткою (перебиваємо стилі теми для input[type=search]) */
.kk-search-card .kk-search-input,
input.kk-search-input[type="search"] {
	flex: 1 1 auto; min-width: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	outline: none !important;
	font-size: 22px;
	line-height: 1.2;
	padding: 22px 4px !important;
	margin: 0 !important;
	color: #1B1A18 !important;
	-webkit-appearance: none;
	appearance: none;
}
.kk-search-input::placeholder { color: #8a857c; opacity: 1; }
.kk-search-input::-webkit-search-decoration,
.kk-search-input::-webkit-search-cancel-button,
.kk-search-input::-webkit-search-results-button { -webkit-appearance: none; display: none; }

/* Кнопка закриття — чорне коло (за спеком) */
.kk-search-close {
	flex: 0 0 auto;
	width: 25px; height: 25px; border: 0; cursor: pointer;
	background: #000000; color: #fff;
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	transition: background var(--kk-ease);
	padding: 0;
}
.kk-search-close:hover { background: #1a1a1a; }
.kk-search-close svg { width: 18px; height: 18px; display: block; stroke-width: 2; }

/* Результати — видно ~3, далі скрол */
.kk-search-results {
	border-top: 1px solid rgba(27,26,24,.1);
	max-height: 372px;               /* ~3 рядки */
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
.kk-search-results[hidden] { display: none; }
.kk-search-results::-webkit-scrollbar { width: 10px; }
.kk-search-results::-webkit-scrollbar-thumb { background: rgba(27,26,24,.18); border-radius: 10px; border: 3px solid #F6F2E9; }

.kk-search-result {
	display: flex; align-items: center; gap: 20px;
	padding: 14px 22px;
	text-decoration: none;
	transition: background var(--kk-ease);
}
.kk-search-result:hover { background: rgba(27,26,24,.05); }
.kk-search-result img {
	flex: 0 0 auto;
	width: 92px; height: 92px;
	object-fit: cover;
	border-radius: 8px;
	background: rgba(27,26,24,.06);
}
.kk-search-result__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kk-search-result__title {
	color: var(--kk-text-dark);
	font-size: 22px; font-weight: 700; line-height: 1.15;
}
.kk-search-result__price { color: #8a857c; font-size: 19px; }

body.kk-search-open { overflow: hidden; }

@keyframes kkFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kkPop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Захист іконок у барі від чужих svg-правил (тільки svg, не чіпаємо display кнопок) ---------- */
.kk-header .kk-icon-btn svg,
.kk-header .kk-util__toggle svg {
	width: 22px !important; height: 22px !important;
	display: block !important; visibility: visible !important; opacity: 1 !important;
}

/* ---------- Кнопка-пилюля ---------- */
.kk-btn {
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--kk-cream); color: var(--kk-text-dark);
	text-decoration: none; font-weight: 700;
	padding: 16px 32px; border-radius: var(--kk-pill);
	transition: transform var(--kk-ease), background var(--kk-ease);
}
.kk-btn:hover { background: #fff; transform: translateY(-1px); }

/* ---------- Off-canvas (мобілка) ---------- */
.kk-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,.5);
	opacity: 0; visibility: hidden; transition: opacity var(--kk-ease), visibility var(--kk-ease);
	z-index: 190;
}
.kk-mobile {
	position: fixed; top: 76px; right: 0; bottom: 0;
	width: min(100%, 460px);
	background: var(--kk-bg); color: var(--kk-text);
	padding: 20px 24px 32px;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform var(--kk-ease);
	z-index: 200;
	display: flex; flex-direction: column;
} 
body.logged-in .kk-mobile {top: 122px;}
.kk-menu-open .kk-overlay {top: 76px;}
body.logged-in.kk-menu-open .kk-overlay {top: 122px;}
.kk-mobile__nav { margin-bottom: 24px; }
.kk-mobile .kk-menu { flex-direction: column; align-items: stretch; gap: 0; }
.kk-mobile .kk-menu > li { border-bottom: 1px solid var(--kk-line); }
.kk-mobile .kk-nav__link {
	font-size: 18px; padding: 16px 0; justify-content: flex-start;
}
.kk-mobile .kk-nav__link .kk-caret { display: none; }

/* тогл підменю на мобілці */
.kk-mobile .kk-menu > li.menu-item-has-children { position: relative; }
.kk-mobile .kk-submenu-toggle {
	display: block; position: absolute; top: 8px; right: 0;
	width: 44px; height: 44px;
	background: transparent; border: 0; cursor: pointer;
}
.kk-mobile .kk-submenu-toggle::before {
	content: ""; position: absolute; top: 50%; left: 50%;
	width: 0; height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid var(--kk-text);
	transform: translate(-50%,-50%);
	transition: transform var(--kk-ease), border-top-color var(--kk-ease);
}
.kk-mobile .kk-submenu-toggle::after { content: none; }
.kk-mobile .menu-item-has-children.is-open > .kk-submenu-toggle::before {
	transform: translate(-50%,-50%) rotate(180deg);
	border-top-color: var(--kk-accent);
}
.kk-mobile .menu-item-has-children.is-open > .kk-nav__link { color: var(--kk-accent); }

/* підменю-аккордеон */
.kk-mobile .kk-submenu {
	position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
	background: var(--kk-bg-elev);
	border-radius: 10px;
	margin: 0 0 14px; padding: 6px;
	max-height: 0; overflow: hidden;
	transition: max-height var(--kk-ease), padding var(--kk-ease), margin var(--kk-ease);
}
.kk-mobile .menu-item-has-children:not(.is-open) > .kk-submenu { padding-top: 0; padding-bottom: 0; margin: 0; }
.kk-mobile .kk-submenu .kk-nav__link { color: var(--kk-text); font-size: 16px; padding: 12px 12px; border-radius: 8px; }
.kk-mobile .kk-submenu .kk-nav__link:hover { background: rgba(255,255,255,.05); color: var(--kk-accent); }

.kk-mobile__cta { width: 100%; margin-bottom: 28px; margin-top: 50px; }

.kk-mobile__contacts h3 { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.kk-mobile__contacts a { display: block; color: var(--kk-text); text-decoration: none; margin-bottom: 10px; font-size: 16px; }
.kk-mobile__contacts a:hover { color: var(--kk-accent); }
.kk-mobile__contacts .kk-socials a { display: inline-flex; margin: 0; color: #fff; background: transparent; }
.kk-mobile__contacts .kk-socials a:hover { background: transparent; color: var(--kk-accent); }

/* Стани відкриття */
body.kk-menu-open { overflow: hidden; }
body.kk-menu-open .kk-mobile { transform: translateX(0); }
body.kk-menu-open .kk-mobile[aria-hidden] { visibility: visible; }
body.kk-menu-open .kk-overlay { opacity: 1; visibility: visible; }
body.kk-menu-open .kk-burger__open { display: none; }
body.kk-menu-open .kk-burger__close { display: inline-flex; }

/* ---------- Респонсив ---------- */
@media (max-width: 1023px) {
	.kk-nav { display: none; }
	.kk-lang { display: none; }        /* мова — всередині off-canvas за потреби */
	.kk-account { display: none; }     /* прибери, якщо треба лишити акаунт у барі */
	.kk-burger { display: inline-flex; }
	.kk-header__inner { gap: 8px; padding: 0 16px; }
	.kk-utils { gap: 4px; margin-left: auto; }
	.kk-logo__text { font-size: 19px; }
}

@media (min-width: 1024px) {
	.kk-mobile, .kk-overlay { display: none; }
}
