:root {

	/* -----------------------------------------------------------------------
	   Палітра — dropt.e.cx.ua
	   ----------------------------------------------------------------------- */

	--primary:          #FF014D;
	--primary-dark:     #cc0040;
	--primary-light:    #ff3370;
	--accent:           #F2330D;

	--success:          #28a745;
	--warning:          #BB4D00;
	--danger:           #e74c3c;
	--danger-bg:        rgba(231,76,60,.08);
	--info:             #17a2b8;

	/* -----------------------------------------------------------------------
	   Нейтральні кольори (silver scale зі старого dropt)
	   ----------------------------------------------------------------------- */

	--white:            #fff;
	--black:            #000;

	--gray-50:          #FCFCFD;
	--gray-100:         #F8F8F8;
	--gray-200:         #F0F0F0;
	--gray-300:         #E0E0E0;
	--gray-400:         #C8C8C8;
	--gray-500:         #A9A9A9;
	--gray-600:         #808080;
	--gray-700:         #585858;
	--gray-800:         #343131;
	--gray-900:         #181818;

	/* -----------------------------------------------------------------------
	   Семантичні кольори
	   ----------------------------------------------------------------------- */

	--body-bg:          #FCFCFD;
	--card-bg:          #fff;
	--card-border:      #E0E0E0;
	--card-radius:      12px;
	--card-shadow:      0 2px 8px rgba(0,0,0,.07);

	--text:             #343131;
	--text-muted:       #808080;
	--text-light:       #A9A9A9;
	--link:             #FF014D;
	--link-hover:       #cc0040;

	/* -----------------------------------------------------------------------
	   Хедер
	   ----------------------------------------------------------------------- */

	--header-bg:        #fff;
	--header-border:    #E0E0E0;
	--header-height:    60px;

	/* -----------------------------------------------------------------------
	   Футер
	   ----------------------------------------------------------------------- */

	--footer-bg:        #343131;
	--footer-color:     #C8C8C8;
	--footer-link:      #F0F0F0;

	/* -----------------------------------------------------------------------
	   Банер-попередження (не авторизований)
	   ----------------------------------------------------------------------- */

	--banner-bg:        #fff8e1;
	--banner-border:    #BB4D00;
	--banner-color:     #343131;

	/* -----------------------------------------------------------------------
	   Навігаційні таби (кабінет)
	   ----------------------------------------------------------------------- */

	--tab-bg:           #F8F8F8;
	--tab-active-bg:    #fff;
	--tab-active-color: #FF014D;
	--tab-border:       #E0E0E0;

	/* -----------------------------------------------------------------------
	   Форми
	   ----------------------------------------------------------------------- */

	--input-height:     42px;
	--input-border:     #C8C8C8;
	--input-focus:      #FF014D;
	--input-bg:         #fff;
	--input-radius:     8px;
	--input-disabled-bg: #F0F0F0;

	/* -----------------------------------------------------------------------
	   Кнопки
	   ----------------------------------------------------------------------- */

	--btn-radius:       8px;
	--btn-height:       42px;

	/* -----------------------------------------------------------------------
	   Типографіка
	   ----------------------------------------------------------------------- */

	--font:             'Inter', sans-serif;
	--font-size:        1rem;
	--font-size-sm:     0.875rem;
	--font-weight:      400;
	--font-weight-medium: 500;
	--font-weight-bold: 700;
	--line-height:      1.5;
	--letter-spacing:   0.01em;

	--h1-size:          2rem;
	--h2-size:          1.75rem;
	--h3-size:          1.5rem;
	--h4-size:          1.25rem;
	--h5-size:          1.125rem;
	--h6-size:          1rem;

	/* -----------------------------------------------------------------------
	   Відступи і сітка
	   ----------------------------------------------------------------------- */

	--step:             20px;
	--gap:              12px;
	--radius:           12px;
	--radius-sm:        6px;
	--radius-xs:        4px;

	/* -----------------------------------------------------------------------
	   Каталог — картка товару
	   ----------------------------------------------------------------------- */

	--item-radius:      12px;
	--item-shadow:      0 2px 8px rgba(0,0,0,.07);
	--item-shadow-hover: 0 4px 16px rgba(0,0,0,.12);

	/* -----------------------------------------------------------------------
	   Перехід
	   ----------------------------------------------------------------------- */

	--transition:       .2s ease;

	/* -----------------------------------------------------------------------
	   Сайдбар кабінету
	   ----------------------------------------------------------------------- */

	--sidebar-width:    260px;
	--sidebar-bg:       #F8F8F8;
	--sidebar-border:   #E0E0E0;

	/* -----------------------------------------------------------------------
	   Таблиці
	   ----------------------------------------------------------------------- */

	--table-border:     #E0E0E0;
	--table-stripe:     rgba(0,0,0,.025);
	--table-hover:      rgba(255,1,77,.04);

	/* -----------------------------------------------------------------------
	   z-index шари
	   ----------------------------------------------------------------------- */

	--z-header:         100;
	--z-sidebar:        200;
	--z-modal:          300;
	--z-notify:         400;
}

