@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

* {
	box-sizing: border-box;
	font-family: "Inter", sans-serif;
	padding: 0;
	margin: 0;
}
:root {
	--grid-columns: 350px 2fr;
	--header-padding: 30px;
	--border: #E0E0E0;
	--muted: #B1B1B1;
	--text: #111;
	--red: #FF0000;
	--bg-soft: #f7f7f7;
}
body {
	display: grid;
	min-height: 100vh;
	grid-template-columns: var(--grid-columns);
	grid-auto-rows: min-content;
	grid-template-areas:    "header  header"
	"sidebar section_nav"
	"sidebar section"
	"sidebar footer";
}
main {
	display: contents;
}
main > section {
	padding: 20px;
	grid-area: section;
}
h2 {
	width: 100%;
}
main > div aside:first-of-type {
	gap: 20px;
	padding: 20px;
	display: flex;
	justify-content: center;
	grid-area: section_nav;
	align-items: flex-start;
	flex-wrap: wrap;
}
main > div > aside:last-of-type {
	padding: 30px;
}
main > div > aside:first-of-type > form {
	position: relative;
}

main > div > aside:first-of-type > form i {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--muted);
}

main > div > aside:first-of-type > form {
	flex: 1;
}
main > div > aside:first-of-type > form:first-of-type {
	min-width: 80%;
}
main > div > aside:first-of-type > form > input,
main > div > aside:first-of-type > form > select {
	width: 100%;
	font-size: 1rem;
	height: 56px;
	padding-left: 44px;
	outline: 2pt solid var(--border);
	border: none;
}
main > section {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 10px;
}
main > section > article {
	position: relative;
	outline: 2pt solid var(--border);
}
main > section > article > h3 {
	font-size: 1.8rem;
}
main > section > article img {
	width: 100%;
	outline: 2pt solid var(--border);
}
main > section > article > *:not(img) {
	padding-left: 15px;
	padding-right: 15px;
}
main > section > article > p {
	margin-top: 10px;
	color: var(--muted);
}
main > section > article > div {
	margin-top: 20px;
	margin-bottom: 40px;
}
main > section > article > div h4 {
	color: var(--muted);
}
main > section > article > div > p {
	font-size: 1.2rem;
}
main > section > article > div del {
	color: var(--muted);
	font-size: 1rem;
}
main > section > article button {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 100%;
	border: none;
	position: absolute;
	margin: 20px;
}

main section > article button:first-of-type {
	padding: 10px;
	border-radius: 100%;
	border: none;
	opacity: 0.7;
	position: absolute;
	right: 0;
	margin: 20px;
	transition: 100ms ease-in-out;
}
main > section > article button:last-of-type {
	width: 50px;
	height: 50px;
	font-size: 1.3rem;
	padding: 20px;
	border-radius: 100%;
	border: none;
	bottom: 0;
	right: 0;
	background: var(--red);
	color: white;
	margin: 20px;
}
main > section > article button:hover {
	cursor: pointer;
	opacity: 1;
}

h2 {
	font-size: 1.8rem;
}

main > div {
	display: contents;
}
main > div > aside:last-of-type {
	grid-area: sidebar;
	border-right: 2pt solid var(--border);
}
main > div > aside:last-of-type > form {
	height: 100%;
}
main > div > aside:last-of-type button[type="submit"] {
	width: 100%;
	border: none;
	text-transform: uppercase;
	padding-top: 20px;
	padding-bottom: 20px;
	background: var(--red);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}


a {
	color: black;
	white-space: nowrap;
	text-decoration: none;
}

header h1 {
	font-size: 1.3rem;
}
header p {
	font-size: 0.7rem;
	color: var(--muted);
}
header a {
	font-weight: 500;
}
header {
	grid-area: header;
	display: grid;
	grid-template-columns: var(--grid-columns);
	grid-template-areas: "logo        nav"
	"breadcrumbs cart";

}
header section {
	display: contents;
}
header > section > nav {
	padding: var(--header-padding);
	grid-area: breadcrumbs;
}
header > section > nav > ol {
	justify-content: center;
	text-align: center;
	white-space: nowrap;
	gap: 10px;
}
header > section > nav > ol > li {
	flex: 0;
}
header > section > nav > ol > li:last-child {
	color: var(--muted);
}
header > section > ul {
	grid-area: cart;
}
i[with-bg] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: white;
	padding: 5px;
	width: 30px;
	height: 30px;
	text-align: center;
	border-radius: 100%;
	background: var(--red);
}

