/* === RESET & BASE === */
*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--primary: #2563eb;
	--primary-dark: #1d4ed8;
	--primary-light: #3b82f6;
	--success: #10b981;
	--warning: #f59e0b;
	--error: #ef4444;
	--bg: #f8fafc;
	--bg-white: #ffffff;
	--text: #1e293b;
	--text-secondary: #64748b;
	--text-muted: #94a3b8;
	--border: #e2e8f0;
	--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
	--radius: 12px;
	--radius-sm: 8px;
	--transition: all 0.2s ease;
}

body {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
}

a {
	text-decoration: none;
	color: inherit;
}
button {
	cursor: pointer;
	border: none;
	background: none;
	font-family: inherit;
}
input,
select {
	font-family: inherit;
}

.container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px;
}

/* === BUTTONS === */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 600;
	border-radius: var(--radius-sm);
	transition: var(--transition);
}

.btn-primary {
	background: var(--primary);
	color: white;
}
.btn-primary:hover {
	background: var(--primary-dark);
}

.btn-outline {
	border: 2px solid var(--border);
	color: var(--text);
}
.btn-outline:hover {
	border-color: var(--primary);
	color: var(--primary);
}

.btn-large {
	padding: 16px 32px;
	font-size: 16px;
}
.btn-block {
	width: 100%;
}

/* === HEADER === */
.header {
	position: sticky;
	top: 0;
	background: var(--bg-white);
	border-bottom: 1px solid var(--border);
	z-index: 100;
	padding: 16px 0;
}

.header-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
}

.logo {
	display: flex;
	align-items: center;
	gap: 10px;
}
.logo-icon {
	font-size: 28px;
}
.logo-text {
	font-size: 24px;
	font-weight: 800;
	color: var(--text);
}
.logo-text span {
	color: var(--primary);
}

.nav {
	display: flex;
	gap: 32px;
}
.nav-link {
	font-weight: 500;
	color: var(--text-secondary);
	transition: var(--transition);
}
.nav-link:hover,
.nav-link.active {
	color: var(--primary);
}

.header-actions {
	display: flex;
	gap: 12px;
}
.cart-count {
	position: absolute;
	top: -8px;
	right: -8px;
	background: var(--error);
	color: white;
	font-size: 11px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

#cartBtn {
	position: relative;
}
#cartBtn.has-items .cart-count {
	display: flex;
}

.mobile-menu-btn {
	display: none;
	flex-direction: column;
	gap: 5px;
	padding: 8px;
}
.mobile-menu-btn span {
	width: 24px;
	height: 2px;
	background: var(--text);
}

/* === HERO === */
.hero {
	background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
	color: white;
	padding: 80px 0;
	position: relative;
	overflow: hidden;
}

.hero::before {
	content: "";
	position: absolute;
	top: -50%;
	right: -20%;
	width: 600px;
	height: 600px;
	background: radial-gradient(
		circle,
		rgba(37, 99, 235, 0.3) 0%,
		transparent 70%
	);
	border-radius: 50%;
}

.hero .container {
	display: grid;
	grid-template-columns: 1fr 400px;
	gap: 60px;
	align-items: center;
	position: relative;
	z-index: 1;
}

.hero-title {
	font-size: 56px;
	font-weight: 800;
	line-height: 1.1;
	margin-bottom: 24px;
}
.hero-title span {
	color: var(--primary-light);
}

.hero-subtitle {
	font-size: 20px;
	color: #94a3b8;
	margin-bottom: 32px;
	max-width: 500px;
}

.hero-features {
	display: flex;
	gap: 24px;
	margin-bottom: 40px;
}
.feature {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #94a3b8;
}
.feature-icon {
	font-size: 20px;
}

.hero-image {
	position: relative;
	text-align: center;
}
.hero-badge {
	position: absolute;
	top: 20px;
	left: -20px;
	background: var(--warning);
	color: white;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	transform: rotate(-5deg);
}
.hero-image img {
	width: 100%;
	max-width: 400px;
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}

/* === SECTIONS === */
section {
	padding: 80px 0;
}

.section-header {
	text-align: center;
	margin-bottom: 48px;
}
.section-title {
	font-size: 36px;
	font-weight: 700;
	margin-bottom: 12px;
}
.section-subtitle {
	color: var(--text-secondary);
	font-size: 18px;
}

/* === CATEGORIES === */
.categories {
	background: var(--bg-white);
}

.categories-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 16px;
}