/* ============================================================
   BASE — mobile first
   ============================================================ */

/* --- Reset ------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	height: 100%;
	font-size: var(--font-size);
}

body {
	font-family: var(--font);
	font-size: var(--font-size);
	line-height: var(--line-height);
	letter-spacing: var(--letter-spacing);
	color: var(--text);
	background: var(--body-bg);
	margin: 0;
	min-height: 100%;
}

/* --- Типографіка ------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
	font-weight: var(--font-weight-bold);
	line-height: 1.2;
	margin: 0 0 var(--gap);
}

h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }
h4 { font-size: var(--h4-size); }
h5 { font-size: var(--h5-size); }
h6 { font-size: var(--h6-size); }

p {
	margin: 0 0 var(--gap);
}

a {
	color: var(--link);
	text-decoration: none;
	outline: none;
}

a:hover {
	color: var(--link-hover);
	text-decoration: underline;
}

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

ul, ol {
	margin: 0 0 var(--gap);
	padding-left: calc(var(--step) * 1.2);
}

/* --- Форми ------------------------------------------------- */

input,
select,
textarea {
	font-family: var(--font);
	font-size: var(--font-size);
	color: var(--text);
	background: var(--input-bg);
	border: 1px solid var(--input-border);
	border-radius: var(--input-radius);
	height: var(--input-height);
	padding: 0 var(--gap);
	width: 100%;
	transition: border-color var(--transition);
	outline: none;
}

textarea {
	height: auto;
	padding: var(--gap);
	resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--input-focus);
}

input:disabled,
select:disabled,
textarea:disabled {
	background: var(--input-disabled-bg);
	cursor: not-allowed;
}

label {
	display: block;
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-medium);
	color: var(--text);
	margin-bottom: 6px;
}

form > div {
	margin-bottom: var(--gap);
}

/* inner div with toggle button → password wrapper */
form > div > div:has(> .toggle-password) {
	position: relative;
}

form > div > div:has(> .toggle-password) > input {
	padding-right: 44px;
}

.toggle-password {
	position: absolute;
	right: 0;
	top: 0;
	height: var(--input-height);
	width: 40px;
	font-size: 1rem;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
}

/* inline checkbox label */
form > label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: var(--font-weight);
	margin-bottom: var(--gap);
}

form > label input[type=checkbox] {
	width: auto;
	height: auto;
}

/* 2-column grid (firstName + lastName) */
.cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--gap);
	margin-bottom: var(--gap);
}

p.error {
	color: var(--danger);
	font-size: var(--font-size-sm);
	min-height: 1.2em;
	margin: 4px 0;
}

p.success {
	color: var(--success);
	font-size: var(--font-size-sm);
	min-height: 1.2em;
	margin: 4px 0;
}

/* --- Кнопки ------------------------------------------------ */

button {
	font-family: var(--font);
	font-size: var(--font-size);
	font-weight: var(--font-weight-medium);
	cursor: pointer;
	border: none;
	background: none;
	padding: 0;
	line-height: 1;
}

button[type=submit] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--primary);
	color: var(--white);
	border: 1px solid var(--primary);
	height: var(--btn-height);
	padding: 0 var(--step);
	border-radius: var(--btn-radius);
	white-space: nowrap;
	transition: background var(--transition), border-color var(--transition);
}

button[type=submit]:hover {
	background: var(--primary-dark);
	border-color: var(--primary-dark);
}

#logout-form button[type=submit] {
	background: transparent;
	color: var(--text);
	border-color: var(--card-border);
}

#logout-form button[type=submit]:hover {
	background: var(--gray-100);
}

/* --- Картка ----------------------------------------------- */