header ul:not(section > nav > ul) > li,
header ol:not(section > nav > ol) > li,
header > div:first-of-type,
header > section > nav {
	outline: 2pt solid var(--border);
	background: white;
}

header > div:first-of-type {
	display: flex;
	justify-content: center;
	align-items: center;
	grid-area: logo;
	padding-top: 20px;
	padding-bottom: 20px;
}
/* сам лого (плейсхолдер) */
header > div:first-of-type > div:first-of-type {
	margin-right: 20px;
	aspect-ratio: 1/1;
	width: 40px;
	height: 40px;
	background: red;
	border-radius: 100%;
}
ol, ul {
	display: flex;
	justify-content: space-between;
	height: 100%;
	list-style-type: none;
}
li {
	display: flex;
	padding: 10px;
	flex-wrap: nowrap;
	width: 100%;
	justify-content: center;
	align-items: center;
}
header > div:nth-of-type(2) {
	display: grid;
	grid-template-columns: 2fr 1fr;
}
header > div:nth-of-type(2) div > ol > li:last-child > a {
	display: flex;
	gap: 30px;
	align-items: center;
}
header > div:nth-of-type(2) div > ol > li:last-child > a > img {
	width: 40px;
	height: 40px;
	aspect-ratio: 1/1;
	border-radius: 100%;
}
span[hot] {
	background: var(--red);
	color: white;
	font-size: 0.7rem;
	padding: 2px 5px 2px 5px;
}

fieldset {
	border: none;
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--border);
}

legend {
	font-weight: 700;
	margin-bottom: 12px;
}

select {
	padding: 5px;
	border: none;
	background: none;
	font: inherit;
	cursor: pointer;

}
fieldset label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1rem;
	color: var(--muted);
	margin: 8px 0;
}

input[type="checkbox"] {
	accent-color: var(--red);
}

input[type="range"] {
	width: 100%;
	margin: 8px 0;
	accent-color: var(--red);
}
input[type="checkbox"] {
	transform: scale(1.5);
	border-radius: 0px;
	accent-color: #ff2b2b;
}
fieldset input[type="number"] {
	width: 100%;
	height: 44px;
	border: none;
	background: var(--bg-soft);
	padding: 0 12px;
	font-size: 1rem;
}
fieldset:has(label input[type="number"]) {
	display: flex;
	gap: 10px;
}
footer {
	display: flex;
	padding: 20px;
	justify-content: center;
	align-items: end;
	color: var(--muted);
	font-weight: 600;
}

/* По-умолчанию лишаем семантики раскрываемой катеогрии, превращая по-сути в обычный div */
details > summary {
	display: none;
	margin-bottom: 10px;
}

/* Ensure content is always visible */
details[open] {
	display: block;
}


@media (max-width: 1025px) {
	/* компенсация уменьшенного gap */
	main > div aside {
		gap: 10px;
		align-items: flex-start;
	}
	main > div > aside > form {
		flex-basis: 100%;
		width: 100%;
	}
}
@media (max-width: 768px) {
	body {
		grid-template-columns: 1fr;
		grid-template-areas: "header"
		"filters"
		"section"
		"footer"
	}

	main > div {
		display: block;
		grid-area: filters;
	}
	header {
		grid-area: header;
		display: grid;
		grid-template-columns: 1fr;
		grid-template-areas: "logo"
		"nav"
		"cart";
	}
	header > div:nth-of-type(2) {
		display: grid;
		grid-template-columns: 2fr;
	} 
	header > div:nth-of-type(2) div > ol > li:last-child > a span {
		display: none;
	}
	header > section > nav {
		display: none;
	}
	details {
		pointer-events: auto;
	}

	details > summary {
		display: list-item;
		cursor: pointer;
	}
	main > div > aside:last-of-type {
		border: none;
	}
	main > div aside:first-of-type {
		margin-bottom: 0;
		gap: 20px;
	}
	main > div > aside:last-of-type {
		padding: 0px 20px 20px 20px;
	}
	main > div > aside:last-of-type > details > summary {
		padding: 18px;
		margin-bottom: 20px;
		outline: 2pt solid var(--border);
	}
}