.category-card {
	background: var(--bg);
	padding: 24px 16px;
	border-radius: var(--radius);
	text-align: center;
	cursor: pointer;
	border: 2px solid transparent;
	transition: var(--transition);
}
.category-card:hover,
.category-card.active {
	border-color: var(--primary);
	background: white;
}
.category-icon {
	font-size: 32px;
	margin-bottom: 12px;
}
.category-card h3 {
	font-size: 14px;
	margin-bottom: 4px;
}
.category-count {
	font-size: 12px;
	color: var(--text-muted);
}

/* === FILTERS === */
.filters-section {
	background: var(--bg-white);
	padding: 24px 0;
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 73px;
	z-index: 90;
}

.filters {
	display: flex;
	gap: 16px;
	align-items: flex-end;
	flex-wrap: wrap;
}

.filter-group {
	flex: 1;
	min-width: 150px;
}
.filter-group label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--text-secondary);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.filter-group select {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 14px;
	background: white;
	cursor: pointer;
}
.filter-group select:focus {
	outline: none;
	border-color: var(--primary);
}

/* === PRODUCTS === */
.products-section {
	background: var(--bg);
}

.products-count {
	color: var(--text-secondary);
	font-size: 14px;
}

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

.product-card {
	background: var(--bg-white);
	border-radius: var(--radius);
	overflow: hidden;
	transition: var(--transition);
	border: 1px solid var(--border);
}
.product-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
}

.product-image {
	position: relative;
	aspect-ratio: 1;
	background: var(--bg);
	overflow: hidden;
}
.product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.product-badges {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	gap: 6px;
}
.badge {
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
}
.badge-new {
	background: var(--success);
	color: white;
}
.badge-sale {
	background: var(--error);
	color: white;
}
.badge-hit {
	background: var(--warning);
	color: white;
}

.product-actions {
	position: absolute;
	bottom: 12px;
	right: 12px;
	display: flex;
	gap: 8px;
	opacity: 0;
	transition: var(--transition);
}
.product-card:hover .product-actions {
	opacity: 1;
}
.product-action-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: white;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow);
	transition: var(--transition);
}
.product-action-btn:hover {
	background: var(--primary);
	color: white;
}

.product-info {
	padding: 20px;
}
.product-category {
	font-size: 11px;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}
.product-name {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 8px;
	line-height: 1.3;
}
.product-name a:hover {
	color: var(--primary);
}

.product-features {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 16px;
}
.product-feature {
	font-size: 11px;
	padding: 4px 8px;
	background: var(--bg);
	border-radius: 4px;
	color: var(--text-secondary);
}

.product-footer {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px;
	margin-bottom: 12px;
}
.product-price {
	font-size: 20px;
	font-weight: 700;
	color: var(--primary);
}
.product-min-order {
	font-size: 11px;
	color: var(--text-muted);
	margin-bottom: 8px;
}

.quantity-control {
	display: flex;
	align-items: center;
	background: var(--bg);
	border-radius: 8px;
	padding: 2px;
	border: 1px solid var(--border);
}
.qty-btn-minus,
.qty-btn-plus {
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	font-size: 18px;
	font-weight: 600;
	color: var(--text-secondary);
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}
.qty-btn-minus:hover,
.qty-btn-plus:hover {
	background: var(--primary);
	color: white;
	border-radius: 6px;
}
.qty-input {
	width: 50px;
	height: 28px;
	border: none;
	background: transparent;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	-moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.add-to-cart-btn {
	width: 100%;
	padding: 12px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: all 0.2s;
}
.add-to-cart-btn:hover {
	background: var(--primary-dark);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}
.product-price span {
	font-size: 14px;
	font-weight: 400;
	color: var(--text-muted);
}
.product-unit {
	font-size: 12px;
	color: var(--text-muted);
}

.add-to-cart {
	width: 44px;
	height: 44px;
	border-radius: var(--radius-sm);
	background: var(--primary);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--transition);
}
.add-to-cart:hover {
	background: var(--primary-dark);
}
.add-to-cart:disabled {
	background: var(--success);
}

.load-more {
	text-align: center;
}

/* === WHY === */
.why-section {
	background: var(--bg-white);
}

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

.why-card {
	text-align: center;
	padding: 32px 24px;
	border-radius: var(--radius);
	background: var(--bg);
	transition: var(--transition);
}
.why-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
}
.why-icon {
	font-size: 48px;
	margin-bottom: 16px;
}
.why-card h3 {
	font-size: 18px;
	margin-bottom: 8px;
}
.why-card p {
	color: var(--text-secondary);
	font-size: 14px;
}

/* === FOOTER === */
.footer {
	background: #0f172a;
	color: white;
	padding: 60px 0 0;
}