.card {
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: var(--card-radius);
	box-shadow: var(--card-shadow);
	padding: var(--step);
}

/* --- Банер-попередження (гість) --------------------------- */

.auth-banner {
	background: var(--banner-bg);
	border-bottom: 1px solid var(--banner-border);
	color: var(--banner-color);
	padding: var(--gap) var(--step);
	font-size: var(--font-size-sm);
	text-align: center;
}

.auth-banner a {
	font-weight: var(--font-weight-medium);
}

/* --- OAuth ------------------------------------------------- */

.oauth {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	margin-top: var(--step);
}

.oauth a {
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--btn-height);
	border: 1px solid var(--card-border);
	border-radius: var(--btn-radius);
	background: var(--white);
	color: var(--text);
	font-weight: var(--font-weight-medium);
	font-size: var(--font-size-sm);
	transition: background var(--transition);
}

.oauth a:hover {
	background: var(--gray-100);
	text-decoration: none;
}

/* --- Утиліти ---------------------------------------------- */

.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: var(--font-size-sm); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt          { margin-top: var(--step); }
.mb          { margin-bottom: var(--step); }
.nowrap      { white-space: nowrap; }
.hidden      { display: none; }

/* --- Мовна панель ---------------------------------------- */

ul.lang-panel > li {
	display: inline-block;
	margin-left: var(--gap);
}

ul.lang-panel > li:first-child {
	margin-left: 0;
}

/* ============================================================
   LAYOUT — mobile first
   header, footer, cabinet layout
   ============================================================ */

/* --- Хедер ------------------------------------------------- */

header {
	position: sticky;
	top: 0;
	z-index: var(--z-header);
	background: var(--header-bg);
	border-bottom: 1px solid var(--header-border);
	height: var(--header-height);
	display: flex;
	align-items: center;
	padding: 0 var(--step);
}

header > a {
	font-size: 1.5rem;
	font-weight: var(--font-weight-bold);
	color: var(--text);
	letter-spacing: -0.03em;
	flex-shrink: 0;
}

header > a:hover {
	text-decoration: none;
	color: var(--text);
}

header > a span {
	color: var(--primary);
}

header nav {
	display: none;
}

header nav ul {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: var(--gap);
}

header nav ul > a {
	color: var(--text);
	font-size: var(--font-size-sm);
}

header nav > div > span {
	font-weight: var(--font-weight-bold);
	color: var(--primary);
	font-size: var(--font-size-sm);
	white-space: nowrap;
}

/* --- Пошук у хедері (#448) --------------------------------- */

header form[role="search"] {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	max-width: 480px;
	margin: 0 var(--step);
}

header form[role="search"] input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	height: var(--input-height);
	padding: 0 var(--gap);
	border: 1px solid var(--input-border);
	background: var(--input-bg);
	border-radius: var(--input-radius) 0 0 var(--input-radius);
	font-size: var(--font-size-sm);
}

header form[role="search"] input[type="search"]:focus {
	outline: none;
	border-color: var(--input-focus);
}

header form[role="search"] button {
	flex-shrink: 0;
	height: var(--input-height);
	padding: 0 var(--gap);
	border: none;
	background: var(--primary);
	color: #fff;
	cursor: pointer;
	border-radius: 0 var(--input-radius) var(--input-radius) 0;
}

header form[role="search"] button:hover {
	background: var(--primary-dark);
}

/* liveSearch dropdown (#448 контейнер, #449 колонки/секції) */
.search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: auto;
	width: min(560px, 92vw);
	margin-top: 4px;
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: var(--card-radius);
	box-shadow: var(--card-shadow);
	z-index: var(--z-sidebar);
	max-height: 80vh;
	overflow-y: auto;
}

/* mobile-first: стовпчик, товари зверху, лічильники під ними (десктоп-колонки — у 768.css) */
.search-cols {
	display: flex;
	flex-direction: column;
}

.search-facets {
	order: 2;
	flex: 1 1 160px;
	min-width: 140px;
	border-top: 1px solid var(--card-border);
	padding: var(--gap) 0;
}

.search-groups {
	order: 1;
}

.search-facets > div + div {
	margin-top: var(--gap);
}

.search-facets h4,
.search-groups section h4 {
	margin: 0;
	padding: 4px var(--gap);
	font-size: var(--font-size-sm);
	color: var(--gray-600);
	font-weight: var(--font-weight-medium);
}

