/* Додаткові товари до страв (модуль addons v1.2).
 * Темна тема themeXXX: акцент = кнопка «До кошика» (#f46534), ціна = ціна страви (#c59461). */
.addons {
	--ad-accent: #f46534;
	--ad-accent-hover: #ff7a4d;
	--ad-accent-soft: rgba(244, 101, 52, .14);
	--ad-accent-line: rgba(244, 101, 52, .45);
	--ad-accent-text: #ffa07f;
	--ad-price: #d1a272;
	--ad-surface: #121415;
	--ad-surface-2: #1b1e20;
	--ad-surface-3: #262a2d;
	--ad-border: #23272a;
	--ad-divider: #1e2124;
	--ad-control: #3a3f43;
	--ad-muted: #8f9497;
	--ad-text: #f2f2f2;
	--ad-text-2: #b9bcbe;
	--ad-radius: 16px;
	margin: 22px 0 18px;
	display: flex;
	flex-direction: column;
	gap: 22px;
	color: var(--ad-text);
	-webkit-tap-highlight-color: transparent;
}

.addons [hidden] {
	display: none !important;
}

.addons button {
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.addons button:focus-visible {
	outline: 2px solid var(--ad-accent);
	outline-offset: 2px;
}

.ad-section {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ad-h {
	margin: 0;
	font-family: Bitter, Georgia, serif;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ad-text);
	text-transform: none;
	letter-spacing: 0;
}

.ad-hint {
	margin: 0 0 8px;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--ad-muted);
}

.ad-hint b {
	color: var(--ad-text-2);
	font-weight: 600;
}

.ad-price {
	font-size: 14px;
	font-weight: 700;
	color: var(--ad-price);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.ad-name {
	font-size: 14.5px;
	line-height: 1.3;
	color: var(--ad-text);
}

/* ---------- Акордеон «Додати до страви» ---------- */
.ad-acc {
	border-radius: var(--ad-radius);
	background: var(--ad-surface);
	border: 1px solid var(--ad-border);
	overflow: hidden;
}

.ad-acc__group + .ad-acc__group {
	border-top: 1px solid var(--ad-border);
}

.ad-acc__head {
	width: 100%;
	min-height: 64px;
	padding: 12px 16px 12px 18px;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
	text-align: left;
	transition: background .15s;
}

.ad-acc__head:hover {
	background: rgba(255, 255, 255, .025);
}

.ad-acc__title {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.ad-acc__name {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
}

.ad-req {
	color: var(--ad-accent);
}

.ad-acc__sub {
	font-size: 13px;
	line-height: 1.3;
	color: var(--ad-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ad-acc__sub.is-chosen {
	color: var(--ad-accent-text);
}

.ad-acc__sum {
	flex: 0 0 auto;
	padding: 5px 10px;
	border-radius: 999px;
	background: var(--ad-accent-soft);
	color: var(--ad-accent-text);
	font-size: 13px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ad-acc__chev {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--ad-surface-2);
	color: var(--ad-text-2);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform .2s, background .15s;
}

.ad-acc__group.is-open .ad-acc__chev {
	transform: rotate(180deg);
	background: var(--ad-surface-3);
}

.ad-acc__body {
	padding: 0 12px 12px;
}

.ad-acc__body > .ad-hint,
.ad-acc__body > .ad-error {
	padding: 0 6px;
}

.ad-error {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	color: #ff8a80;
}

/* Рядки */
.ad-rows {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ad-row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: 8px 6px;
	border-radius: 12px;
	cursor: pointer;
	transition: background .15s;
}

.ad-row:hover {
	background: rgba(255, 255, 255, .03);
}

.ad-row.is-on {
	background: var(--ad-accent-soft);
}

.ad-thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 10px;
	object-fit: cover;
	background: var(--ad-surface-3);
}

.ad-thumb--empty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(0deg, rgba(209, 162, 114, .10), rgba(209, 162, 114, .10)), var(--ad-surface-2);
	color: var(--ad-price);
	font-family: Bitter, Georgia, serif;
	font-size: 20px;
	font-weight: 700;
}

.ad-row__text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.ad-item.is-on .ad-name {
	font-weight: 700;
}

.ad-more {
	margin: 6px 0 0;
	width: 100%;
	height: 44px;
	border: 1px dashed var(--ad-control);
	border-radius: 12px;
	background: transparent;
	color: var(--ad-text-2);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: border-color .15s, color .15s;
}

.ad-more:hover {
	border-color: var(--ad-accent-line);
	color: var(--ad-text);
}

.ad-more svg {
	transition: transform .2s;
}

.ad-more.is-expanded svg {
	transform: rotate(180deg);
}

/* Перемикачі (сіль, перець) */
.ad-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 6px 4px;
}

.ad-chip {
	min-height: 42px;
	padding: 0 16px 0 12px;
	border-radius: 999px;
	border: 1.5px solid var(--ad-control);
	background: transparent;
	color: inherit;
	font-size: 14px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: border-color .15s, background .15s;
}

.ad-chip__mark {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--ad-surface-3);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
}

