/*
Theme Name: Vitryna
Description: Легка тема-односторінківка для дропшипінг-магазину одягу. Без конструкторів і зайвих скриптів.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: vitryna
*/

:root {
	--ink: #17191c;
	--paper: #fbfaf8;
	--card: #ffffff;
	--pine: #22483c;
	--pine-soft: #e8eeea;
	--line: #e2dfd7;
	--muted: #71757a;
	--flag: #a93226;
	--tag: #f2efe8;
	--radius: 4px;
	--wrap: 1180px;
	--mono: ui-monospace, "SF Mono", "Cascadia Mono", 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: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.6;
	font-weight: 400;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--pine); }

:focus-visible {
	outline: 2px solid var(--pine);
	outline-offset: 2px;
}

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

.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

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

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

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

.brand {
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-decoration: none;
	color: var(--ink);
}

.brand span { color: var(--pine); }

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

/* ---------- Герой ---------- */

.hero { padding: 34px 0 22px; }

.hero__title {
	margin: 0 0 10px;
	font-size: clamp(26px, 6vw, 42px);
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -0.02em;
	max-width: 18ch;
}

.hero__sub {
	margin: 0 0 20px;
	font-size: 17px;
	color: var(--muted);
	max-width: 46ch;
}

.trust {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.trust li {
	background: var(--pine-soft);
	color: var(--pine);
	font-size: 13.5px;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 999px;
}

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

.filters {
	position: sticky;
	top: 58px;
	z-index: 30;
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	padding: 12px 0;
	margin-bottom: 22px;
}

.filters__in {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.filters__label {
	font-size: 13px;
	color: var(--muted);
	margin-right: 2px;
}

.chip {
	appearance: none;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--ink);
	font: inherit;
	font-size: 14px;
	padding: 6px 13px;
	cursor: pointer;
	transition: border-color .12s, background .12s;
}

.chip:hover { border-color: var(--ink); }

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

.filters select {
	font: inherit;
	font-size: 14px;
	padding: 6px 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--card);
	color: var(--ink);
}

.count { font-size: 13px; color: var(--muted); margin-left: auto; }

/* ---------- Сетка ---------- */

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

@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

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

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

.card__ph {
	position: relative;
	aspect-ratio: 3 / 4;
	background: var(--tag);
	overflow: hidden;
}

.card__ph img { width: 100%; height: 100%; object-fit: cover; }

.card__out {
	position: absolute;
	inset: auto 0 0 0;
	background: rgba(23, 25, 28, .82);
	color: #fff;
	font-size: 12.5px;
	text-align: center;
	padding: 5px;
}

.card__body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }

.card__name {
	font-size: 14.5px;
	line-height: 1.35;
	margin: 0;
	font-weight: 400;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card__foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }

.card__price { font-size: 17px; font-weight: 700; }

.card__sizes { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* ---------- Панель товара ---------- */

.panel {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: none;
}

.panel[data-open="1"] { display: block; }

.panel__veil { position: absolute; inset: 0; background: rgba(23, 25, 28, .5); }

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

@media (min-width: 760px) {
	.panel__box {
		top: 50%; left: 50%; right: auto; bottom: auto;
		transform: translate(-50%, -50%);
		width: min(880px, 92vw);
		max-height: 88vh;
		border-radius: 8px;
		padding: 24px;
	}
	.panel__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
}

.panel__close {
	position: absolute;
	top: 10px; right: 12px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font: inherit;
	font-size: 20px;
	line-height: 1;
	padding: 5px 11px;
	cursor: pointer;
}

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

.panel__title { font-size: 21px; line-height: 1.3; font-weight: 700; margin: 0 0 4px; padding-right: 44px; }

.art {
	font-family: var(--mono);
	font-size: 12px;
	color: var(--muted);
	background: var(--tag);
	display: inline-block;
	padding: 2px 8px;
	border-radius: 2px;
	margin-bottom: 12px;
}

.panel__price { font-size: 27px; font-weight: 700; margin: 0 0 16px; }
.panel__price small { font-size: 15px; font-weight: 400; color: var(--muted); }

.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }

/* Размеры как тканевые ярлыки */
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.size {
	appearance: none;
	min-width: 52px;
	background: var(--tag);
	border: 1px solid var(--line);
	border-radius: 3px;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	padding: 9px 12px;
	cursor: pointer;
	color: var(--ink);
	transition: border-color .12s, background .12s;
}

.size:hover:not(:disabled) { border-color: var(--ink); }

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