.search-facets a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px var(--gap);
	color: var(--text);
	font-size: var(--font-size-sm);
}

.search-facets a span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.search-facets a b {
	color: var(--gray-600);
	font-weight: var(--font-weight-medium);
	flex-shrink: 0;
}

.search-facets a:hover {
	background: var(--gray-100);
	text-decoration: none;
}

.search-groups {
	flex: 2 1 300px;
	padding: var(--gap) 0;
}

.search-groups section + section {
	margin-top: 8px;
	border-top: 1px solid var(--card-border);
	padding-top: 8px;
}

.search-groups section a {
	display: flex;
	align-items: center;
	gap: var(--gap);
	padding: 6px var(--gap);
	color: var(--text);
}

.search-groups section a:hover {
	background: var(--gray-100);
	text-decoration: none;
}

.search-groups img {
	width: 40px;
	height: 40px;
	object-fit: contain;
	flex-shrink: 0;
}

.search-groups section a span {
	flex: 1 1 auto;
	font-size: var(--font-size-sm);
}

.search-groups section a small {
	color: var(--gray-600);
	font-size: var(--font-size-sm);
	white-space: nowrap;
}

.search-groups section a b {
	font-weight: var(--font-weight-bold);
	color: var(--primary);
	white-space: nowrap;
}

/* кнопка «Всі результати» */
.search-all {
	display: block;
	text-align: center;
	padding: 10px var(--gap);
	border-top: 1px solid var(--card-border);
	font-weight: var(--font-weight-bold);
	color: var(--primary);
	position: sticky;
	bottom: 0;
	background: var(--card-bg);
}

.search-all:hover {
	background: var(--gray-100);
	text-decoration: none;
}

/* --- Основний вміст --------------------------------------- */

main {
	min-height: calc(100vh - var(--header-height) - 200px);
	padding: var(--step);
}

/* --- Футер ------------------------------------------------- */

footer {
	background: var(--footer-bg);
	color: var(--footer-color);
	padding: var(--step);
	font-size: var(--font-size-sm);
}

footer a {
	color: var(--footer-link);
}

footer a:hover {
	color: var(--white);
}

footer nav {
	margin-bottom: var(--step);
}

footer nav a {
	display: block;
	margin-bottom: 4px;
}

footer > p {
	border-top: 1px solid rgba(255,255,255,.1);
	padding-top: var(--gap);
	margin: 0;
	color: var(--gray-500);
	font-size: 0.75rem;
}

/* --- Auth таби (форма на /cabinet) ------------------------ */

.auth-tabs {
	max-width: 480px;
	margin: 0 auto;
}

.auth-tabs > div:first-child {
	display: flex;
	border-bottom: 1px solid var(--tab-border);
	margin-bottom: var(--step);
}

.auth-tab-btn {
	flex: 1;
	padding: var(--gap);
	font-family: var(--font);
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-medium);
	color: var(--text-muted);
	border-bottom: 2px solid transparent;
	height: auto;
	border-radius: 0;
	transition: color var(--transition), border-color var(--transition);
	white-space: nowrap;
}

.auth-tab-btn:hover {
	color: var(--text);
}

.auth-tab-btn.active {
	color: var(--primary);
	border-bottom-color: var(--primary);
}

.auth-tab {
	display: none;
}

.auth-tab.active {
	display: block;
}

#form-reset {
	display: none;
}

#form-reset.visible {
	display: block;
}

#form-forgot.hidden {
	display: none;
}

/* --- Кабінет (авторизований) ------------------------------ */

.cabinet {
	max-width: 480px;
	margin: 0 auto;
}

.cabinet h1 {
	margin-bottom: var(--step);
}

.cabinet > p:first-of-type {
	font-size: 1.125rem;
}

.cabinet > p:nth-of-type(2) {
	color: var(--text-muted);
	font-size: var(--font-size-sm);
}

/* === Catalog — mobile first === */

.catalog-page {
	padding: 8px 0;
}

.catalog-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	flex-wrap: wrap;
}

.catalog-toolbar select {
	padding: 4px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
}

.catalog-toolbar label {
	display: flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
}

.count-html {
	margin-left: auto;
	font-size: 0.875rem;
	color: #666;
}

/* Layout — mobile: single column */
.catalog-layout {
	display: block;
}

