/* ==========================================================================
   Fajr — вариант 2 «В стиле заведения».
   День: белый мрамор, светлое дерево, чёрные акценты, как фасад и подносы.
   Вечер: эспрессо и тёмное дерево. Цены — цвет ободка их керамики.
   ========================================================================== */

:root {
	--bg: #f5f2ed;
	--vein: rgba(110, 100, 90, 0.07);
	--card: #fffdf9;
	--ink: #1b1a18;
	--muted: #6a645c;
	--oak: #b8895a;
	--price: #83532a;
	--line: #e8e1d6;
	--button: #1b1a18;
	--button-ink: #fbf8f3;
	--card-shadow: 0 1px 2px rgba(27, 26, 24, 0.04), 0 8px 24px rgba(27, 26, 24, 0.06);
	--photo-shadow: drop-shadow(0 8px 12px rgba(27, 26, 24, 0.16));

	--font-head: "Cormorant Garamond", Georgia, serif;
	--font-body: "Manrope", "Segoe UI", sans-serif;
	--wrap: 680px;
	--top: 118px;
	color-scheme: light;
}

:root[data-theme="dark"] {
	--bg: #15120f;
	--vein: rgba(255, 245, 230, 0.035);
	--card: #1f1b17;
	--ink: #eee7db;
	--muted: #b0a695;
	--oak: #c99d6e;
	--price: #dcac79;
	--line: #332d26;
	--button: #eee7db;
	--button-ink: #15120f;
	--card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
	--photo-shadow: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
	color-scheme: dark;
}

:lang(ar) {
	--font-head: "Amiri", "Geeza Pro", serif;
	--font-body: "IBM Plex Sans Arabic", "Geeza Pro", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }

/* мрамор: светлая основа и несколько тонких прожилок */
body {
	margin: 0;
	min-height: 100vh;
	padding-bottom: calc(96px + env(safe-area-inset-bottom));
	background-color: var(--bg);
	background-image:
		linear-gradient(118deg, transparent 0 34%, var(--vein) 34.6%, transparent 35.6%),
		linear-gradient(152deg, transparent 0 58%, var(--vein) 58.4%, transparent 59.2%),
		linear-gradient(101deg, transparent 0 76%, var(--vein) 76.3%, transparent 77%);
	background-attachment: fixed;
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 15px;
	line-height: 1.5;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--oak); outline-offset: 2px; }

/* ---------- шапка ---------- */

.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--bg);
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--line);
}

.topbar-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 12px 16px 6px;
}

.brand { display: flex; flex-direction: column; line-height: 1; text-decoration: none; }
.brand-name { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 24px; letter-spacing: 0.14em; }
.brand-underscore { color: var(--oak); }
.brand-sub { margin-top: 4px; font-family: "Manrope", sans-serif; font-size: 8.5px; font-weight: 600; letter-spacing: 0.1em; white-space: nowrap; color: var(--muted); }

.controls { display: flex; align-items: center; gap: 6px; }

.lang { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.lang button {
	min-width: 34px;
	height: 32px;
	padding: 0 8px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	font-family: "Manrope", sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--button); color: var(--button-ink); }

.theme {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--card);
	cursor: pointer;
}

