/*
Theme Name: Krama
Description: Гучна бюджетна вітрина: товар списком, ціна головний герой, замовлення в один екран. Працює з плагіном Ager Shop.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: krama
*/

:root {
	--ink: #16161a;
	--paper: #ffffff;
	--card: #ffffff;
	--red: #c62a1d;
	--red-soft: #fdecea;
	--yellow: #fff3c4;
	--yellow-ink: #6b5200;
	--line: #e0e0e3;
	--muted: #6c6c74;
	--wrap: 1200px;
	--mono: ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: "Rubik", system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.display { font-family: "Oswald", "Rubik", sans-serif; font-weight: 600; letter-spacing: 0; }

/* ---------- Шапка ---------- */

.head {
	background: var(--red);
	color: #fff;
	position: sticky;
	top: 0;
	z-index: 40;
}

.head__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; }

.head__brand {
	font-family: "Oswald", sans-serif;
	font-size: 22px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: #fff;
	text-decoration: none;
}

.head__tel { color: #fff; text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }

/* ---------- Стрічка переваг ---------- */

.strip { background: var(--yellow); color: var(--yellow-ink); }

.strip__in {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 9px 0;
	font-size: 13.5px;
	font-weight: 500;
	white-space: nowrap;
}

.strip__in::-webkit-scrollbar { display: none; }
.strip a { color: var(--yellow-ink); }

/* ---------- Заголовок ---------- */

.lead { padding: 20px 0 14px; }
.lead h1 { margin: 0 0 6px; font-size: clamp(24px, 6vw, 38px); line-height: 1.08; text-transform: uppercase; }
.lead p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* ---------- Фільтри ---------- */

.bar {
	position: sticky;
	top: 54px;
	z-index: 30;
	background: var(--paper);
	border-bottom: 2px solid var(--ink);
	padding: 10px 0;
	margin-bottom: 14px;
}

.bar__in { display: flex; gap: 7px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.bar__in::-webkit-scrollbar { display: none; }

.bar__label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); flex: none; }

.chip {
	flex: none;
	appearance: none;
	background: #fff;
	border: 2px solid var(--line);
	border-radius: 0;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	padding: 6px 12px;
	cursor: pointer;
	color: var(--ink);
	min-height: 36px;
}

.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.bar select, .bar input[type="search"] {
	flex: none;
	font: inherit;
	font-size: 14px;
	padding: 7px 10px;
	border: 2px solid var(--line);
	background: #fff;
	color: var(--ink);
	min-height: 36px;
}

.bar input[type="search"] { width: 130px; }

/* ---------- Список товарів ---------- */

.rows { display: flex; flex-direction: column; gap: 0; padding-bottom: 40px; }

.row {
	display: grid;
	grid-template-columns: 104px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
	text-align: left;
	background: none;
	border-left: 0; border-right: 0; border-top: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	width: 100%;
}