/* Aside — mobile: fixed drawer */
.catalog-aside {
	position: fixed;
	top: 0;
	left: -300px;
	width: 280px;
	height: 100%;
	overflow-y: auto;
	z-index: 100;
	transition: left 0.25s;
	background: #fff;
	padding: 16px;
	box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.catalog-aside.open {
	left: 0;
}

.catalog-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.4);
	z-index: 99;
}

.catalog-overlay.active {
	display: block;
}

.aside-close {
	float: right;
	background: none;
	border: none;
	font-size: 1.25rem;
	cursor: pointer;
	padding: 0 4px;
}

/* Filter groups */
.filter-group {
	border: none;
	border-bottom: 1px solid #eee;
	padding: 8px 0;
}

.filter-group summary {
	font-weight: 600;
	cursor: pointer;
	padding: 4px 0;
	list-style: none;
}

.filter-group summary::marker,
.filter-group summary::-webkit-details-marker {
	display: none;
}

.filter-group summary::after {
	content: ' ▾';
	font-size: 0.75rem;
	color: #888;
}

.filter-group[open] summary::after {
	content: ' ▴';
}

.filter-group label {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 3px 0;
	cursor: pointer;
	font-size: 0.875rem;
}

.filter-group label i {
	margin-left: auto;
	font-style: normal;
	color: #888;
	font-size: 0.75rem;
}

.filter-children {
	padding-left: 16px;
}

/* is-hidden — приховані групи/рядки за поточним станом (не видаляються з DOM).
   !important — щоб перемогти .filter-row{display:flex}/.filter-group за рівної
   специфічності незалежно від порядку правил (utility-клас видимості). */
.is-hidden {
	display: none !important;
}

/* search-hidden — рядки, приховані клієнтським пошуком (окремо від is-hidden,
   щоб не конфліктувати з приховуванням за 0-count) */
.search-hidden {
	display: none !important;
}

/* Кнопка "Застосувати" (батч range+чекбокси) */
.filter-apply {
	position: sticky;
	bottom: 0;
	width: 100%;
	margin-top: 12px;
	padding: 10px;
	border: none;
	background: #1a1a1a;
	color: #fff;
	font-size: 0.9375rem;
	cursor: pointer;
}

.filter-apply:hover {
	background: #333;
}

/* Filter rows: окремий radio/checkbox + окремий <a> назви + лічильник (артефакт 124 п.6) */
.filter-row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 3px 0;
	font-size: 0.875rem;
}

.filter-row input[type="radio"],
.filter-row input[type="checkbox"] {
	flex: 0 0 auto;
	width: auto;   /* перебити глобальне input{width:100%}, інакше radio займає весь рядок */
	margin: 0;
}

.filter-row a {
	flex: 1 1 auto;
	min-width: 0;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.filter-row a:hover {
	text-decoration: underline;
}

.filter-row .filter-count {
	margin-left: auto;
	font-style: normal;
	color: #888;
	font-size: 0.75rem;
}

.filter-child {
	padding-left: 16px;
}

/* Range-контрол (тип=1): два числові інпути min/max */
.filter-range {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 0;
}

.filter-range input[type="number"] {
	width: 100%;
	min-width: 0;
	padding: 4px 6px;
	font-size: 0.875rem;
	box-sizing: border-box;
}

.filter-range span {
	color: #888;
	flex: 0 0 auto;
}

/* Пошук у великій групі (minCountSearch) */
.filter-search {
	width: 100%;
	padding: 4px 6px;
	margin: 4px 0;
	font-size: 0.8125rem;
	box-sizing: border-box;
}

/* Filter chips */
.filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #f0f0f0;
	border-radius: 12px;
	padding: 2px 8px;
	font-size: 0.75rem;
	margin: 2px;
}

.filter-chip a {
	text-decoration: none;
	color: #666;
}

/* View switch buttons */
.view-switch {
	display: flex;
	gap: 4px;
}

.view-switch button {
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 4px 8px;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
}

.view-switch button.active {
	background: #333;
	color: #fff;
	border-color: #333;
}

/* === Catalog list — mobile: 1 column (grid view) === */
.catalog-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.catalog-list > div {
	border: 1px solid #eee;
	border-radius: 6px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	cursor: pointer;
}

/* Порожній стан — не картка: без рамки, на всю ширину сітки, приглушено. Специфічність
   вища за `.catalog-list > div`, щоб перекрити вигляд картки. */
.catalog-list > .catalog-empty {
	grid-column: 1 / -1;
	border: none;
	padding: 40px 12px;
	text-align: center;
	color: #888;
	cursor: default;
}

