@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

:root {
	--accent: #ff5500;
	--btn-woo: #333333;
	--bg-sidebar: #ffffff;
	--bg-workspace: #f4f5f7;
	--text-main: #222222;
	--border-color: #dddddd;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	height: 100dvh;
	overflow: hidden;
	background: var(--bg-workspace);
	color: var(--text-main);
	font-family: 'Montserrat', Arial, sans-serif;
	overscroll-behavior: none;
	position: fixed;
}

.mobile-only,
.mobile-tabs,
#sekcja-druku {
	display: none;
}
.desktop-only {
	display: block !important;
}

.app-container {
	display: flex;
	width: 100vw;
	height: 100%;
	height: 100dvh;
}

.header-mobile {
	display: none;
}

.sidebar {
	width: 380px;
	min-width: 380px;
	flex-shrink: 0;
	background: var(--bg-sidebar);
	border-right: 1px solid var(--border-color);
	padding: 20px;
	display: flex;
	flex-direction: column;
	z-index: 100;
	overflow-y: auto;
}

.logo-sidebar {
	font-size: 24px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 2px;
	margin-bottom: 25px;
	text-align: center;
	color: var(--text-main);
}
.logo-sidebar span {
	color: var(--accent);
}

.config-section {
	margin-bottom: 15px;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 15px;
}
.sekcja-tytul {
	color: var(--text-main);
	font-weight: 700;
	font-size: 11px;
	text-transform: uppercase;
	margin-bottom: 12px;
	letter-spacing: 1px;
}

.menu-tla {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 5px;
	max-height: 120px;
	overflow-y: auto;
	padding: 5px;
	background: #f9f9f9;
	border-radius: 5px;
	border: 1px solid var(--border-color);
}
.mini {
	width: 100%;
	height: 28px;
	border: 1px solid #ccc;
	cursor: pointer;
	background-size: cover;
	border-radius: 3px;
}

.menu-kolorow {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.menu-czcionek {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.probka {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid #ddd;
	cursor: pointer;
	background-size: cover;
}
.probka.aktywny {
	border-color: var(--accent);
	box-shadow: 0 0 8px rgba(255, 85, 0, 0.4);
	transform: scale(1.1);
}

.btn-font,
.btn-opcja {
	background: #f4f4f4;
	color: #444;
	border: 1px solid #ccc;
	padding: 10px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	border-radius: 0px;
	transition: 0.2s;
	width: 100%;
	margin-bottom: 5px;
	font-family: 'Montserrat', sans-serif;
}
.btn-font:hover,
.btn-opcja:hover {
	background: #eaeaea;
}
.btn-font.aktywna,
.btn-opcja.aktywna {
	background: var(--accent);
	color: white;
	border-color: var(--accent);
}

.workspace {
	flex-grow: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	position: relative;
	overflow-y: auto;
	overflow-x: hidden;
}
.workspace-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 1200px;
}

.tablica-container {
	transform: scale(0.6);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin-bottom: 0px;
	margin-top: -30px;

	#alert-miejsce {
		font-size: 22px; /* Zwiększamy z domyślnego na 22px */
		color: #ff5500;
		font-weight: bold;
	}
}
.tablica {
	width: 1054px;
	height: 224px;
	background-size: 100% 100%;
	position: relative;
	border-radius: 12px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
	border: 1px solid #999;
	flex-shrink: 0;
}

.warstwa-ramki {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 50;
	pointer-events: none;
	background-size: cover;
	background-position: center;
	-webkit-mask-image: url('maska_ramki.png');
	mask-image: url('maska_ramki.png');
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
}

.szuflada-container {
	margin-top: 20px;
	width: 100%;
	max-width: 800px;
}
.szuflada {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	background: #ffffff;
	padding: 15px;
	border-radius: 8px;
	border: 1px solid var(--border-color);
	justify-content: center;
	max-height: 250px;
	overflow-y: auto;
	box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.03);
}

.item-szuflada {
	width: 44px;
	height: 44px;
	background-color: #8f9397;
	border: 5px solid #c4681e;
	background-color: #afafaf;
	border: 1px solid #ddd;
	border-radius: 0px;
	cursor: pointer;
	transition: 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}