.footer-content {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1.5fr;
	gap: 48px;
	padding-bottom: 48px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .logo {
	margin-bottom: 16px;
}
.footer-brand p {
	color: #94a3b8;
	font-size: 14px;
}

.footer-links h4,
.footer-contact h4 {
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 20px;
	color: #94a3b8;
}
.footer-links a {
	display: block;
	color: white;
	font-size: 14px;
	padding: 6px 0;
	transition: var(--transition);
}
.footer-links a:hover {
	color: var(--primary-light);
}

.footer-contact a,
.footer-contact p {
	display: block;
	color: white;
	font-size: 14px;
	padding: 6px 0;
}
.footer-contact a:hover {
	color: var(--primary-light);
}

.footer-bottom {
	padding: 24px 0;
	text-align: center;
	color: #64748b;
	font-size: 14px;
}

/* === CART SIDEBAR === */
.cart-sidebar {
	position: fixed;
	top: 0;
	right: -420px;
	width: 420px;
	height: 100vh;
	background: white;
	z-index: 200;
	display: flex;
	flex-direction: column;
	transition: right 0.3s ease;
	box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}
.cart-sidebar.open {
	right: 0;
}

.cart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid var(--border);
}
.cart-header h3 {
	font-size: 20px;
}
.close-cart {
	font-size: 28px;
	color: var(--text-muted);
	width: 40px;
	height: 40px;
}
.close-cart:hover {
	color: var(--text);
}

.cart-content {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
}

.cart-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--text-muted);
}
.cart-empty-icon {
	font-size: 64px;
	margin-bottom: 16px;
}

.cart-item {
	display: flex;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--border);
}
.cart-item-image {
	width: 80px;
	height: 80px;
	border-radius: var(--radius-sm);
	background: var(--bg);
	overflow: hidden;
}
.cart-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.cart-item-info {
	flex: 1;
}
.cart-item-name {
	font-weight: 600;
	margin-bottom: 4px;
}
.cart-item-articul {
	font-size: 12px;
	color: var(--text-muted);
	margin-bottom: 8px;
}
.cart-item-price {
	font-weight: 700;
	color: var(--primary);
}
.cart-item-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}
.qty-btn {
	width: 28px;
	height: 28px;
	border: 1px solid var(--border);
	border-radius: 4px;
	font-size: 16px;
}
.qty-value {
	padding: 0 12px;
	font-weight: 600;
}
.cart-item-remove {
	color: var(--error);
	font-size: 12px;
	margin-left: auto;
}

.cart-footer {
	padding: 24px;
	border-top: 1px solid var(--border);
	background: var(--bg);
}
.cart-summary {
	margin-bottom: 16px;
}
.summary-row {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	font-size: 14px;
}
.summary-row.total {
	font-size: 18px;
	font-weight: 700;
	border-top: 1px solid var(--border);
	padding-top: 12px;
	margin-top: 8px;
}

.cart-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 190;
	opacity: 0;
	visibility: hidden;
	transition: var(--transition);
}
.cart-overlay.open {
	opacity: 1;
	visibility: visible;
}

/* === MODAL === */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: var(--transition);
}
.modal.open {
	opacity: 1;
	visibility: visible;
}

.modal-content {
	background: white;
	padding: 40px;
	border-radius: var(--radius);
	width: 100%;
	max-width: 440px;
	position: relative;
}
.modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	font-size: 24px;
	color: var(--text-muted);
}

.auth-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
}
.auth-tab {
	flex: 1;
	padding: 12px;
	font-weight: 600;
	border-bottom: 2px solid var(--border);
	color: var(--text-muted);
}
.auth-tab.active {
	color: var(--primary);
	border-color: var(--primary);
}

.form-group {
	margin-bottom: 20px;
}
.form-group label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 6px;
}
.form-group input {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 16px;
}
.form-group input:focus {
	outline: none;
	border-color: var(--primary);
}

.checkbox {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 20px;
	font-size: 14px;
	color: var(--text-secondary);
}
.checkbox input {
	margin-top: 3px;
}
.checkbox a {
	color: var(--primary);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
	.categories-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.products-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.why-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 992px) {
	.hero .container {
		grid-template-columns: 1fr;
		text-align: center;
	}
	.hero-features {
		justify-content: center;
	}
	.hero-image {
		display: none;
	}
	.products-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.footer-content {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.nav {
		display: none;
	}
	.mobile-menu-btn {
		display: flex;
	}
	.hero-title {
		font-size: 36px;
	}
	.categories-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.products-grid {
		grid-template-columns: 1fr;
	}
	.filters {
		flex-direction: column;
	}
	.filter-group {
		width: 100%;
	}
	.cart-sidebar {
		width: 100%;
		right: -100%;
	}
	.footer-content {
		grid-template-columns: 1fr;
	}
}

/* === ANIMATIONS === */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.product-card {
	animation: fadeIn 0.4s ease forwards;
}