.catalog-list > div img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
}

.catalog-list > div b small {
	display: block;
	font-weight: normal;
	font-size: 0.8em;
	color: #666;
}

/* Зображення + зум-іконка (top-left) + серце «Обране» (top-right) (#439/#441) */
.item-img {
	position: relative;
}
.item-zoom {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.85);
	border-radius: 4px;
	font-size: 14px;
	line-height: 1;
	color: #333;
	text-decoration: none;
}
.item-zoom:hover {
	background: #fff;
}

/* Серце «Обране» (#441): сіре = не обрано, червоне = обрано */
.item-fav {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	font-size: 16px;
	line-height: 1;
	color: #bbb;
	cursor: pointer;
}
.item-fav.is-fav {
	color: #e12222;
}
.item-fav:hover {
	background: #fff;
}

/* Плавне зникнення картки при знятті з обраного на /obrane (#442) */
.item-removing {
	opacity: 0;
	transition: opacity 0.18s ease;
}

/* Серце + лічильник у хедері (#441) */
.header-fav {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-left: 12px;
	color: #e12222;
	font-size: 20px;
	line-height: 1;
	text-decoration: none;
}
.header-fav .fav-count {
	font-size: 11px;
	background: #e12222;
	color: #fff;
	border-radius: 10px;
	padding: 1px 5px;
	min-width: 16px;
	text-align: center;
}
.header-fav .fav-count[hidden] {
	display: none;
}

/* Назва-посилання на товар */
.item-name {
	color: inherit;
	text-decoration: none;
}
.item-name:hover {
	text-decoration: underline;
}

/* Чипи категорій під назвою (#439): основна звичайна, додаткові курсивом/приглушені */
.item-cats {
	display: block;
	font-weight: normal;
	margin-top: 3px;
}
.item-cat {
	display: inline-block;
	font-size: 0.8em;
	margin-right: 8px;
	color: #444;
}
.item-cat-add {
	font-style: italic;
	color: #888;
}

/* Лінійка бренду (#440) — приглушено після назви бренду */
.item-brandline {
	color: #888;
	font-size: 0.9em;
}

/* Клікабельні значення-фільтри (бренд, категорія, атрибути) */
a.item-cat,
a.item-brand-link,
a.item-attr {
	color: #06c;
	cursor: pointer;
	text-decoration: none;
}
a.item-cat:hover,
a.item-brand-link:hover,
a.item-attr:hover {
	text-decoration: underline;
}

/* Table view — mobile: 3 columns (img / name / stock) */
.catalog-list.table {
	display: grid;
	grid-template-columns: 60px 1fr auto;
	gap: 0;
	border: 1px solid #eee;
	border-radius: 6px;
	overflow: hidden;
}

.catalog-list.table > div {
	display: contents;
}

.catalog-list.table > div > * {
	padding: 8px;
	border-bottom: 1px solid #eee;
	align-self: center;
	font-size: 0.875rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.catalog-list.table > div img {
	width: 60px;
	height: 60px;
	object-fit: contain;
}

/* Hide brand, code, actions, attrs on mobile table */
.catalog-list.table > div > span:nth-child(3),
.catalog-list.table > div > span:nth-child(4),
.catalog-list.table > div > span.item-actions,
.catalog-list.table > div > span.item-attrs,
.catalog-list.table > div > a {
	display: none;
}

/* Table header row (#436): лише в table view (у card view прихований), жирніший рядок.
   Колонки 3/4 (бренд/артикул) ховаються/показуються наявними span:nth-child правилами, бо
   .catalog-head теж дитина .catalog-list.table > div; колонку 6 (ціна) керуємо окремо. */
.catalog-list > .catalog-head {
	display: none;
}
.catalog-list.table > .catalog-head > * {
	font-weight: 600;
	color: #555;
	border-bottom-width: 2px;
}
.catalog-list.table > .catalog-head > span:nth-child(6),
.catalog-list.table > .catalog-head > span:nth-child(7) {
	display: none;
}

/* Stock status */
.no-stock {
	color: #c00;
}

.in-stock {
	color: #090;
}

/* Actions inside card */
.item-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.item-actions input[type=number] {
	width: 50px;
	padding: 2px 4px;
	border: 1px solid #ccc;
	border-radius: 3px;
}

/* Pagination */
#pagination {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 0;
	font-size: 0.875rem;
}

