/*
Theme Name: Kvartal
Description: Три входи замість спільної вітрини: жіноче, чоловіче й дитяче живуть окремо, кожен розділ має свій колір. Мозаїчна сітка, великий шрифт. Працює з плагіном Ager Shop.
Version: 1.1.0
Requires PHP: 7.4
Text Domain: kvartal
*/

:root {
	--ink: #191614;
	--paper: #fcfbfa;
	--card: #ffffff;
	--line: #e6e1dc;
	--muted: #5f5852;
	--flag: #b03030;
	--tag: #f3efeb;

	/* Колір поточного розділу. Підміняється класом на body. */
	--hue: #191614;
	--hue-soft: #f2efed;

	--radius: 3px;
	--wrap: 1320px;
	--mono: ui-monospace, Menlo, Consolas, monospace;
}

body.sec-zhinkam    { --hue: #8e2a56; --hue-soft: #fbeef4; }
body.sec-cholovikam { --hue: #1b4552; --hue-soft: #eaf2f4; }
body.sec-dityam     { --hue: #6b4ba8; --hue-soft: #f1ecfa; }
body.sec-unisex     { --hue: #4a4540; --hue-soft: #f2efed; }

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

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

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

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

.display {
	font-family: "Unbounded", "Onest", sans-serif;
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.02;
}

/* ---------- Шапка з розділами ---------- */

.head { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 40; }

.head__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; }

.head__brand {
	font-family: "Unbounded", sans-serif;
	font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
	color: var(--ink); text-decoration: none; text-transform: uppercase;
}

.head__tel { color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500; white-space: nowrap; }

/* Вкладки розділів — головна навігація сайту */
.tabs { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tab {
	flex: none;
	padding: 12px 20px 11px;
	font-size: 15px; font-weight: 500;
	color: var(--muted); text-decoration: none;
	border-bottom: 3px solid transparent;
	white-space: nowrap;
	min-height: 44px;
	display: flex; align-items: center; gap: 7px;
}

.tab:hover { color: var(--ink); }
.tab em { font-style: normal; font-size: 12.5px; color: var(--muted); }

.tab[aria-current="page"] { color: var(--hue); border-bottom-color: var(--hue); font-weight: 600; }
.tab[aria-current="page"] em { color: var(--hue); opacity: .7; }

/* ---------- Три входи на головній ---------- */

.doors { padding: 26px 0 50px; }

.doors__lead { max-width: 22ch; margin: 0 0 8px; font-size: clamp(30px, 6.5vw, 60px); }
.doors__sub { margin: 0 0 30px; color: var(--muted); font-size: 17px; max-width: 46ch; }

.doors__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .doors__grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.door {
	position: relative;
	display: block;
	text-decoration: none;
	color: #fff;
	background: var(--door);
	border-radius: var(--radius);
	overflow: hidden;
	min-height: 220px;
	padding: 22px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	transition: transform .18s;
}

@media (min-width: 720px) { .door { min-height: 340px; } }

.door:hover { transform: translateY(-3px); }

.door__pic { position: absolute; inset: 0; opacity: .42; }
.door__pic img { width: 100%; height: 100%; object-fit: cover; }

.door__body { position: relative; }
.door__name { font-family: "Unbounded", sans-serif; font-weight: 600; font-size: clamp(22px, 4vw, 32px); letter-spacing: -0.03em; margin: 0 0 4px; }
.door__n { font-size: 14px; opacity: .85; }

.door--zhinkam { --door: #8e2a56; }
.door--cholovikam { --door: #1b4552; }
.door--dityam { --door: #6b4ba8; }
.door--unisex { --door: #4a4540; }

/* ---------- Заголовок розділу ---------- */

.sect { padding: 30px 0 18px; }
.sect h1 { margin: 0 0 6px; font-size: clamp(30px, 6vw, 54px); }
.sect p { margin: 0; color: var(--muted); font-size: 16px; }

.promo {
	margin: 18px 0 0; padding: 11px 15px;
	background: var(--hue-soft); color: var(--hue);
	border-radius: var(--radius); font-size: 14.5px;
}

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

.bar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 20px; }
.bar__in { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bar__label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 3px; }

.chip {
	appearance: none; background: transparent;
	border: 1px solid var(--line); border-radius: 99px;
	font: inherit; font-size: 14px; padding: 8px 15px; min-height: 40px;
	cursor: pointer; color: var(--ink);
}

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

.bar select, .bar input[type="search"] {
	font: inherit; font-size: 14px; padding: 8px 12px; min-height: 40px;
	border: 1px solid var(--line); border-radius: 99px;
	background: var(--card); color: var(--ink);
}

.bar #sizeFilter { max-width: 200px; }
.count { font-size: 13px; color: var(--muted); margin-left: auto; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- Мозаїчна сітка ---------- */

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

@media (min-width: 720px) { .mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Кожен пʼятий товар займає дві клітинки — сітка перестає бути монотонною */
@media (min-width: 720px) {
	.mosaic > [data-item]:nth-child(9n+1) { grid-column: span 2; grid-row: span 2; }
	.mosaic > [data-item]:nth-child(9n+1) .card__ph { aspect-ratio: 1 / 1; }
	.mosaic > [data-item]:nth-child(9n+1) .card__name { font-size: 16px; }
	.mosaic > [data-item]:nth-child(9n+1) .card__price { font-size: 22px; }
}

.card {
	position: relative; width: 100%; height: 100%;
	display: flex; flex-direction: column;
	background: var(--card); border: 1px solid var(--line);
	border-radius: var(--radius); overflow: hidden;
	padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
	transition: border-color .15s;
}

.card:hover { border-color: var(--hue); }

.card__ph { position: relative; aspect-ratio: 3 / 4; background: var(--tag); flex: 1; }
.card__ph img { width: 100%; height: 100%; object-fit: cover; }

.card__tag {
	position: absolute; top: 9px; left: 9px;
	background: var(--flag); color: #fff;
	font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
}

.card__out {
	position: absolute; inset: auto 0 0 0;
	background: rgba(25, 22, 20, .8); color: #fff;
	font-size: 12px; text-align: center; padding: 5px;
}

.card__body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 5px; }
.card__price { font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 17px; letter-spacing: -0.03em; }
.card__name { font-size: 13.5px; line-height: 1.35; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__sizes { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

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

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

.sheet__box {
	position: absolute; left: 0; right: 0; bottom: 0;
	max-height: 93vh; overflow-y: auto;
	background: var(--card); border-radius: 14px 14px 0 0; padding: 18px 16px 28px;
}

@media (min-width: 760px) {
	.sheet__box {
		top: 50%; left: 50%; right: auto; bottom: auto;
		transform: translate(-50%, -50%);
		width: min(940px, 93vw); max-height: 88vh;
		border-radius: 6px; padding: 26px;
	}
	.sheet__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
}

.sheet__close {
	position: absolute; top: 12px; right: 12px;
	background: var(--tag); color: var(--ink); border: 0; border-radius: 50%;
	width: 40px; height: 40px; font-size: 20px; line-height: 1; cursor: pointer;
}

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 18px; }
.shots img { aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius); background: var(--tag); }
@media (min-width: 760px) { .shots { margin-bottom: 0; } }

.sheet__body { padding: 0; }
.sheet__name { font-size: 20px; line-height: 1.28; margin: 0 0 6px; padding-right: 46px; font-weight: 500; }
.sheet__code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: var(--tag); padding: 3px 8px; border-radius: 3px; display: inline-block; margin-bottom: 14px; }
.sheet__price { font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 30px; letter-spacing: -0.03em; margin: 0 0 18px; }
.sheet__price small { font-family: "Onest", sans-serif; font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }

.label { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.size {
	appearance: none; min-width: 54px; min-height: 44px;
	background: var(--card); border: 1px solid var(--line); border-radius: 99px;
	font: inherit; font-size: 14.5px; font-weight: 500; color: var(--ink); cursor: pointer; padding: 9px 14px;
}

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

.desc { font-size: 14.5px; color: #4a443f; margin: 0 0 18px; }
.row__sizes { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

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

.order { background: var(--hue-soft); border-radius: var(--radius); padding: 16px; }
.order h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.order .hint { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }

.order input, .order textarea {
	width: 100%; font: inherit; font-size: 16px;
	padding: 12px 14px; min-height: 46px;
	border: 1px solid var(--line); border-radius: var(--radius);
	background: var(--card); color: var(--ink); margin-bottom: 9px;
}

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

.btn {
	width: 100%; min-height: 52px; appearance: none;
	background: var(--hue); color: #fff; border: 0; border-radius: 99px;
	font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}

.btn:disabled { opacity: .55; }
.btn--ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn--dark { background: var(--ink); }

.note { margin: 10px 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: 3px 0 13px; cursor: pointer; color: var(--hue); }
.bundle input { margin-top: 3px; flex: none; }

.msg { margin: 11px 0 0; padding: 10px 13px; border-radius: var(--radius); font-size: 14.5px; }
.msg--ok { background: var(--hue-soft); color: var(--hue); }
.msg--err { background: #fbeceb; color: var(--flag); }

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

.wait { background: var(--tag); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.wait p { margin: 0 0 10px; font-size: 14px; }
.wait__row { display: flex; gap: 8px; flex-wrap: wrap; }
.wait__row input { flex: 1 1 140px; margin: 0; }
.wait__row .btn { width: auto; flex: 0 0 auto; padding: 0 20px; }

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

.similar { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.similar__t { margin: 0 0 12px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.similar__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.similar__i { text-decoration: none; color: var(--ink); font-size: 12.5px; }
.similar__i img { aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius); background: var(--tag); margin-bottom: 5px; }
.similar__i b { font-family: "Unbounded", sans-serif; font-size: 13px; letter-spacing: -0.02em; }

.stick { position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px; display: none; }
.sheet[data-open="1"] ~ .stick { display: block; }
@media (min-width: 760px) { .sheet[data-open="1"] ~ .stick { display: none; } }

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

.page { padding: 26px 0 50px; }
.page__in { max-width: 760px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.page h1 { font-size: clamp(26px, 5vw, 40px); margin: 0 0 20px; }
.prose { font-size: 16px; line-height: 1.7; }
.prose h2 { font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; margin: 28px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.prose h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose ul, .prose ol { padding-left: 21px; margin-bottom: 16px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 20px; background: var(--card); }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; }
.prose th { background: var(--tag); font-weight: 600; }
.prose mark.todo { background: #fdf0c8; color: #7a5c14; padding: 1px 6px; border-radius: 3px; }

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

.foot { border-top: 1px solid var(--line); padding: 30px 0 44px; font-size: 14px; color: var(--muted); }
.foot a { color: var(--muted); }
.foot ul { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }

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

.tg {
	position: fixed; right: 16px; bottom: 16px; z-index: 50;
	display: flex; align-items: center; gap: 7px;
	background: var(--ink); color: #fff; text-decoration: none;
	font-size: 13.5px; font-weight: 500; line-height: 1;
	padding: 11px 16px 11px 12px; border-radius: 99px;
	box-shadow: 0 3px 12px rgba(25, 22, 20, .18);
}

.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: 12px; } }

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