.item-szuflada:hover {
	border-color: var(--accent);
	background-color: #dfdfdf;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.szuflada-icon {
	width: 80%;
	height: 80%;
	background-color: #333;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
}

.tlocznik {
	position: absolute;
	top: 12px;
	height: auto;
	cursor: grab;
	z-index: 10;
	display: flex;
	align-items: center;
}
.tlocznik-wizualny {
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
}

.btn-usun {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 22px;
	height: 22px;
	background: #e74c3c;
	color: white;
	border-radius: 50%;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	cursor: pointer;
	border: 2px solid white;
	z-index: 100;
}
.tlocznik:hover .btn-usun {
	display: flex;
}

.sidebar-footer {
	margin-top: auto;
}
.btn-pobierz {
	background: var(--btn-woo);
	border: none;
	color: white;
	padding: 14px;
	border-radius: 0px;
	font-weight: 700;
	cursor: pointer;
	width: 100%;
	font-size: 14px;
	margin-top: 10px;
	font-family: 'Montserrat', sans-serif;
	text-transform: uppercase;
	transition: 0.3s opacity;
}
.btn-pobierz:hover {
	opacity: 0.9;
}

.disclaimer {
	color: #777;
	font-size: 13px;
	text-align: center;
	padding: 10px;
	line-height: 1.5;
	margin-top: 15px;
	width: 100%;
	max-width: 800px;
}

@media (max-width: 768px) {
	.desktop-only {
		display: none !important;
	}
	.mobile-only {
		display: block !important;
	}

	html,
	body {
		overflow-y: auto !important;
		overflow-x: hidden !important;
		position: relative !important;
		height: auto !important;
		min-height: 100vh !important;
		display: block;
		overscroll-behavior: auto !important;
		touch-action: pan-y !important;
	}

	.app-container {
		display: flex !important;
		flex-direction: column;
		height: auto;
		min-height: 100vh;
		width: 100%;
	}

	.header-mobile {
		display: block;
		background: #ffffff;
		color: var(--text-main);
		padding: 15px 0;
		text-align: center;
		font-size: 22px;
		font-weight: 700;
		border-bottom: 1px solid var(--border-color);
		letter-spacing: 2px;
		width: 100%;
		position: relative;
		z-index: 600;
	}
	.header-mobile span {
		color: var(--accent);
	}

	.workspace {
		order: 1;
		width: 100%;
		height: 160px;
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 0;
		margin: 0;
		background: #ffffff;
		border-bottom: 1px solid var(--border-color);
		position: sticky;
		top: 0;
		z-index: 500;
		box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
	}

	.tablica-container {
		transform: scale(0.31);
		transform-origin: center top;
		width: 1054px;
		height: 224px;
		margin: 0 0 -150px 0;
	}

	.sidebar {
		width: 100%;
		min-width: 0 !important;
		order: 2;
		border: none;
		padding: 15px;
		background: #f9f9f9;
		height: auto;
		overflow: visible;
		padding-bottom: 80px !important;
	}

	.logo-sidebar {
		display: none;
	}

	.mobile-tabs {
		display: flex !important;
		justify-content: space-between;
		margin-bottom: 15px;
		background: #fff;
		padding: 5px;
		border-radius: 8px;
		border: 1px solid var(--border-color);
	}
	.tab-item {
		font-size: 11px;
		color: #777;
		text-transform: uppercase;
		padding: 10px 5px;
		flex-grow: 1;
		text-align: center;
		font-weight: 600;
	}
	.tab-item.active {
		color: var(--accent);
		border-bottom: 2px solid var(--accent);
	}

	.config-section {
		display: none;
		margin-bottom: 15px;
		border: none;
	}
	.config-section.active-mobile {
		display: block;
	}

	.szuflada-container {
		margin-top: 10px;
		margin-bottom: 10px;
		width: 100%;
	}
	.szuflada {
		max-height: none !important;
		padding: 5px;
		display: grid;
		grid-template-columns: repeat(6, 1fr);
		gap: 6px;
	}
	.item-szuflada {
		width: 100% !important;
		height: 38px !important;
	}

	.mobile-actions {
		display: flex;
		gap: 10px;
		margin-bottom: 10px;
		width: 100%;
	}
	.btn-opcja-mobile {
		flex: 1;
		background: #fff !important;
		color: #333 !important;
		border: 1px solid #ccc !important;
		padding: 12px 5px;
		font-size: 12px;
		font-weight: 600;
		text-align: center;
		border-radius: 6px;
	}
	.btn-opcja-mobile.aktywna {
		background: var(--accent) !important;
		color: white !important;
		border-color: var(--accent) !important;
	}
	.btn-reset-mobile {
		background: #eee !important;
	}

	.disclaimer.mobile-only {
		position: static !important;
		display: block !important;
		width: 100%;
		font-size: 12px !important;
		color: #777 !important;
		text-align: center;
		margin-top: 20px !important;
		padding: 0 10px;
	}

	.btn-usun {
		display: flex !important;
		width: 40px;
		height: 40px;
		top: -20px;
		right: -20px;
		font-size: 28px;
	}
}

