/* Modal po dodaniu do koszyka + licznik przy pozycji „Koszyk”. */

/* --- Licznik ------------------------------------------------------------- */

.sg-licznik-koszyka {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.3rem;
	height: 1.3rem;
	margin-left: 0.45em;
	padding: 0 0.4em;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1;
	vertical-align: middle;
}

.sg-licznik-koszyka--pusty {
	display: none;
}

/* --- Modal --------------------------------------------------------------- */

.sg-modal[hidden] {
	display: none;
}

.sg-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.sg-modal__tlo {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.55);
	animation: sg-modal-tlo 0.18s ease-out;
}

.sg-modal__okno {
	position: relative;
	width: 100%;
	max-width: 27rem;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	border-radius: 0.6rem;
	background: #fff;
	box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.25);
	animation: sg-modal-okno 0.2s ease-out;
}

.sg-modal__gora {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #eee;
}

.sg-modal__naglowek {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

/* Znacznik potwierdzenia zamiast ikony z zewnętrznego zestawu. */
.sg-modal__naglowek::before {
	content: "";
	display: inline-block;
	width: 1.05em;
	height: 1.05em;
	margin-right: 0.5em;
	border-radius: 50%;
	background: #1f9d55 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E") center / 70% no-repeat;
	vertical-align: -0.15em;
}

.sg-modal__zamknij {
	flex: none;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 0.3rem;
	background: transparent;
	color: #555;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.sg-modal__zamknij:hover,
.sg-modal__zamknij:focus-visible {
	background: #f2f2f2;
	color: #111;
}

.sg-modal__tresc {
	padding: 1.25rem;
}

.sg-modal__produkt {
	display: flex;
	align-items: flex-start;
	gap: 0.9rem;
}

.sg-modal__zdjecie {
	flex: none;
	width: 5rem;
	height: 5rem;
	border-radius: 0.35rem;
	object-fit: cover;
}

.sg-modal__opis {
	min-width: 0;
}

.sg-modal__nazwa {
	margin: 0 0 0.25rem;
	font-weight: 600;
	line-height: 1.35;
}

.sg-modal__cena {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
}

.sg-modal__ilosc {
	margin: 0.25rem 0 0;
	color: #666;
	font-size: 0.85rem;
}

.sg-modal__podsumowanie {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1.1rem;
	padding-top: 0.9rem;
	border-top: 1px solid #eee;
}

.sg-modal__etykieta {
	color: #555;
	font-size: 0.9rem;
}

.sg-modal__suma {
	font-size: 1.05rem;
	font-weight: 700;
}

.sg-modal__akcje {
	display: flex;
	gap: 0.6rem;
	padding: 0 1.25rem 1.25rem;
}

.sg-modal__przycisk {
	flex: 1 1 0;
	padding: 0.7rem 1rem;
	border: 1px solid transparent;
	border-radius: 0.35rem;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.sg-modal__przycisk--dalej {
	border-color: #ccc;
	background: #fff;
	color: #222;
}

.sg-modal__przycisk--dalej:hover,
.sg-modal__przycisk--dalej:focus-visible {
	border-color: #999;
	background: #fafafa;
}

.sg-modal__przycisk--koszyk {
	background: #111;
	color: #fff;
}

.sg-modal__przycisk--koszyk:hover,
.sg-modal__przycisk--koszyk:focus-visible {
	background: #333;
	color: #fff;
}

body.sg-modal-otwarty {
	overflow: hidden;
}

@keyframes sg-modal-tlo {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes sg-modal-okno {
	from { opacity: 0; transform: translateY(0.75rem); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.sg-modal__tlo,
	.sg-modal__okno {
		animation: none;
	}
}

@media (max-width: 30rem) {
	.sg-modal__akcje {
		flex-direction: column;
	}
}
