/* Cartzilla Market — 1:1 reconstruction of the Cartzilla Marketplace demo. */

:root {
	--cz-primary: #f55266;
	--cz-heading: #181d25;
	--cz-body: #4e5562;
	--cz-secondary: #6c727f;
	--cz-line: #e0e5eb;
	--cz-dark: #222934;
	--cz-soft: #f5f7fa;
	--cz-white: #fff;
	--cz-radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: "Inter", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--cz-body);
	background: var(--cz-white);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.container {
	width: 100%;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 12px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--cz-dark);
	color: #fff;
	padding: 8px 16px;
	z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
	background: var(--cz-white);
	padding: 16px 0;
	position: relative;
	z-index: 50;
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 32px;
}

.brand img { height: 28px; width: auto; }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--cz-heading); margin: 5px 0; border-radius: 2px; }

.primary-nav { flex: 1 1 auto; }

.nav-list { display: flex; align-items: center; gap: 8px; }

.nav-list > li { position: relative; }

.nav-list > li > a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	font-size: 15px;
	font-weight: 500;
	color: #333d4c;
	border-radius: 8px;
	transition: color .2s ease, background .2s ease;
}

.nav-list > li > a svg { width: 14px; height: 14px; }

.nav-list > li > a:hover,
.nav-list > li > a.is-current { color: var(--cz-heading); }

.drop {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 200px;
	background: var(--cz-white);
	border: 1px solid var(--cz-line);
	border-radius: 10px;
	box-shadow: 0 18px 40px rgba(24, 29, 37, .12);
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
	z-index: 60;
}

.has-drop:hover > .drop,
.has-drop:focus-within > .drop {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.drop a {
	display: block;
	padding: 8px 18px;
	font-size: 14px;
	color: var(--cz-body);
}
.drop a:hover { color: var(--cz-heading); background: var(--cz-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #333d4c;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, color .2s ease;
}
.icon-btn:hover { background: var(--cz-soft); color: var(--cz-heading); }

.account-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 500;
	color: #333d4c;
	padding: 8px 10px;
	border-radius: 8px;
	transition: color .2s ease;
}
.account-link:hover { color: var(--cz-heading); }

.cart-btn {
	position: relative;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #333d4c;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease;
}
.cart-btn:hover { background: var(--cz-soft); color: var(--cz-heading); }

.cart-count {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	background: var(--cz-primary);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	line-height: 16px;
	text-align: center;
}

.header-search {
	border-top: 1px solid var(--cz-line);
	background: var(--cz-white);
	padding: 10px 0;
}

.header-search form {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--cz-secondary);
}

.header-search input {
	flex: 1 1 auto;
	border: 0;
	outline: none;
	font: inherit;
	font-size: 15px;
	color: var(--cz-heading);
	background: transparent;
}

/* ---------- Hero ---------- */
.hero { padding: 108px 0 120px; }

.hero-copy h1 {
	max-width: 1080px;
	font-size: 64px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--cz-heading);
	letter-spacing: -.01em;
}

.hero-copy p {
	max-width: 1080px;
	margin-top: 24px;
	font-size: 18px;
	line-height: 1.5;
	color: var(--cz-body);
}

.cat-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 24px;
	margin-top: 72px;
}

.cat-card {
	border-radius: var(--cz-radius);
	overflow: hidden;
}

.cat-card img {
	width: 100%;
	height: 130px;
	object-fit: cover;
	transition: transform .3s ease;
}

.cat-card:hover img { transform: scale(1.05); }

.cat-label {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 56px;
	font-size: 16px;
	font-weight: 500;
	color: var(--cz-heading);
	background: var(--cz-soft);
	transition: background .2s ease, color .2s ease;
}

.cat-card:hover .cat-label { background: var(--cz-heading); color: #fff; }

.formats-row {
	display: flex;
	align-items: center;
	gap: 40px;
	margin-top: 32px;
}

.formats-row h2 { font-size: 14px; font-weight: 500; color: var(--cz-heading); white-space: nowrap; }

.formats { display: flex; align-items: center; gap: 16px; }

.formats a { display: block; border-radius: 50%; padding: 2px; transition: background .2s ease; }
.formats a:hover { background: var(--cz-soft); }
.formats img { width: 20px; height: 20px; }

/* ---------- Sections ---------- */
.section { padding: 112px 0 0; }

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 32px;
}

.section-head .h3 {
	font-size: 28px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--cz-heading);
}

.carousel-nav { display: flex; gap: 8px; }