/* Недоступный размер зачёркивается, а не прячется: покупатель видит,
   что размер существует, и чаще берёт соседний. */
.size:disabled {
	color: var(--muted);
	text-decoration: line-through;
	text-decoration-color: var(--flag);
	cursor: not-allowed;
	opacity: .75;
}

.desc { font-size: 14.5px; color: #3b3e43; margin: 0 0 18px; }
.desc p { margin: 0 0 8px; }

/* Форма как заполненный ярлык */
.order {
	border: 1px dashed var(--line);
	border-top: 3px solid var(--pine);
	border-radius: var(--radius);
	background: var(--paper);
	padding: 16px;
}

.order h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.order__hint { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }

.order input[type="text"],
.order input[type="tel"],
.order textarea {
	width: 100%;
	font: inherit;
	font-size: 16px;
	padding: 11px 12px;
	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(--pine); outline: none; }
.order textarea { resize: vertical; min-height: 62px; }

.hp { position: absolute; left: -9999px; }

.btn {
	width: 100%;
	appearance: none;
	background: var(--pine);
	color: #fff;
	border: 0;
	border-radius: var(--radius);
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	padding: 13px;
	cursor: pointer;
	transition: opacity .12s;
}

.btn:hover { opacity: .9; }
.btn:disabled { opacity: .55; cursor: default; }

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

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

/* ---------- Екран після замовлення ---------- */

.done { text-align: center; }

.done__no {
	display: inline-block;
	font-family: var(--mono);
	font-size: 13px;
	background: var(--tag);
	padding: 4px 10px;
	border-radius: 2px;
	margin-bottom: 12px;
}

.done__title { font-size: 19px; font-weight: 700; margin: 0 0 6px; }

.done__lead { font-size: 15px; color: var(--muted); margin: 0 0 18px; }

.btn--tg {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	background: #2aabee;
	text-decoration: none;
	font-size: 17px;
	font-weight: 500;
	padding: 15px;
}

.btn--tg svg { width: 21px; height: 21px; fill: currentColor; flex: none; }

.done__or {
	margin: 18px 0 8px;
	font-size: 13px;
	color: var(--muted);
	text-align: left;
}

.done__text {
	width: 100%;
	font-family: var(--mono);
	font-size: 12.5px;
	line-height: 1.5;
	padding: 11px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--card);
	color: var(--ink);
	resize: vertical;
	min-height: 132px;
	margin-bottom: 8px;
}

.btn--ghost {
	background: var(--card);
	color: var(--ink);
	border: 1px solid var(--line);
	font-size: 14.5px;
	padding: 10px;
}

.btn--ghost:hover { border-color: var(--ink); opacity: 1; }

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

.site-foot {
	border-top: 1px solid var(--line);
	padding: 28px 0 40px;
	font-size: 14px;
	color: var(--muted);
}

.site-foot a { color: var(--muted); }
.site-foot__row { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 12px; }

.empty { padding: 50px 0; text-align: center; color: var(--muted); }

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

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

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

.page__in { max-width: 760px; }

.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }

.page__title {
	font-size: clamp(25px, 5vw, 34px);
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 22px;
}

.prose { font-size: 16.5px; line-height: 1.7; }

.prose h2 {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	margin: 30px 0 10px;
	padding-top: 18px;
	border-top: 1px solid var(--line);
}

.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.prose p { margin: 0 0 14px; }

.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }

.prose strong { font-weight: 700; }

.prose table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 20px;
	font-size: 15px;
}

.prose th, .prose td {
	border: 1px solid var(--line);
	padding: 9px 11px;
	text-align: left;
}

.prose th {
	background: var(--tag);
	font-weight: 500;
	font-size: 14px;
}

.prose tbody tr:nth-child(even) td { background: #fcfbf9; }

/* Незаповнений реквізит видно одразу, а не після скарги клієнта */
.prose mark.todo {
	background: #fdf2c8;
	color: #7c5b00;
	border-bottom: 1px dashed #c9a227;
	padding: 1px 5px;
	border-radius: 2px;
	font-size: 14.5px;
}

.page__more {
	margin: 34px 0 26px;
	padding: 16px 18px;
	background: var(--tag);
	border-radius: var(--radius);
}

.page__more-title { margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.page__more ul { margin: 0; padding-left: 20px; font-size: 15px; }
.page__more li { margin-bottom: 5px; }

.page__back { margin: 0; }
.page__back .btn { display: block; text-align: center; text-decoration: none; }

/* Меню в підвалі */
.site-foot .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}
