/* ==========================================================================
   Custom Menu - style frontendu (v2)
   Motyw sterowany zmiennymi ustawianymi inline przez shortcode:
   --cm-accent, --cm-bg, --cm-text, --cm-text-strong, --cm-topbar-bg, --cm-border
   ========================================================================== */

.cm-nav,
.cm-nav *,
.cm-nav *::before,
.cm-nav *::after { box-sizing: border-box; }

.cm-nav {
	--cm-accent: #A17C5C;
	--cm-bg: #16202e;
	--cm-text: #c9cfd8;
	--cm-text-strong: #ffffff;
	--cm-topbar-bg: #0f1621;
	--cm-border: rgba(255,255,255,0.08);
	--cm-radius: 10px;
	--cm-maxw: 1240px;

	position: relative;
	width: 100%;
	background: var(--cm-bg);
	color: var(--cm-text);
	border-top: 3px solid var(--cm-accent);
	border-bottom: 1px solid var(--cm-border);
	font-family: inherit;
	z-index: 999;
}

/* ------------------------------ Gorny pasek ------------------------------ */
.cm-topbar {
	background: var(--cm-topbar-bg);
	border-bottom: 1px solid var(--cm-border);
	font-size: 12.5px;
}
.cm-topbar-inner {
	max-width: var(--cm-maxw);
	margin: 0 auto;
	padding: 8px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.cm-topbar-contact { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.cm-topbar-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--cm-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}
.cm-topbar-item:hover { color: var(--cm-accent); }
.cm-topbar-item svg { width: 13px; height: 13px; color: var(--cm-accent); flex: 0 0 auto; }
.cm-topbar-social { display: flex; align-items: center; gap: 14px; }
.cm-soc { display: inline-flex; color: var(--cm-text); transition: color 0.2s ease; }
.cm-soc:hover { color: var(--cm-accent); }
.cm-soc svg { width: 15px; height: 15px; }

/* ------------------------------- Kontener -------------------------------- */
.cm-container {
	max-width: var(--cm-maxw);
	margin: 0 auto;
	padding: 0 24px;
	min-height: 90px;
	display: flex;
	align-items: center;
	gap: 12px;
}

/* --------------------------------- Logo ---------------------------------- */
.cm-logo { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.cm-logo img { display: block; max-height: 66px; width: auto; }
.cm-logo-text {
	font-size: 24px;
	font-weight: 600;
	letter-spacing: 0.4px;
	color: var(--cm-text-strong);
	white-space: nowrap;
}
.cm-layout-split .cm-logo { padding: 0 22px; }

/* -------------------------------- Linki ---------------------------------- */
.cm-links { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.cm-links-left  { flex: 1; justify-content: flex-end; }
.cm-links-right { flex: 1; justify-content: flex-start; }
.cm-layout-classic .cm-links-classic { flex: 1; justify-content: center; }

.cm-item { position: relative; }
.cm-item-row { display: flex; align-items: center; }
.cm-link {
	display: inline-block;
	padding: 10px 14px;
	color: var(--cm-text);
	text-decoration: none;
	font-size: 14.5px;
	font-weight: 500;
	letter-spacing: 0.2px;
	white-space: nowrap;
	position: relative;
	transition: color 0.2s ease;
}
.cm-link:hover,
.cm-item:hover > .cm-item-row > .cm-link,
.cm-item.current-menu-item > .cm-item-row > .cm-link { color: var(--cm-accent); }

.cm-link::after {
	content: "";
	position: absolute;
	left: 14px; right: 14px; bottom: 4px;
	height: 2px;
	background: var(--cm-accent);
	border-radius: 2px;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.25s ease;
}
.cm-item:hover > .cm-item-row > .cm-link::after,
.cm-item.current-menu-item > .cm-item-row > .cm-link::after { transform: scaleX(1); }

/* Strzalka rozwijania */
.cm-sub-toggle { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 4px; cursor: pointer; color: inherit; }
.cm-chevron {
	width: 8px; height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.25s ease;
	margin-bottom: 2px;
	opacity: 0.6;
}
.cm-item:hover .cm-chevron { opacity: 1; }

/* ------------------------------- Sub-menu -------------------------------- */
.cm-sub {
	list-style: none; margin: 0; padding: 8px;
	position: absolute; top: 100%; left: 50%;
	transform: translateX(-50%) translateY(8px);
	min-width: 210px;
	background: var(--cm-bg);
	border: 1px solid var(--cm-border);
	border-radius: var(--cm-radius);
	box-shadow: 0 12px 30px rgba(0,0,0,0.28);
	opacity: 0; visibility: hidden;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	z-index: 50;
}
.cm-sub::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.cm-item:hover > .cm-sub { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.cm-sublink {
	display: block; padding: 10px 14px;
	color: var(--cm-text); text-decoration: none;
	font-size: 14px; border-radius: 7px;
	transition: background 0.15s ease, color 0.15s ease; white-space: nowrap;
}
.cm-sublink:hover { background: var(--cm-border); color: var(--cm-accent); }

/* -------------------------------- Przycisk ------------------------------- */
.cm-btn {
	flex-shrink: 0;
	display: inline-flex; align-items: center; justify-content: center;
	padding: 12px 24px;
	background: var(--cm-accent);
	color: #fff; text-decoration: none;
	font-size: 14px; font-weight: 600; letter-spacing: 0.3px;
	border-radius: 6px;
	transition: filter 0.2s ease;
}
.cm-btn:hover { filter: brightness(0.92); color: #fff; }
.cm-btn-desktop { display: inline-flex; }
.cm-layout-classic .cm-btn-desktop { margin-left: auto; }

/* ------------------------------- Hamburger ------------------------------- */
.cm-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 10px; }
.cm-toggle span { display: block; height: 2px; width: 100%; background: var(--cm-text-strong); border-radius: 2px; transition: transform 0.3s ease, opacity 0.2s ease; }

.cm-panel { display: none; }
.cm-panel-head { display: none; }
.cm-close { display: none; }
.cm-overlay { display: none; }

/* ======================================================================
   MOBILE (<= 900px)
   ====================================================================== */
@media (max-width: 900px) {
	.cm-topbar { display: none; }

	.cm-container { min-height: 64px; padding: 0 16px; justify-content: space-between; }
	.cm-logo img { max-height: 46px; }
	.cm-logo-text { font-size: 20px; }
	.cm-layout-split .cm-logo { padding: 0; }

	.cm-links-left, .cm-links-right, .cm-links-classic, .cm-btn-desktop { display: none; }

	.cm-toggle { display: flex; margin-left: 0; }

	.cm-panel {
		display: flex;
		position: fixed; top: 0; right: 0;
		height: 100%; height: 100dvh;
		width: min(86vw, 360px);
		background: var(--cm-bg);
		flex-direction: column; align-items: stretch; justify-content: flex-start;
		gap: 0; padding: 0 0 24px;
		transform: translateX(100%);
		transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
		box-shadow: -14px 0 40px rgba(0,0,0,0.4);
		overflow-y: auto; z-index: 1001;
	}
	.cm-nav.cm-open .cm-panel { transform: translateX(0); }

	.cm-panel-head {
		display: flex; align-items: center; justify-content: space-between;
		padding: 18px 20px; border-bottom: 1px solid var(--cm-border);
		position: sticky; top: 0; background: var(--cm-bg); z-index: 2;
	}
	.cm-panel-title { font-size: 18px; font-weight: 600; color: var(--cm-text-strong); }
	.cm-close {
		display: inline-flex; align-items: center; justify-content: center;
		width: 40px; height: 40px; font-size: 30px; line-height: 1;
		background: none; border: 0; color: var(--cm-text-strong); cursor: pointer; border-radius: 8px;
	}
	.cm-close:hover { color: var(--cm-accent); }

	.cm-panel .cm-links {
		flex-direction: column; align-items: stretch; justify-content: flex-start;
		gap: 0; flex: 0 0 auto; padding: 6px 0; width: 100%;
	}
	.cm-panel .cm-item { border-bottom: 1px solid var(--cm-border); }
	.cm-panel .cm-item-row { justify-content: space-between; }
	.cm-panel .cm-link { flex: 1; padding: 15px 20px; font-size: 16px; }
	.cm-panel .cm-link::after { display: none; }

	.cm-sub-toggle { width: 54px; height: 54px; flex-shrink: 0; }
	.cm-item.cm-sub-open .cm-chevron { transform: rotate(-135deg); margin-bottom: -2px; }

	.cm-panel .cm-sub {
		position: static; transform: none; opacity: 1; visibility: visible;
		box-shadow: none; border: 0; border-radius: 0; min-width: 0; padding: 0;
		background: var(--cm-topbar-bg);
		max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
	}
	.cm-panel .cm-sub::before { display: none; }
	.cm-item.cm-sub-open .cm-sub { max-height: 600px; }
	.cm-panel .cm-sublink { padding: 13px 20px 13px 34px; font-size: 15px; border-radius: 0; }

	.cm-panel .cm-btn { margin: 20px 20px 0; padding: 15px 24px; width: calc(100% - 40px); }

	.cm-panel-contact {
		display: flex; flex-direction: column; gap: 12px;
		margin-top: 22px; padding: 20px 20px 0;
		border-top: 1px solid var(--cm-border);
	}
	.cm-panel-contact .cm-topbar-social { margin-top: 4px; gap: 18px; }

	.cm-overlay {
		display: block; position: fixed; inset: 0;
		background: rgba(0,0,0,0.5); opacity: 0; visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s; z-index: 1000;
	}
	.cm-nav.cm-open .cm-overlay { opacity: 1; visibility: visible; }

	.cm-nav.cm-open .cm-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.cm-nav.cm-open .cm-toggle span:nth-child(2) { opacity: 0; }
	.cm-nav.cm-open .cm-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

body.cm-no-scroll { overflow: hidden; }

/* ======================================================================
   STOPKA  [custom_footer]
   ====================================================================== */
.cm-footer,
.cm-footer *,
.cm-footer *::before,
.cm-footer *::after { box-sizing: border-box; }

.cm-footer {
	--cm-maxw: 1240px;
	background: var(--cm-bg);
	color: var(--cm-text);
	border-top: 3px solid var(--cm-accent);
	font-family: inherit;
	width: 100%;
}
.cm-footer-top {
	max-width: var(--cm-maxw);
	margin: 0 auto;
	padding: 44px 24px 34px;
	display: grid;
	grid-template-columns: 1.5fr 1fr 1.1fr;
	gap: 34px;
}
.cm-footer .cm-logo { display: inline-flex; align-items: center; text-decoration: none; }
.cm-footer .cm-logo img { display: block; max-height: 64px; width: auto; }
.cm-footer .cm-logo-text { font-size: 24px; font-weight: 600; letter-spacing: 0.4px; color: var(--cm-text-strong); }
.cm-footer-tagline { color: var(--cm-text); font-size: 14px; margin: 16px 0 22px; }
.cm-footer .cm-btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 13px 26px; background: var(--cm-accent); color: #fff;
	text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: 0.3px;
	border-radius: 6px; transition: filter 0.2s ease;
}
.cm-footer .cm-btn:hover { filter: brightness(0.92); color: #fff; }

.cm-footer-h { color: var(--cm-text-strong); font-size: 15px; font-weight: 600; margin: 0 0 16px; letter-spacing: 0.3px; }
.cm-footer-nav { list-style: none; margin: 0; padding: 0; }
.cm-footer-nav a { display: inline-block; color: var(--cm-text); text-decoration: none; font-size: 14px; padding: 6px 0; transition: color 0.2s ease; }
.cm-footer-nav a:hover { color: var(--cm-accent); }

.cm-footer-ci {
	display: flex; align-items: flex-start; gap: 10px;
	color: var(--cm-text); font-size: 13.5px; line-height: 1.5;
	margin-bottom: 13px; text-decoration: none;
}
a.cm-footer-ci:hover { color: var(--cm-accent); }
.cm-footer-ci svg { width: 17px; height: 17px; color: var(--cm-accent); flex: 0 0 auto; margin-top: 1px; }
.cm-footer-social { display: flex; gap: 16px; margin-top: 6px; }
.cm-footer-social a { display: inline-flex; color: var(--cm-text); transition: color 0.2s ease; }
.cm-footer-social a:hover { color: var(--cm-accent); }
.cm-footer-social svg { width: 18px; height: 18px; }

.cm-footer-bottom {
	max-width: var(--cm-maxw); margin: 0 auto;
	border-top: 1px solid var(--cm-border);
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; padding: 18px 24px;
}
.cm-footer-copy { color: var(--cm-muted); font-size: 13px; }
.cm-footer-bottom-right { display: flex; align-items: center; gap: 22px; }
.cm-footer-legal { color: var(--cm-text); text-decoration: none; font-size: 13px; transition: color 0.2s ease; }
.cm-footer-legal:hover { color: var(--cm-accent); }

.cm-backtotop {
	display: inline-flex; align-items: center; justify-content: center;
	width: 42px; height: 42px; flex: 0 0 auto;
	border: 1px solid var(--cm-border-strong); border-radius: 50%;
	color: var(--cm-text-strong); background: transparent; cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cm-backtotop svg { width: 18px; height: 18px; transition: transform 0.2s ease; }
.cm-backtotop:hover { background: var(--cm-accent); border-color: var(--cm-accent); color: #fff; }
.cm-backtotop:hover svg { transform: translateY(-3px); }

@media (max-width: 820px) {
	.cm-footer-top { grid-template-columns: 1fr; gap: 28px; padding: 34px 20px 26px; }
	.cm-footer-bottom { flex-direction: column; gap: 16px; padding: 20px; text-align: center; }
	.cm-footer-bottom-right { flex-direction: column; gap: 16px; }
}
