/* ms-addons — frontend (ładowane tylko na produktach z dodatkami) */

.ms-addons {
	margin: 0 0 1em;
}

.ms-addon {
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	margin-bottom: 10px;
	padding: 12px 14px;
	transition: border-color .15s ease;
}

.ms-addon-active {
	border-color: #111;
}

.ms-addon-invalid {
	border-color: #c00;
}

.ms-addon-head {
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	margin: 0;
}

.ms-addon-head input[type="checkbox"] {
	margin: 0;
	flex: 0 0 auto;
}

.ms-addon-thumb img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

.ms-addon-name {
	flex: 1 1 auto;
	font-weight: 600;
}

.ms-addon-price {
	white-space: nowrap;
	font-weight: 600;
}

.ms-addon-desc {
	margin-top: 8px;
	font-size: .9em;
	color: #555;
}

.ms-addon-sub {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed #ddd;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ms-sub-label {
	display: block;
	font-size: .85em;
	font-weight: 600;
	margin-bottom: 4px;
}

.ms-addon-positions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: flex-end;
}

.ms-addon-positions .ms-sub-label {
	flex: 1 0 100%;
}

.ms-pos-btn {
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 8px 12px;
	cursor: pointer;
	text-align: center;
	font-size: .9em;
}

.ms-pos-btn input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ms-pos-btn:has(input:checked) {
	border-color: #111;
	background: #111;
	color: #fff;
}

.ms-pos-btn img {
	display: block;
	width: 64px;
	height: auto;
	margin: 0 auto 6px;
}

.ms-radio-opt {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-right: 14px;
	cursor: pointer;
}

.ms-addon-qty input {
	width: 70px;
}

.ms-addon-text textarea {
	width: 100%;
}

.ms-addons-totals {
	border-top: 2px solid #111;
	margin-top: 12px;
	padding-top: 10px;
}

.ms-addons-totals-row {
	display: flex;
	justify-content: space-between;
	padding: 2px 0;
}

.ms-addons-error {
	margin-top: 10px;
	padding: 10px 14px;
	background: #fde8e8;
	color: #b00;
	border-radius: 6px;
	font-size: .9em;
}

/* Opcja radio z obrazkiem — kafelek jak przy pozycjach */
.ms-radio-opt-tile {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 8px 12px;
	margin: 0 8px 8px 0;
	font-size: .9em;
}

.ms-radio-opt-tile input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ms-radio-opt-tile:has(input:checked) {
	border-color: #111;
	background: #111;
	color: #fff;
}

.ms-radio-opt-tile img {
	display: block;
	width: 64px;
	height: auto;
	border-radius: 4px;
}

/* Lupka + lightbox (natywny <dialog>, zero bibliotek) */
.ms-addon-zoom {
	background: none;
	border: 0;
	padding: 4px;
	cursor: pointer;
	color: #777;
	line-height: 0;
	flex: 0 0 auto;
}

.ms-addon-zoom:hover {
	color: #111;
}

.ms-addons-lightbox {
	border: 0;
	border-radius: 8px;
	padding: 0;
	max-width: 760px;
	width: calc(100% - 32px);
	box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}

.ms-addons-lightbox::backdrop {
	background: rgba(0, 0, 0, .55);
}

.ms-lightbox-cols {
	display: flex;
	gap: 24px;
	padding: 24px;
}

.ms-lightbox-img {
	flex: 1 1 55%;
}

.ms-lightbox-img img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 6px;
}

.ms-lightbox-img img[src=""] {
	display: none;
}

.ms-lightbox-body {
	flex: 1 1 45%;
}

.ms-lightbox-body h4 {
	/* Odstęp od prawej, żeby nagłówek nie wchodził pod przycisk zamykania. */
	margin: 8px 0 10px;
	padding-right: 44px;
}

.ms-lightbox-close {
	position: absolute;
	top: 0;
	right: 0;
	/* Duże pole kliknięcia + z-index nad treścią kolumn (h4 przykrywał X). */
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #555;
	z-index: 10;
}

.ms-lightbox-close:hover {
	color: #000;
}

@media (max-width: 600px) {
	.ms-lightbox-cols {
		flex-direction: column;
	}
}

/* Akordeon "Dobierz dodatki" */
.ms-addons-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 12px 16px;
	background: #111;
	color: #fff;
	border: 0;
	border-radius: 6px;
	font-weight: 600;
	font-size: 1em;
	cursor: pointer;
	text-align: left;
}

.ms-addons-toggle:hover {
	background: #2a2a2a;
}

.ms-addons-arrow {
	transition: transform .2s ease;
	flex: 0 0 auto;
}

.ms-addons-open .ms-addons-arrow {
	transform: rotate(180deg);
}

.ms-addons-panel {
	padding-top: 12px;
}