.nav {
	display: flex;
	gap: 18px;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 6px 16px 0;
	overflow-x: auto;
	scrollbar-width: none;
	scroll-padding-inline: 16px;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
	flex: none;
	padding: 6px 0 10px;
	border-bottom: 2px solid transparent;
	color: var(--muted);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.nav a[aria-current="true"] { border-bottom-color: var(--oak); color: var(--ink); }

/* ---------- вступление ---------- */

main { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

.intro { display: flex; align-items: center; gap: 14px; padding: 20px 0 2px; }
.halal {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border: 1px solid var(--oak);
	border-radius: 50%;
	color: var(--oak);
	font-family: "Manrope", sans-serif;
	font-size: 8px;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1;
}
.halal span { margin-bottom: 2px; font-family: "Amiri", serif; font-size: 17px; letter-spacing: 0; }
.intro-text { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- разделы ---------- */

.section { padding: 34px 0 6px; scroll-margin-top: var(--top); }

/* латинское слово раздела — тонкая подпись над заголовком */
.section-mark {
	display: block;
	margin-bottom: 2px;
	color: var(--oak);
	font-family: "Manrope", sans-serif;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.34em;
}
.section-head { margin-bottom: 14px; }
.section-title {
	margin: 0;
	font-family: var(--font-head);
	font-size: clamp(38px, 11vw, 50px);
	font-weight: 600;
	line-height: 1.05;
}
.section-title::after {
	content: "";
	display: block;
	width: 44px;
	height: 2px;
	margin-top: 10px;
	background: var(--oak);
}

.group + .group { margin-top: 28px; }
.group-title { margin: 0 0 10px; font-family: var(--font-head); font-size: 26px; font-weight: 600; }

.cover { width: min(100%, 300px); height: auto; margin: 0 auto 14px; filter: var(--photo-shadow); }

/* ---------- карточки блюд: по две в ряд ---------- */

.items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.item.has-photo {
	display: flex;
	flex-direction: column;
	padding: 12px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: var(--card);
	box-shadow: var(--card-shadow);
}
.item-photo { width: 100%; height: 120px; margin-bottom: 8px; object-fit: contain; filter: var(--photo-shadow); }
.item-body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.item-name { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
:lang(ar) .item-name { font-size: 16px; }

.item-desc {
	display: -webkit-box;
	margin: 4px 0 0;
	overflow: hidden;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.4;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	cursor: pointer;
}
.item-desc.open { display: block; overflow: visible; }

.badge {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 8px;
	border: 1px solid var(--oak);
	border-radius: 999px;
	color: var(--oak);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	vertical-align: middle;
}

.buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: auto; padding-top: 10px; }
.price-wrap { display: flex; flex-direction: column; line-height: 1.2; }
.price { color: var(--price); font-size: 16px; font-weight: 800; white-space: nowrap; }
.unit { color: var(--muted); font-size: 11px; }
.approx { color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; }

.add {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--button);
	color: var(--button-ink);
	cursor: pointer;
}
.add:active, .stepper button:active { transform: scale(0.94); }

.stepper { display: inline-flex; flex: none; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.stepper button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; background: transparent; cursor: pointer; }
.stepper output { min-width: 26px; font-size: 14px; font-weight: 800; text-align: center; white-space: nowrap; }
.stepper svg { width: 17px; height: 17px; }

.variants { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.variant { padding-top: 6px; border-top: 1px solid var(--line); }
.variant-name { display: block; font-size: 12.5px; font-weight: 600; }
.variant .buy { margin-top: 0; padding-top: 4px; }

/* ---------- позиции без фото: строки на всю ширину ---------- */

.item:not(.has-photo) { grid-column: 1 / -1; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.item:not(.has-photo) .item-body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.item:not(.has-photo) .item-text { flex: 1 1 150px; min-width: 0; }
.item:not(.has-photo) .item-desc { display: block; overflow: visible; cursor: auto; }
.item:not(.has-photo) .item-body > .buy { flex-wrap: nowrap; margin: 0; margin-inline-start: auto; padding-top: 0; }
.item:not(.has-photo) .price-wrap { align-items: flex-end; text-align: end; }
.item:not(.has-photo) .variants { flex-basis: 100%; margin-top: 0; }
.item:not(.has-photo) .variant { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item:not(.has-photo) .variant-name { font-size: 13.5px; }
.item:not(.has-photo) .variant .buy { flex-wrap: nowrap; }

/* группа целиком из строк — в одной карточке, как лист меню */
.group--list .items {
	gap: 0;
	padding: 2px 16px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: var(--card);
	box-shadow: var(--card-shadow);
}
.group--list .item:last-child { border-bottom: 0; }

/* ---------- подвал ---------- */

.footer {
	max-width: var(--wrap);
	margin: 40px auto 0;
	padding: 24px 16px 0;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 13px;
	text-align: center;
}
.footer p { margin: 0 0 6px; }
.footer a { color: var(--ink); font-weight: 700; }
.footer-brand { color: var(--ink); font-family: "Manrope", sans-serif; font-size: 15px; font-weight: 800; letter-spacing: 0.14em; }
.demo-note { margin-top: 14px !important; font-size: 11px; }

/* ---------- панель «Мой заказ» ---------- */

.orderbar {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 30;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	background: linear-gradient(to top, var(--bg) 55%, transparent);
}
.orderbar-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	max-width: calc(var(--wrap) - 32px);
	min-height: 56px;
	margin: 0 auto;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--button);
	color: var(--button-ink);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.orderbar-icon { display: grid; place-items: center; }
.orderbar-count {
	margin-inline-start: auto;
	display: grid;
	place-items: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--oak);
	color: #fff;
	font-size: 12px;
}

/* ---------- окно заказа ---------- */

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(15, 12, 10, 0.5); }

.sheet {
	width: 100%;
	max-width: var(--wrap);
	max-height: 88vh;
	margin: auto auto 0;
	padding: 0;
	border: 0;
	border-radius: 24px 24px 0 0;
	background: var(--card);
}
.sheet-inner { display: flex; flex-direction: column; max-height: 88vh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 6px; }
.sheet-head h2 { margin: 0; font-family: var(--font-head); font-size: 34px; font-weight: 600; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }

#order-lines { padding: 0 20px; overflow-y: auto; }
.line {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: "text sum" "text stepper";
	align-items: center;
	gap: 6px 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
}
.line-text { grid-area: text; display: flex; flex-direction: column; }
.line-name { font-weight: 700; }
.line-variant { color: var(--muted); font-size: 13px; }
.line .stepper { grid-area: stepper; justify-self: end; }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }

.sheet-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.approx-note { margin: 0 0 8px; color: var(--muted); font-size: 12px; }

.primary, .secondary { display: block; width: 100%; min-height: 52px; border-radius: 999px; font-size: 15px; font-weight: 700; cursor: pointer; }
.primary { border: 0; background: var(--button); color: var(--button-ink); }
.primary:disabled { opacity: 0.4; cursor: default; }
.secondary { margin-top: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); }