.carousel-btn {
	width: 40px;
	height: 40px;
	border: 1px solid var(--cz-line);
	border-radius: 50%;
	background: var(--cz-white);
	color: #333d4c;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.carousel-btn svg { width: 16px; height: 16px; }
.carousel-btn.prev { transform: scaleX(-1); }
.carousel-btn:hover { background: var(--cz-heading); color: #fff; border-color: var(--cz-heading); }

/* ---------- Product cards ---------- */
.latest-viewport { overflow: hidden; }

.latest-track {
	display: flex;
	gap: 26px;
	transition: transform .45s ease;
}

.product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--cz-white);
	border: 1px solid var(--cz-line);
	border-radius: var(--cz-radius);
	overflow: hidden;
	flex: 0 0 auto;
	transition: box-shadow .25s ease;
}

.product-card:hover { box-shadow: 0 20px 40px rgba(24, 29, 37, .1); }

.product-card-wide { width: 636px; }

.product-media { display: block; overflow: hidden; }
.product-media img { width: 100%; height: 220px; object-fit: cover; transition: transform .3s ease; }
.product-card-wide .product-media img { height: 459px; }
.product-card:hover .product-media img { transform: scale(1.04); }

.wish {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: var(--cz-white);
	color: var(--cz-heading);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(24, 29, 37, .12);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity .2s ease, transform .2s ease;
}
.wish svg { width: 16px; height: 16px; }
.product-card:hover .wish,
.wish.is-active { opacity: 1; transform: none; }
.wish.is-active { color: var(--cz-primary); }
.wish.is-active svg { fill: var(--cz-primary); stroke: var(--cz-primary); }

.product-body { padding: 16px 16px 18px; }

.product-line {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.product-title { min-width: 0; flex: 1 1 auto; font-size: 15px; font-weight: 600; line-height: 1.4; }

.product-title a {
	display: block;
	color: var(--cz-heading);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.product-title a:hover { color: var(--cz-primary); }

.product-price { font-size: 15px; font-weight: 600; color: var(--cz-heading); }

.product-seller {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	font-size: 12px;
	color: var(--cz-secondary);
	white-space: nowrap;
}

.product-seller .seller { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--cz-secondary); }
.product-seller .seller:hover { color: var(--cz-heading); }
.product-seller .seller img { width: 20px; height: 20px; border-radius: 50%; }
.product-seller .in { color: var(--cz-line); }

.sales { margin-left: auto; color: var(--cz-secondary); }

/* ---------- Explore grid ---------- */
.tabs { display: flex; align-items: center; gap: 4px; }

.tab {
	border: 0;
	background: transparent;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #333d4c;
	transition: background .2s ease, color .2s ease;
}
.tab:hover { color: var(--cz-heading); }
.tab.is-active { color: var(--cz-heading); }

.product-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

.center { text-align: center; }

.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 50px;
	padding: 0 24px;
	border-radius: 800px;
	font-size: 16px;
	font-weight: 500;
	line-height: 50px;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn svg { width: 18px; height: 18px; }

.btn-dark { background: var(--cz-dark); border: 1px solid var(--cz-dark); color: #fff; margin-top: 40px; }
.btn-dark:hover { background: var(--cz-heading); border-color: var(--cz-heading); }

.btn-outline { background: transparent; border: 1px solid var(--cz-line); color: var(--cz-heading); margin-top: 40px; }
.btn-outline:hover { border-color: var(--cz-heading); background: var(--cz-soft); }

/* ---------- Collections ---------- */
.collections-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

#collections { padding-bottom: 122px; }

.collection-card { position: relative; }

.collection-media {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 4px;
	border-radius: var(--cz-radius);
	overflow: hidden;
}

.collection-big { grid-column: 1 / -1; width: 100%; height: 160px; object-fit: cover; }

.collection-pair { display: contents; }

.collection-pair img { width: 100%; height: 160px; object-fit: cover; }

.collection-card .wish { top: 8px; right: 8px; }

.collection-body {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 4px;
}

.collection-body h3 { font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--cz-heading); }
.collection-body h3 a:hover { color: var(--cz-primary); }

.collection-count { font-size: 13px; color: var(--cz-secondary); }

/* ---------- Inner pages ---------- */
.page-section { padding: 56px 0 80px; }
.page-title { font-size: 32px; font-weight: 700; color: var(--cz-heading); margin-bottom: 24px; }
.narrow-copy { max-width: 760px; }
.narrow-copy p { margin: 0 0 16px; }

/* ---------- Footer ---------- */
.site-footer {
	background: var(--cz-dark);
	color: rgba(255, 255, 255, .6);
	padding: 80px 0 32px;
	margin-top: 0;
}

.foot-features {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

.foot-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .08);
	color: #fff;
}
.foot-ico svg { width: 20px; height: 20px; }

.foot-feature h6 { margin: 14px 0 6px; font-size: 16px; font-weight: 600; color: #fff; }

.foot-feature p { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .55); }