.ad-chip.is-on {
	border-color: var(--ad-accent);
	background: var(--ad-accent-soft);
}

.ad-chip.is-on .ad-chip__mark {
	background: var(--ad-accent);
	color: #fff;
}

.ad-chip[disabled] {
	opacity: .4;
	cursor: default;
}

/* ---------- Кнопка «+» → лічильник ---------- */
.ad-ctrl {
	flex: 0 0 auto;
	display: inline-flex;
}

.ad-add {
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 50%;
	border: 1.5px solid var(--ad-accent-line);
	background: transparent;
	color: var(--ad-accent);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s, color .15s, border-color .15s, transform .1s;
}

.ad-add:hover,
.ad-row:hover .ad-add {
	background: var(--ad-accent);
	border-color: var(--ad-accent);
	color: #fff;
}

.ad-add:active {
	transform: scale(.94);
}

.ad-step {
	display: none;
	height: 38px;
	align-items: center;
	border-radius: 999px;
	background: var(--ad-accent);
	color: #fff;
	box-shadow: 0 4px 14px rgba(244, 101, 52, .28);
}

.ad-item.is-on .ad-add {
	display: none;
}

.ad-item.is-on .ad-step {
	display: inline-flex;
}

.ad-step button {
	width: 36px;
	height: 38px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ad-qty {
	min-width: 18px;
	text-align: center;
	font-size: 15px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ad-add[disabled],
.ad-step button[disabled] {
	opacity: .35;
	cursor: default;
}

.ad-add[disabled]:hover {
	background: transparent;
	color: var(--ad-accent);
}

/* ---------- «До замовлення»: згорнута плашка, вкладки і стрічка ---------- */
.ad-acc--extra {
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(244, 101, 52, .10), rgba(244, 101, 52, 0) 55%),
		var(--ad-surface);
}

.ad-extra > .ad-acc__head {
	min-height: 72px;
}

.ad-extra__name {
	font-family: Bitter, Georgia, serif;
	font-size: 18px;
}

/* стос кругленьких фото товарів */
.ad-stack {
	flex: 0 0 auto;
	display: inline-flex;
	padding-left: 10px;
}

.ad-stack > img,
.ad-stack > span {
	width: 40px;
	height: 40px;
	margin-left: -10px;
	border-radius: 50%;
	border: 2px solid var(--ad-surface);
	background: var(--ad-surface-3);
	object-fit: cover;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 700;
	color: var(--ad-price);
}

.ad-extra.is-open .ad-stack {
	opacity: .55;
}

.ad-extra__body {
	padding: 0 16px 14px 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ad-extra__body .ad-hint {
	margin: 0;
}

.ad-extra__body .ad-strip-wrap::before {
	background: linear-gradient(90deg, var(--ad-surface), rgba(18, 20, 21, 0));
}

.ad-extra__body .ad-strip-wrap::after {
	background: linear-gradient(270deg, var(--ad-surface), rgba(18, 20, 21, 0));
}

.ad-extra-head {
	display: flex;
	align-items: center;
	gap: 12px 16px;
	flex-wrap: wrap;
}

.ad-tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	max-width: 100%;
}

.ad-tabs::-webkit-scrollbar {
	display: none;
}

.ad-tab {
	flex: 0 0 auto;
	height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid var(--ad-control);
	background: transparent;
	color: var(--ad-text-2);
	font-size: 13.5px;
	font-weight: 500;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	transition: background .15s, color .15s, border-color .15s;
}

.ad-tab:hover {
	color: var(--ad-text);
	border-color: #555b60;
}

.ad-tab.is-active {
	border-color: var(--ad-text);
	background: var(--ad-text);
	color: #0b0d0e;
}

.ad-badge {
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	box-sizing: border-box;
	border-radius: 9px;
	background: var(--ad-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.ad-strip-wrap {
	position: relative;
}

/* легке затухання по краях, коли є що гортати */
.ad-strip-wrap::before,
.ad-strip-wrap::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 8px;
	width: 28px;
	pointer-events: none;
	opacity: 0;
	transition: opacity .2s;
	z-index: 1;
}

.ad-strip-wrap::before {
	left: 0;
	background: linear-gradient(90deg, #080a0a, rgba(8, 10, 10, 0));
}

.ad-strip-wrap::after {
	right: 0;
	background: linear-gradient(270deg, #080a0a, rgba(8, 10, 10, 0));
}

.ad-strip-wrap.has-more-left::before,
.ad-strip-wrap.has-more-right::after {
	opacity: 1;
}

.ad-strip {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 8px;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.ad-strip::-webkit-scrollbar {
	display: none;
}

.ad-strip__nav {
	position: absolute;
	top: 44px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--ad-control);
	background: rgba(18, 20, 21, .92);
	color: var(--ad-text);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}

.ad-strip__nav--prev {
	left: -10px;
}

.ad-strip__nav--next {
	right: -10px;
}

.ad-card {
	flex: 0 0 148px;
	width: 148px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	scroll-snap-align: start;
}

.ad-card__media {
	position: relative;
	display: block;
	width: 148px;
	height: 111px;
	border-radius: 14px;
	overflow: hidden;
	background: var(--ad-surface-2);
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: border-color .15s;
}

.ad-card.is-on .ad-card__media {
	border-color: var(--ad-accent);
}

.ad-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ad-card__img.ad-thumb--empty {
	display: flex;
	font-size: 34px;
}

/* «+» і лічильник лежать на фото, у правому нижньому куті */
.ad-ctrl--card {
	position: absolute;
	right: 6px;
	bottom: 6px;
}

.ad-ctrl--card .ad-add {
	background: rgba(18, 20, 21, .9);
	border-color: transparent;
	color: var(--ad-text);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.ad-ctrl--card .ad-add:hover,
.ad-card__media:hover .ad-add {
	background: var(--ad-accent);
	color: #fff;
}

.ad-ctrl--card .ad-step {
	height: 36px;
}

.ad-ctrl--card .ad-step button {
	width: 32px;
	height: 36px;
}

.ad-card__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0 2px;
}

.ad-card .ad-name {
	font-size: 13.5px;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- Підсумок ---------- */
.ad-sum {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px;
	border-radius: var(--ad-radius);
	background: var(--ad-surface);
	border: 1px solid var(--ad-border);
	font-size: 14px;
	color: var(--ad-text-2);
}

.ad-sum__line {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-variant-numeric: tabular-nums;
}

.ad-sum__line--total {
	padding-top: 10px;
	border-top: 1px solid var(--ad-border);
	font-size: 17px;
	font-weight: 700;
	color: var(--ad-text);
}

.ad-sum__total {
	color: var(--ad-price);
}

.ad-sum__msg {
	font-weight: 700;
	color: #7bd88f;
}

.ad-sum__msg.is-error {
	color: #ff8a80;
}

.ad-btn-total {
	white-space: nowrap;
}

/* ---------- Нижня панель на телефоні ---------- */
.ad-bar {
	display: none;
}

@media (max-width: 767px) {
	.addons {
		gap: 20px;
	}

	.ad-h {
		font-size: 20px;
	}

	.ad-acc__head {
		min-height: 62px;
		padding: 12px 12px 12px 14px;
		gap: 10px;
	}

	.ad-acc__body {
		padding: 0 8px 10px;
	}

	.ad-row {
		gap: 10px;
		padding: 8px 6px;
	}

	.ad-thumb {
		flex-basis: 52px;
		width: 52px;
		height: 52px;
	}

	.ad-add {
		width: 44px;
		height: 44px;
	}

	.ad-step {
		height: 44px;
	}

	.ad-step button {
		width: 40px;
		height: 44px;
	}

	.ad-row:hover {
		background: transparent;
	}

	.ad-row.is-on {
		background: var(--ad-accent-soft);
	}

	.ad-row:hover .ad-add {
		background: transparent;
		color: var(--ad-accent);
		border-color: var(--ad-accent-line);
	}

	.ad-chip,
	.ad-tab {
		min-height: 44px;
		height: auto;
	}

	.ad-strip__nav {
		display: none !important;
	}

	/* стрічка заходить під край плашки — видно, що її можна гортати */
	.ad-extra__body {
		padding: 0 0 12px 14px;
	}

	.ad-extra__body .ad-hint {
		padding-right: 14px;
	}

	.ad-strip {
		padding-right: 14px;
	}

	.ad-extra__name {
		font-size: 17px;
	}

	.ad-stack > img,
	.ad-stack > span {
		width: 36px;
		height: 36px;
	}

	.ad-strip-wrap::after {
		display: none;
	}

	.ad-card {
		flex-basis: 136px;
		width: 136px;
	}

	.ad-card__media {
		width: 136px;
		height: 102px;
	}

	.ad-ctrl--card .ad-add {
		width: 40px;
		height: 40px;
	}

	.ad-bar.is-visible {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1000;
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
		background: rgba(14, 16, 17, .97);
		border-top: 1px solid #2a2e31;
		box-shadow: 0 -8px 24px rgba(0, 0, 0, .5);
		animation: ad-bar-in .2s ease-out;
	}

	@keyframes ad-bar-in {
		from { transform: translateY(100%); }
		to { transform: translateY(0); }
	}

	.ad-bar__info {
		flex: 0 0 auto;
		display: flex;
		flex-direction: column;
		gap: 1px;
		min-width: 0;
	}

	.ad-bar__count {
		font-size: 12px;
		color: var(--ad-muted);
		white-space: nowrap;
	}

	.ad-bar__total {
		font-size: 19px;
		font-weight: 700;
		color: #fff;
		font-variant-numeric: tabular-nums;
	}

	.ad-bar__btn {
		flex: 1 1 auto;
		height: 50px;
		border: 0;
		border-radius: 12px;
		background: var(--ad-accent);
		color: #fff;
		font-size: 15px;
		font-weight: 700;
		letter-spacing: .03em;
		text-transform: uppercase;
		cursor: pointer;
	}

	/* кнопка теми «нагору» піднімається над панеллю */
	body.ad-bar-on #back_to_top {
		bottom: 76px !important;
	}

	body.ad-bar-on {
		padding-bottom: 76px;
	}
}

@media (hover: none) {
	.ad-row:hover,
	.ad-acc__head:hover {
		background: transparent;
	}

	.ad-row.is-on {
		background: var(--ad-accent-soft);
	}
}

@media (prefers-reduced-motion: reduce) {
	.addons *,
	.ad-bar.is-visible {
		transition: none !important;
		animation: none !important;
	}
}

/* Таблиці опцій теми, які показує акордеон (поля лишаються у формі для кошика) */
.ad-orig-hidden {
	display: none !important;
}

/* v1.3: рядки підсумку не показуємо — сума є на кнопці «До кошика»; блок лише для повідомлень */
.ad-sum__line {
	display: none !important;
}

.ad-stack > img,
.ad-stack > span {
	flex: 0 0 auto;
	max-width: none !important;
}