/* ---------- экран для официанта ---------- */

.waiter {
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fbf8f3;
	color: #1b1a18;
}
.waiter-inner {
	display: flex;
	flex-direction: column;
	max-width: var(--wrap);
	height: 100%;
	margin: 0 auto;
	padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
	font-family: "Manrope", sans-serif;
}
.waiter h2 { margin: 0 0 10px; font-family: "Cormorant Garamond", serif; font-size: 46px; font-weight: 600; }
.waiter-list { flex: 1; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.waiter-list li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #e8e1d6; font-size: 22px; line-height: 1.25; }
.w-qty { flex: none; min-width: 78px; font-weight: 800; }
.w-name { font-weight: 600; }
.w-local { display: block; margin-top: 3px; color: #6a645c; font-size: 15px; font-weight: 500; }
.waiter .primary { background: #1b1a18; color: #fbf8f3; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* ---------- суммы: в окне заказа и на экране официанта ---------- */

.line-unit { color: var(--muted); font-size: 12px; }
.line-sum { grid-area: sum; justify-self: end; color: var(--price); font-weight: 800; white-space: nowrap; }
.total-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; font-size: 16px; }
.total-row strong { color: var(--price); font-size: 24px; font-weight: 800; }
.waiter-total { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 0; font-size: 22px; font-weight: 700; }
.waiter-total strong { font-size: 32px; font-weight: 800; }

/* ---------- кнопка «Скрыть цены»: размывает все цены на сайте ---------- */

.theme[aria-pressed="true"] { border-color: var(--button); background: var(--button); color: var(--button-ink); }
.price, .approx, .line-sum, .line-unit bdi, .total { transition: filter 0.2s ease; }
:root[data-prices="hidden"] :is(.price, .approx, .line-sum, .line-unit bdi, .total) {
	filter: blur(7px);
	-webkit-user-select: none;
	user-select: none;
}

.toast {
	position: fixed;
	top: calc(var(--top) + 10px);
	left: 50%;
	z-index: 40;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--button);
	color: var(--button-ink);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	transform: translateX(-50%);
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.price, .approx, .line-sum, .line-unit bdi, .total { transition: none; }
}

/* ---------- мангал и пиццы: картинки на всю ширину экрана ---------- */
/* края, срезанные ещё на печатной странице, плавно растворяются в фоне */

.hero, .banner { position: relative; z-index: 1; margin-inline: -16px; }
.banner { margin-top: 2px; margin-bottom: 6px; }
.hero { margin-bottom: 8px; }
.hero-img, .banner-img {
	display: block;
	width: 100%;
	height: auto;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, #000 76%, transparent);
	-webkit-mask-composite: source-in;
	mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, #000 76%, transparent);
	mask-composite: intersect;
}
[dir="rtl"] .hero-img { transform: scaleX(-1); }   /* пустой угол для заголовка — справа */

.hero-head { position: absolute; top: 2%; inset-inline-start: 16px; max-width: 54%; }
.hero-price {
	position: absolute;
	bottom: 10%;
	inset-inline-end: 16px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	margin: 0;
	line-height: 1.1;
	text-align: end;
}
.hero-note { color: var(--muted); font-size: 13px; font-weight: 600; }
.hero-price .price { font-size: 34px; }

@media (min-width: 700px) {
	.hero, .banner { margin-inline: 0; }
}

.section--hero > .section-mark { display: none; }
.hero-mark {
	display: block;
	margin-bottom: 2px;
	color: var(--oak);
	font-family: "Manrope", sans-serif;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.34em;
}
.hero-price .price { font-size: 30px; }

/* у пицц срез только по самому краю — растворяем меньше, чтобы нижняя пицца не бледнела */
.hero-img {
	-webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, #000 90%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, #000 90%, transparent);
}
.hero-price { bottom: 4%; }