.row:hover { background: #fafafa; }

.row__ph { position: relative; width: 104px; aspect-ratio: 1/1; background: #f1f1f3; overflow: hidden; }
.row__ph img { width: 100%; height: 100%; object-fit: cover; }

.row__sale {
	position: absolute; top: 0; left: 0;
	background: var(--yellow); color: var(--yellow-ink);
	font-size: 11px; font-weight: 600; padding: 2px 7px;
	text-transform: uppercase;
}

.row__mid { min-width: 0; }
.row__name { font-size: 15px; line-height: 1.35; margin: 0 0 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row__sizes { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.row__out { font-size: 12px; color: var(--red); font-weight: 500; }

.row__right { text-align: right; }
.row__price { font-family: "Oswald", sans-serif; font-size: 23px; font-weight: 600; color: var(--red); line-height: 1; margin-bottom: 7px; }

.row__go {
	display: inline-block;
	background: var(--ink);
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	text-transform: uppercase;
	padding: 7px 13px;
	white-space: nowrap;
}

@media (min-width: 760px) {
	.rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
	.row { grid-template-columns: 1fr; border: 2px solid var(--line); padding: 0; align-items: stretch; }
	.row:hover { background: #fff; border-color: var(--red); }
	.row__ph { width: 100%; }
	.row__mid { padding: 11px 12px 0; }
	.row__right { text-align: left; padding: 0 12px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
	.row__price { margin: 0; font-size: 26px; }
}

.count { font-size: 13px; color: var(--muted); flex: none; margin-left: auto; }
.empty { padding: 44px 0; text-align: center; color: var(--muted); }

/* ---------- Картка товару ---------- */

.sheet { position: fixed; inset: 0; z-index: 60; display: none; }
.sheet[data-open="1"] { display: block; }
.sheet__veil { position: absolute; inset: 0; background: rgba(22, 22, 26, .6); }

.sheet__box {
	position: absolute; inset: 0;
	background: #fff;
	overflow-y: auto;
	padding-bottom: 86px;
}

@media (min-width: 760px) {
	.sheet__box {
		inset: 50% auto auto 50%;
		transform: translate(-50%, -50%);
		width: min(940px, 94vw);
		max-height: 90vh;
		border: 3px solid var(--ink);
		padding-bottom: 0;
	}
	.sheet__grid { display: grid; grid-template-columns: 1fr 1fr; }
}

.sheet__close {
	position: absolute; top: 8px; right: 8px; z-index: 2;
	background: var(--ink); color: #fff; border: 0;
	font: inherit; font-size: 22px; line-height: 1;
	width: 40px; height: 40px; cursor: pointer;
}

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.shots img { aspect-ratio: 1/1; object-fit: cover; background: #f1f1f3; }

.sheet__body { padding: 16px 14px 20px; }
@media (min-width: 760px) { .sheet__body { padding: 22px; } }

.sheet__name { font-size: 19px; line-height: 1.28; margin: 0 0 6px; font-weight: 500; padding-right: 44px; }
.sheet__code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: #f4f4f6; padding: 2px 7px; display: inline-block; margin-bottom: 12px; }
.sheet__price { font-family: "Oswald", sans-serif; font-size: 36px; font-weight: 600; color: var(--red); line-height: 1; margin: 0 0 16px; }
.sheet__price small { font-size: 14px; font-weight: 400; color: var(--muted); font-family: "Rubik", sans-serif; }

.label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 7px; }

.sizes { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }

.size {
	appearance: none;
	min-width: 54px;
	min-height: 44px;
	background: #fff;
	border: 2px solid var(--line);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	color: var(--ink);
	padding: 8px 12px;
}

.size[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.size--out { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--red); }
.size--out:hover { border-color: var(--red); }
.size--color { min-width: 0; font-weight: 400; }

.desc { font-size: 14.5px; color: #3a3a40; margin: 0 0 16px; }

/* ---------- Замовлення ---------- */

.order { border: 2px solid var(--ink); border-top-width: 5px; border-top-color: var(--red); padding: 14px; }
.order h3 { margin: 0 0 3px; font-size: 16px; font-weight: 600; text-transform: uppercase; }
.order p.hint { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }

.order input, .order textarea {
	width: 100%;
	font: inherit;
	font-size: 16px;
	padding: 12px;
	border: 2px solid var(--line);
	background: #fff;
	color: var(--ink);
	margin-bottom: 8px;
	min-height: 46px;
}

.order input:focus, .order textarea:focus { border-color: var(--red); outline: none; }
.order textarea { min-height: 60px; resize: vertical; }
.hp { position: absolute; left: -9999px; }

.btn {
	width: 100%;
	min-height: 50px;
	appearance: none;
	background: var(--red);
	color: #fff;
	border: 0;
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .03em;
	cursor: pointer;
}

.btn:disabled { opacity: .55; }
.btn--dark { background: var(--ink); }
.btn--ghost { background: #fff; color: var(--ink); border: 2px solid var(--ink); }

.note { margin: 9px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

.bundle { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; margin: 2px 0 12px; cursor: pointer; color: var(--yellow-ink); background: var(--yellow); padding: 9px 11px; }
.bundle input { margin-top: 3px; flex: none; }

.msg { margin: 10px 0 0; padding: 10px 12px; font-size: 14.5px; }
.msg--ok { background: var(--red-soft); color: var(--red); }
.msg--err { background: #fff0ee; color: var(--red); }

.promo { background: var(--yellow); color: var(--yellow-ink); padding: 10px 14px; font-size: 14.5px; font-weight: 500; margin-bottom: 14px; }

/* ---------- Запит розміру ---------- */

.wait { background: #f4f4f6; padding: 12px; margin-bottom: 16px; }
.wait p { margin: 0 0 9px; font-size: 14px; }
.wait__row { display: flex; gap: 7px; flex-wrap: wrap; }
.wait__row input { flex: 1 1 130px; margin: 0; }
.wait__row .btn { width: auto; flex: 0 0 auto; padding: 0 16px; min-height: 46px; }

/* ---------- Схожі ---------- */

.similar { margin-top: 20px; padding-top: 16px; border-top: 2px solid var(--line); }
.similar__t { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.similar__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.similar__i { text-decoration: none; color: var(--ink); font-size: 12.5px; }
.similar__i img { aspect-ratio: 1/1; object-fit: cover; background: #f1f1f3; margin-bottom: 4px; }
.similar__i b { font-family: "Oswald", sans-serif; color: var(--red); font-size: 14px; }

/* ---------- Липка панель на телефоні ---------- */

.stick {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
	background: #fff; border-top: 2px solid var(--ink);
	padding: 10px 14px;
	display: none;
}

.sheet[data-open="1"] ~ .stick { display: block; }
@media (min-width: 760px) { .sheet[data-open="1"] ~ .stick { display: none; } }

/* ---------- Підвал ---------- */

.foot { background: var(--ink); color: #d5d5da; padding: 24px 0 34px; font-size: 14px; margin-top: 20px; }
.foot a { color: #fff; }
.foot ul { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- Сторінки ---------- */

.page { padding: 22px 0 44px; }
.page__in { max-width: 740px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.page h1 { font-family: "Oswald", sans-serif; font-size: clamp(24px, 5vw, 34px); text-transform: uppercase; margin: 0 0 18px; }
.prose { font-size: 16px; line-height: 1.65; }
.prose h2 { font-family: "Oswald", sans-serif; text-transform: uppercase; font-size: 19px; margin: 26px 0 9px; padding-top: 16px; border-top: 2px solid var(--line); }
.prose h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose ul, .prose ol { padding-left: 20px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 18px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: #f4f4f6; }
.prose mark.todo { background: var(--yellow); color: var(--yellow-ink); padding: 1px 5px; }

/* ---------- Telegram ---------- */

.tg {
	position: fixed; right: 12px; bottom: 12px; z-index: 50;
	display: flex; align-items: center; gap: 6px;
	background: var(--ink); color: #fff; text-decoration: none;
	font-size: 13.5px; font-weight: 500; line-height: 1;
	padding: 9px 13px 9px 10px;
}

.tg svg { width: 17px; height: 17px; fill: currentColor; }
.sheet[data-open="1"] ~ .tg { display: none; }
@media (max-width: 520px) { .tg span { display: none; } .tg { padding: 10px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