.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.modal-content {
	background: #ffffff;
	border: none;
	padding: 30px;
	border-radius: 12px;
	max-width: 450px;
	width: 90%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	text-align: left;
}
.modal-content h2 {
	margin-top: 0;
	color: var(--text-main);
	text-align: center;
	border-bottom: 1px solid #eee;
	padding-bottom: 15px;
	font-size: 20px;
}
.modal-lista {
	list-style: none;
	padding: 0;
	line-height: 2;
	font-size: 15px;
	margin-bottom: 25px;
	color: #444;
}
.modal-buttons {
	display: flex;
	gap: 10px;
	flex-direction: column;
}

#podsumowanie-podglad {
	display: flex;
	justify-content: center;
	margin-bottom: 20px;
	transform: scale(0.35);
	transform-origin: top center;
	height: 80px;
}
@media (max-width: 480px) {
	#podsumowanie-podglad {
		transform: scale(0.28);
		height: 65px;
	}
}
#temp-canvas-container {
	display: none;
}

#sekcja-druku {
	display: none !important;
	color: black;
	background: white;
	padding: 40px;
}

@media print {
	.app-container,
	.modal-overlay,
	#temp-canvas-container {
		display: none !important;
	}
	#sekcja-druku {
		display: block !important;
	}
	* {
		-webkit-print-color-adjust: exact !important;
		print-color-adjust: exact !important;
	}
}
.btn-pomoc {
	background: #007bff !important;
	color: white !important;
	border: none;
	padding: 10px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 700;
	text-align: center;
	border-radius: 4px;
	transition: 0.2s;
	font-family: 'Montserrat', sans-serif;
	box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
}

.btn-pomoc-mobile {
	background: #007bff !important;
	color: white !important;
	border: none;
	padding: 12px 15px;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	border-radius: 4px;
	cursor: pointer;
	transition: 0.2s;
	font-family: 'Montserrat', sans-serif;
	box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
	flex: 1;
}

.btn-pomoc-mobile:hover {
	background: #0056b3 !important;
}

.produkt-select {
	width: 100%;
	padding: 12px;
	font-size: 14px;
	font-family: 'Montserrat', sans-serif;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	background-color: #f9f9f9;
	color: var(--text-main);
	cursor: pointer;
	font-weight: 600;
	transition: all 0.2s ease-in-out;
}

.produkt-select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 5px rgba(255, 85, 0, 0.3);
}

.produkt-select:hover {
	background-color: #ffffff;
}

.tlocznik-wizualny {
	filter: drop-shadow(-1px -1px 1px rgba(255, 255, 255, 0.6)) drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
}

#mobile-produkt-container #sekcja-produkt {
	display: block !important;
	background: #f9f9f9;
	border: none;
	padding: 10px 20px;
}

#mobile-produkt-container .sekcja-tytul {
	text-align: center;
	margin-bottom: 5px;
	color: #555;
}

#mobile-produkt-container #sekcja-produkt {
	display: block !important;
	background: #f9f9f9;
	padding: 15px;
	border-radius: 5px;
	margin-top: 5px;
}