.foot-main {
	display: grid;
	grid-template-columns: 1.75fr 1fr 1fr 1fr;
	gap: 40px;
	margin-top: 72px;
}

.foot-news h6 { font-size: 16px; font-weight: 600; color: #fff; }

.foot-note { margin-top: 10px; font-size: 13px; }
.foot-note.ok { color: #7ee2a0; }
.foot-note.err { color: #f8a5b0; }

.news-form {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
	max-width: 480px;
}

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

.news-form input[type="email"] {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	padding: 0 18px;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 800px;
	background: transparent;
	font: inherit;
	font-size: 15px;
	color: var(--cz-white);
	outline: none;
}
.news-form input[type="email"]::placeholder { color: rgba(255, 255, 255, .45); }
.news-form input[type="email"]:focus { border-color: rgba(255, 255, 255, .5); }

.news-form button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 48px;
	padding: 0 20px;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 800px;
	background: transparent;
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	transition: background .2s ease, border-color .2s ease;
}
.news-form button svg { width: 16px; height: 16px; transform: scaleX(-1); }
.news-form button:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }

.foot-social { display: flex; gap: 8px; margin-top: 20px; }

.foot-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid rgba(255, 255, 255, .15);
	border-radius: 50%;
	color: rgba(255, 255, 255, .7);
	transition: color .2s ease, border-color .2s ease;
}
.foot-social a:hover { color: #fff; border-color: rgba(255, 255, 255, .5); }

.foot-cols { display: contents; }

.foot-col h6 { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 16px; }

.foot-col a {
	display: inline-block;
	padding: 5px 0;
	font-size: 14px;
	color: rgba(255, 255, 255, .6);
	transition: color .2s ease;
}
.foot-col a:hover { color: #fff; }

.foot-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	border-top: 1px solid rgba(255, 255, 255, .1);
	margin-top: 56px;
	padding-top: 24px;
}

.foot-brand img { height: 24px; width: auto; }

.foot-bottom p { font-size: 13px; color: rgba(255, 255, 255, .5); }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
	.cat-grid { grid-template-columns: repeat(3, 1fr); }
	.product-grid { grid-template-columns: repeat(3, 1fr); }
	.collections-grid { grid-template-columns: repeat(3, 1fr); }
	.foot-features { grid-template-columns: repeat(2, 1fr); }
	.foot-main { grid-template-columns: 1fr 1fr; row-gap: 32px; }
	.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); grid-column: 1 / -1; gap: 32px; }
}

@media (max-width: 899px) {
	.hero { padding: 48px 0 72px; }
	.section { padding: 72px 0 0; }
	#collections { padding-bottom: 72px; }
	.hero-copy h1 { font-size: 40px; }
	.nav-toggle { display: block; margin-left: auto; }
	.primary-nav {
		position: absolute;
		top: calc(100% + 1px);
		left: 0;
		right: 0;
		background: var(--cz-white);
		border-bottom: 1px solid var(--cz-line);
		padding: 8px 12px 16px;
		display: none;
		z-index: 80;
	}
	.nav-open .primary-nav { display: block; }
	.nav-list { flex-direction: column; align-items: stretch; gap: 0; }
	.nav-list > li > a { padding: 12px 8px; width: 100%; }
	.drop {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		border-left: 2px solid var(--cz-line);
		border-radius: 0;
		padding: 0 0 4px 12px;
		margin-left: 8px;
		display: none;
	}
	.has-drop.is-open > .drop { display: block; }
	.header-actions { display: flex; order: 1; margin-left: auto; gap: 2px; }
	.header-actions .icon-btn,
	.header-actions .account-link { display: none; }
	.nav-toggle { order: 2; margin-left: 0; }
	.wish { opacity: 1; transform: none; }
	.product-grid { grid-template-columns: repeat(2, 1fr); }
	.collections-grid { grid-template-columns: repeat(2, 1fr); }
	.foot-main { grid-template-columns: 1fr; }
	.foot-cols { grid-template-columns: 1fr; }
	.foot-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 639px) {
	.section { padding: 64px 0 0; }
	#collections { padding-bottom: 64px; }
	.hero-copy h1 { font-size: 32px; }
	.cat-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
	.formats-row { flex-wrap: wrap; gap: 16px; }
	.product-grid { grid-template-columns: 1fr; }
	.collections-grid { grid-template-columns: 1fr; }
	.product-card-wide { width: 88vw; }
	.product-card-wide .product-media img { height: 64vw; }
	.foot-features { grid-template-columns: 1fr; }
	.foot-cols { grid-template-columns: 1fr; gap: 8px; }
	.section-head { flex-wrap: wrap; }
}