#pagination a {
	padding: 6px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
}

#pagination a:hover {
	background: #f0f0f0;
}

/* Item page */
.breadcrumbs {
	font-size: 0.875rem;
	padding: 8px 0;
	color: #666;
}

.breadcrumbs a {
	color: #555;
}

.item-page {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.item-gallery {
	display: flex;
	gap: 8px;
	overflow-x: auto;
}

.item-gallery img {
	height: 200px;
	object-fit: contain;
	flex-shrink: 0;
}

.item-variants {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.item-variants th,
.item-variants td {
	padding: 6px 8px;
	text-align: left;
	border-bottom: 1px solid #eee;
}

.item-text,
.item-nutrition,
.item-ingredients {
	font-size: 0.9rem;
	line-height: 1.6;
}

/* Modal dialog */
dialog#catalog-modal {
	border: none;
	border-radius: 8px;
	padding: 24px;
	max-width: 90vw;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

dialog#catalog-modal::backdrop {
	background: rgba(0,0,0,0.5);
}

/* Filter toggle button */
.filter-toggle {
	padding: 6px 12px;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
}

/* === Desktop 992px === */
@media (min-width: 992px) {

	.catalog-layout {
		display: flex;
		gap: 24px;
		align-items: flex-start;
	}

	.catalog-aside {
		position: sticky;
		top: 16px;
		left: auto;
		width: 260px;
		height: auto;
		max-height: calc(100vh - 32px);
		overflow-y: auto;
		flex-shrink: 0;
		box-shadow: none;
		border-right: 1px solid #eee;
		padding-right: 16px;
		padding-left: 0;
		transition: none;
	}

	.catalog-overlay {
		display: none !important;
	}

	.filter-toggle {
		display: none;
	}

	.aside-close {
		display: none;
	}

	.catalog-main {
		flex: 1;
		min-width: 0;
	}

	/* Grid view: 3 columns */
	.catalog-list {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Table view desktop: 6 колонок (img/name/brand/code/stock/атрибути); залогінений (has-price) —
	   7 колонок з додатковою «Ціна» (#438). */
	.catalog-list.table {
		grid-template-columns: 60px 1fr auto auto auto auto;
	}
	.catalog-list.table.has-price {
		grid-template-columns: 60px 1fr auto auto auto auto auto;
	}

	/* Show brand, code, actions, attrs on desktop table */
	.catalog-list.table > div > span:nth-child(3),
	.catalog-list.table > div > span:nth-child(4),
	.catalog-list.table > div > span.item-actions,
	.catalog-list.table > div > span.item-attrs,
	.catalog-list.table > div > a {
		display: revert;
	}

	/* Показати заголовки атрибутів(6) і ціни(7) на desktop (#436/#438) */
	.catalog-list.table > .catalog-head > span:nth-child(6),
	.catalog-list.table > .catalog-head > span:nth-child(7) {
		display: revert;
	}

	.item-page {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.item-gallery {
		flex-direction: column;
		overflow-x: visible;
		width: 280px;
		flex-shrink: 0;
	}

	.item-gallery img {
		height: 260px;
		width: 100%;
	}

	.item-info {
		flex: 1;
		min-width: 0;
	}
}

/* --- Фільтр каталогу: details-блоки ---------------------- */

form#catalog-filter > div > details {
	max-height: 38vh;
	overflow-y: auto;
	border: 1px solid #e3e3e3;
	padding: var(--gap);
	width: 100%;
	border-radius: var(--radius);
}

/* ============================================================
   /search — сторінка результатів пошуку (#451, сценарій Б).
   Переюзує .filter-group/.filter-row/.filter-count/.filter-search/.filter-apply/.is-hidden
   каталогу; тут лише layout сторінки та нові фасети (ціна, акції).
   ============================================================ */

.search-page #search-form {
	display: flex;
	gap: var(--gap);
	align-items: flex-start;
}

/* mobile: aside — fixed drawer (як catalog-aside) */
.search-aside {
	position: fixed;
	top: 0;
	left: -300px;
	width: 280px;
	height: 100%;
	overflow-y: auto;
	z-index: 100;
	transition: left 0.25s;
	background: #fff;
	padding: 16px;
	box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.search-aside.open {
	left: 0;
}

.search-main {
	flex: 1 1 auto;
	min-width: 0;
}

.search-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.search-toolbar .count-html {
	margin-left: auto;
}

.filter-price {
	display: flex;
	align-items: center;
	gap: 8px;
}

.filter-price input {
	width: 84px;
}

.filter-sale {
	margin: 8px 0;
}

.search-aside-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
}

/* desktop: aside стає статичним стовпцем, кнопка «Фільтри» ховається */
@media (min-width: 992px) {
	.search-aside {
		position: static;
		left: auto;
		width: 260px;
		height: auto;
		flex: 0 0 260px;
		overflow: visible;
		box-shadow: none;
		padding: 0;
	}
	.search-aside .aside-close {
		display: none;
	}
	.search-toolbar .filter-toggle {
		display: none;
	}
}

@media only screen and (min-width: 576px) {
/* ============================================================
   576px — невеликі телефони landscape / великі portrait
   ============================================================ */

@media (min-width: 576px) {

	.container {
		max-width: 560px;
	}

	.auth-wrap {
		padding: 0;
	}

	.oauth-list {
		flex-direction: row;
	}

	.oauth-list a {
		flex: 1;
	}

	.cabinet-stats .stat-value {
		font-size: 1.75rem;
	}

}
}
@media only screen and (min-width: 768px) {
/* ============================================================
   768px — планшети portrait
   ============================================================ */

@media (min-width: 768px) {

	body {
		font-size: var(--font-size-768, var(--font-size));
	}

	.container {
		max-width: 740px;
	}

	header nav {
		display: flex;
		align-items: center;
		gap: var(--step);
		margin-left: var(--step);
	}

	header nav a {
		font-size: var(--font-size-sm);
		font-weight: var(--font-weight-medium);
		color: var(--text);
	}

	header nav a:hover {
		color: var(--primary);
		text-decoration: none;
	}

	footer .footer-grid {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--step);
	}

	footer .footer-renewal {
		display: flex;
		gap: var(--gap);
		align-items: flex-start;
	}

	footer .footer-renewal input {
		margin-bottom: 0;
	}

	.cabinet-page > .container {
		display: grid;
		grid-template-columns: var(--sidebar-width) 1fr;
		gap: calc(var(--step) * 2);
		align-items: start;
	}

	.cabinet-sidebar {
		position: sticky;
		top: calc(var(--header-height) + var(--step));
	}

	.cabinet-menu {
		display: none;
	}

	.cabinet-sidebar-nav {
		display: block;
	}

	.cabinet-sidebar-nav a {
		display: block;
		padding: var(--gap) var(--step);
		font-size: var(--font-size-sm);
		font-weight: var(--font-weight-medium);
		color: var(--text-muted);
		border-radius: var(--radius-sm);
		transition: background var(--transition), color var(--transition);
	}

	.cabinet-sidebar-nav a:hover {
		background: var(--gray-200);
		color: var(--text);
		text-decoration: none;
	}

	.cabinet-sidebar-nav a.active {
		background: rgba(255,1,77,.07);
		color: var(--primary);
	}

	/* liveSearch dropdown — з планшета дві колонки: лічильники ліворуч, товари праворуч (#449) */
	.search-cols {
		flex-direction: row;
	}

	.search-facets {
		order: 0;
		border-top: none;
		border-right: 1px solid var(--card-border);
	}

}
}
@media only screen and (min-width: 992px) {
/* ============================================================
   992px — планшети landscape / desktop
   ============================================================ */

@media (min-width: 992px) {

	.container {
		max-width: 960px;
	}

	header nav {
		gap: calc(var(--step) * 1.5);
	}

	footer .footer-grid {
		grid-template-columns: repeat(4, 1fr);
	}

	.cabinet-page > .container {
		grid-template-columns: var(--sidebar-width) 1fr;
	}

}
}
@media only screen and (min-width: 1200px) {
/* ============================================================
   1200px — широкий desktop
   ============================================================ */

@media (min-width: 1200px) {

	body {
		font-size: var(--font-size-1200, var(--font-size));
	}

	.container {
		max-width: 1160px;
	}

	.cabinet-page > .container {
		grid-template-columns: var(--sidebar-width) 1fr;
		gap: calc(var(--step) * 3);
	}

}
}
@media only screen and (min-width: 1440px) {
/* ============================================================
   1440px — великий desktop / ultrawide
   ============================================================ */

@media (min-width: 1440px) {

	.container {
		max-width: 1400px;
	}

}
}

