:root {
	--brand-primary: #1f6feb;
	--brand-accent:  #23c17a;
	--brand-dark:    #0b1020;
}

body {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background-color: #f5f6f8;
	color: #212529;
}

a {
	text-decoration: none;
	color: inherit;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--brand-primary);
}

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

.text-light {
	color: #ddd;
}

/* ===== TOPBAR & HEADER ===== */
.topbar {
	font-size: 0.9rem;
	background: #020617;
	color: #9ca3af;
	border-bottom: 1px solid rgba(148,163,184,.4);
}
.topbar a { color: #c7cdd8; }
.topbar a:hover { color: #e5e7eb; }

.top-header {
	background: #ffffff;
}

.navbar-brand img {
	height: 45px;
	width: auto;
}

/* ===== NAVIGATION ===== */
.main-nav {
	border-top: 1px solid #e5e7eb;
	background: #ffffff;
}
.main-nav .nav-link {
	color: #111827 !important;
	font-weight: 500;
	padding: 0.5rem 1rem;
}

.main-nav .nav-link.active {
	color: white!important;
}

/* Mega Menu / Dropdowns */
.dropdown-menu-mega {
	min-width: 300px;
	padding: 0.5rem 0;
	border: none;
	box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
	border-radius: 0.5rem;
	margin-top: 0;
}
.dropdown-menu-mega .mega-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.dropdown-menu-mega .mega-list li a {
	display: block;
	padding: 0.5rem 1.25rem;
	color: #212529;
	font-size: 0.95rem;
}
.dropdown-menu-mega .mega-list li a:hover {
	background-color: #f8f9fa;
	color: var(--brand-primary);
}

/* Hover trigger for desktop */
@media (min-width: 992px) {
	.main-nav .nav-item.dropdown:hover .dropdown-menu {
		display: block;
	}
}

/* Messengers Buttons */
.btn-wa { border-color: #22c55e; color: #16a34a; border-radius: 100%; width:38px;height:38px;font-size: 14pt;padding:4px 6px;}
.btn-wa:hover { background: #22c55e; color: #fff; }
.btn-tg { border-color: #38bdf8; color: #0ea5e9;  border-radius: 100%; width:38px;height:38px;font-size: 14pt;padding:4px 6px;}
.btn-tg:hover { background: #38bdf8; color: #fff; }

/* Offcanvas Mobile */
.offcanvas-custom {
	background: #0b1020;
	color: #e5e7eb;
}
.offcanvas-custom .btn-close {
	filter: invert(1);
}
.offcanvas-custom a { color: #e5e7eb; }
.offcanvas-custom a:hover { color: #bfdbfe; }
.offcanvas-custom hr { border-color: rgba(255,255,255,0.1); }

/* ===== HERO SECTION ===== */
.hero-section {
	position: relative;
	min-height: 450px;
	background: #0b1020;
	color: #fff;
	overflow: hidden;
	display: flex;
	align-items: center;
}
.hero-bg-image {
	position: absolute;
	inset: 0;
	background: url("/images/bgs/hero-bg.png") center / cover no-repeat;
	z-index: 0;
}
.hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to right, rgba(11,16,32,0.9) 0%, rgba(11,16,32,0.4) 100%);
	z-index: 1;
}
.hero-content {
	position: relative;
	z-index: 2;
}
.hero-badge {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .35rem .75rem;
	border-radius: 50rem;
	background: rgba(15, 118, 110, 0.18);
	border: 1px solid rgba(45, 212, 191, 0.4);
	font-size: .85rem;
	color: #fff;
}
.hero-badge span {
	width: 8px; height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35);
}

/* Hero Carousel Card */
.hero-image-card {
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: 0 1rem 3rem rgba(0,0,0,0.5);
	background: #000;
}
.hero-image-card .carousel-item {
	height: 400px;
}
.hero-image-card img {
	height: 100%;
	object-fit: cover;
}
.hero-caption-overlay {
	background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
	padding: 1.5rem;
}

/* ===== CATEGORIES ===== */
.cat-card {
	display: block;
	height: 100%;
}
.cat-card-inner {
	background: #fff;
	border-radius: 1rem;
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.05);
	box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cat-card-inner:hover {
	transform: translateY(-5px);
	box-shadow: 0 1rem 3rem rgba(0,0,0,0.1);
}
.cat-thumb {
	height: 150px;
	overflow: hidden;
	position: relative;
}
.cat-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}
.cat-card-inner:hover .cat-thumb img { transform: scale(1.05); }
.cat-text { padding: 1rem; flex-grow: 1; }
.cat-title { font-weight: 700; font-size: 1.1rem; color: #111; margin-bottom: 0.5rem; }
.cat-desc { font-size: 0.85rem; color: #6c757d; }
.cat-footer {
	padding: 0.75rem 1rem;
	border-top: 1px solid #f3f4f6;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
	color: var(--brand-primary);
	font-weight: 600;
}

/* ===== MODULES ===== */
.modules-section {
	background: #0b1020 url(/images/bgs/modules-main-bg.jpg) center/cover no-repeat;
	color: #fff;
}
.module-card {
	background: #0f172a;
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 1rem;
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: all 0.3s ease;
}
.module-card:hover {
	border-color: var(--brand-primary);
	transform: translateY(-5px);
	box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.module-image-wrapper {
	height: 220px;
	position: relative;
	overflow: hidden;
}
.module-image { width: 100%; height: 100%; object-fit: cover; }
.module-tag {
	display: inline-block;
	background: rgba(255,255,255,0.1);
	padding: 0.25rem 0.75rem;
	border-radius: 50rem;
	font-size: 0.75rem;
	color: #fff;
}

.modules-section .module-image-gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 60%);
	pointer-events: none;
}

/* ===== CALCULATOR ===== */
.calc-card {
	background: #0f172a;
	color: #fff;
	padding: 2rem;
	border-radius: 1.5rem;
}
.calc-option {
	display: block;
	background: rgba(15, 23, 42, 0.8);
	border: 1px solid rgba(255,255,255,0.1);
	padding: 1.5rem;
	border-radius: 1rem;
	height: 100%;
	transition: all 0.2s ease;
}
.calc-option:hover {
	background: rgba(15, 23, 42, 1);
	border-color: var(--brand-primary);
	transform: translateY(-3px);
}

/* ===== PRODUCTS & SWIPER ===== */
.product-card {
	background: #fff;
	border-radius: 1rem;
	border: 1px solid #e9ecef;
	overflow: hidden;
	height: 100%;
	transition: box-shadow 0.2s;
}
.product-card:hover { box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.08); }
.product-card img { height: 200px; object-fit: cover; width: 100%; }
.product-label {
	font-size: 0.7rem;
	text-transform: uppercase;
	font-weight: 700;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	background: #d1fae5; color: #065f46;
}
.swiper { padding: 1rem !important; margin: -1rem !important; }

/* ===== REVIEWS ===== */
.reviews-section {
	background: #020617 url(/images/bgs/reviews-main-bg.jpg) center/cover;
}
.review-slider-card {
	background: rgba(30, 41, 59, 0.8);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 1rem;
	padding: 1.5rem;
	color: #e2e8f0;
	height: 100%;
}
.review-avatar-circle {
	width: 40px; height: 40px;
	border-radius: 50%;
	background: var(--brand-primary);
	color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-weight: bold;
}
.reviews-nav-btn {
	width: 40px; height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,0.1);
	border: none;
	color: #fff;
	display: flex; align-items: center; justify-content: center;
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
	cursor: pointer;
}
.reviews-prev { left: 0; }
.reviews-next { right: 0; }

/* ===== BLOG ===== */
.blog-card {
	background: #fff;
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
	height: 100%;
	border: none;
}
.blog-card img { height: 180px; object-fit: cover; width: 100%; }

/* ===== PRODUCT DETAIL ===== */
.detail-gallery-main {
	position: relative;
	border-radius: 1rem;
	overflow: hidden;
	background: #f8f9fa;
	border: 1px solid #dee2e6;
}
.detail-thumb-btn {
	border: 2px solid transparent;
	border-radius: 0.5rem;
	padding: 0;
	overflow: hidden;
	opacity: 0.6;
	transition: all 0.2s;
}
.detail-thumb-btn:hover, .detail-thumb-btn.active {
	opacity: 1;
	border-color: var(--brand-primary);
}
.variant-option {
	display: block;
	text-align: center;
	padding: 0.5rem;
	border: 1px solid #dee2e6;
	border-radius: 0.5rem;
	color: #495057;
	text-decoration: none;
}
.variant-option:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.variant-option.active {
	background-color: #eff6ff;
	border-color: var(--brand-primary);
	color: var(--brand-primary);
	font-weight: bold;
	position: relative;
}
.variant-option.active::after {
	content: "✔";
	position: absolute; top: -5px; right: -5px;
	background: #fff; color: var(--brand-primary);
	border-radius: 50%; font-size: 0.7rem; padding: 2px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.video-slide-card {
	border-radius: 1rem;
	overflow: hidden;
	position: relative;
	background: #000;
}

/* ===== FOOTER ===== */
.vf-footer {
	background: #0d1117;
	color: #9ca3af;
}
.vf-social {
	width: 36px; height: 36px;
	background: rgba(255,255,255,0.1);
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	color: #fff;
	transition: 0.3s;
}
.vf-social:hover { background: var(--brand-primary); }

// ===========================
// CSS STYLES (из нового дизайна)
// ===========================

	.page-wrapper {
		padding-top: 1.5rem;
		padding-bottom: 3rem;
	}

	/* HERO */
	.hero-category {
		position: relative;
		border-radius: 1.5rem;
		padding: 2rem 2rem;
		margin-bottom: 2rem;
		overflow: hidden;
		color: #f9fafb;
		/* Можно сделать динамический фон или оставить общий */
		background: #0b1020 url(/images/bgs/hero-lifepo4-bg.jpg) no-repeat center center;
		background-size: cover;
	}

	.hero-category::before {
		content: "";
		position: absolute;
		inset: 0;
		background: radial-gradient(circle at 10% 120%, rgba(9, 28, 70, 0.9), rgba(9, 28, 70, 0.6));
		pointer-events: none;
	}

	.hero-inner {
		position: relative;
		z-index: 1;
	}

	.catalog-title {
		font-size: clamp(1.8rem, 3vw, 2.3rem);
		font-weight: 700;
		margin-bottom: 0.5rem;
		letter-spacing: -0.02em;
	}

	.catalog-subtitle {
		font-size: 1rem;
		color: #e5e7eb;
		max-width: 600px;
		line-height: 1.5;
	}

	/* TOPBAR */
	.catalog-topbar {
		background: #ffffff;
		border-radius: 0.75rem;
		padding: 0.75rem 1rem;
		margin-bottom: 1.5rem;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		box-shadow: 0 2px 10px rgba(0,0,0,0.03);
	}

	.catalog-layout {
		display: grid;
		grid-template-columns: 280px 1fr;
		gap: 1.5rem;
	}

	@media (max-width: 991.98px) {
		.catalog-layout {
			grid-template-columns: 1fr;
		}
	}

	/* FILTERS */
	.filters-card {
		background: #ffffff;
		border-radius: 0.75rem;
		padding: 1.25rem;
		position: sticky;
		top: 1rem;
		box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
	}

	.filter-group {
		margin-bottom: 1.25rem;
		border-bottom: 1px solid #f3f4f6;
		padding-bottom: 1rem;
	}
	.filter-group:last-child {
		border-bottom: none;
		margin-bottom: 0;
	}

	.filter-label {
		font-size: 0.95rem;
		font-weight: 600;
		margin-bottom: 0.5rem;
		display: block;
	}

	/* Стили для чекбоксов в виде списка или чипсов */
	.filter-list-item {
		margin-bottom: 0.35rem;
		font-size: 0.9rem;
	}

	.filter-chip-wrap {
		display: flex;
		flex-wrap: wrap;
		gap: 0.25rem;
	}

	.filter-chip {
		cursor: pointer;
		user-select: none;
	}

	/* PRODUCT CARD */
	.products-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 1rem;
	}

	@media (min-width: 768px) {
		.products-grid {
			grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
		}
	}

	.product-card {
		background: #ffffff;
		border-radius: 0.9rem;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		height: 100%;
		border: 1px solid #f1f5f9;
		box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
		transition: transform 0.2s ease, box-shadow 0.2s ease;
	}

	.product-card:hover {
		transform: translateY(-3px);
		box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
		border-color: #e2e8f0;
	}

	.product-card-thumb {
		position: relative;
		display: block;
		width: 100%;
		height: 200px;
		overflow: hidden;
		background: #f8fafc;
	}

	.product-card-thumb img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		padding: 0;
		transition: transform 0.3s;
	}

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

	.product-body {
		padding: 1rem;
		display: flex;
		flex-direction: column;
		flex: 1;
	}

	.product-title {
		font-size: 0.9rem;
		font-weight: 600;
		line-height: 1.4;
		margin-bottom: 0.5rem;
		color: #111827;
		text-decoration: none;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	.product-title:hover {
		color: var(--brand-primary);
	}

	.product-price {
		font-weight: 700;
		font-size: 1.1rem;
		color: #0f172a;
	}
	.rub { font-size: 0.9em; font-weight: 400; color: #64748b; }

	.product-stock {
		font-size: 0.8rem;
		font-weight: 500;
	}
	.text-stock-yes { color: #16a34a; }
	.text-stock-no { color: #dc2626; }

	/* Subcategories Grid */
	.subcats-grid {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 1rem;
		margin-bottom: 2rem;
	}
	.subcat-card {
		background: #fff;
		border: 1px solid #e5e7eb;
		border-radius: 0.75rem;
		padding: 1rem;
		text-decoration: none;
		color: #1f2937;
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
		transition: all 0.2s;
	}
	.subcat-card:hover {
		border-color: var(--brand-primary);
		box-shadow: 0 4px 12px rgba(0,0,0,0.05);
		color: var(--brand-primary);
	}
	.subcat-img {
		height: 100px;
		width: 100%;
		object-fit: contain;
		margin-bottom: 0.5rem;
	}

	/* Mobile Filters Button */
	.btn-filters-mobile {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
	}
	@media (min-width: 992px) {
		.btn-filters-mobile { display: none; }
	}

/* ===========================
	   ORDER PAGE STYLES
	   =========================== */

	/* Стили для карточки варианта доставки */
	.delivery-option-card {
		background: #fff;
		border-color: #e9ecef !important;
		transition: all 0.2s ease-in-out;
		cursor: pointer;
	}

	/* При наведении */
	.delivery-option-card:hover {
		border-color: var(--brand-primary) !important;
		box-shadow: 0 4px 10px rgba(0,0,0,0.05);
	}

	/* Когда радио-кнопка внутри выбрана */
	/* Мы используем :has(), если поддерживается браузерами, или полагаемся на JS клик, который ставит checked */
	.delivery-option-card:has(.form-check-input:checked),
	/* Фоллбэк: JS обычно триггерит клик, так что стандартный :checked тоже должен сработать на лейбле */
	.delivery-option-card input:checked ~ .col .fw-bold {
		color: var(--brand-primary) !important;
	}

	.delivery-option-card input:checked {
		background-color: var(--brand-primary);
		border-color: var(--brand-primary);
	}

	/* Стилизация выбранной карточки через CSS (если input внутри лейбла) */
	label.delivery-option-card:has(input:checked) {
		  border-color: var(--brand-primary) !important;
		  background-color: rgba(31, 111, 235, 0.03) !important; /* Очень легкий оттенок основного цвета */
		  box-shadow: 0 0 0 1px var(--brand-primary) !important;
	}


	/* Кнопка удаления из корзины */
	.cart-delete {
		transition: all 0.2s;
	}
	.cart-delete:hover {
		background-color: rgba(220, 53, 69, 0.1);
	}

	/* Улучшение полей ввода в фокусе */
	.form-control:focus, .form-select:focus {
		border-color: var(--brand-primary);
		box-shadow: 0 0 0 0.25rem rgba(31, 111, 235, 0.15);
	}
	.input-group-text {
		background-color: #f8f9fa;
	}
	.form-control:focus + .input-group-text, .input-group-text:has(+ .form-control:focus) {
		 border-color: var(--brand-primary);
		 color: var(--brand-primary) !important;
	}

	/* Адаптив для липкой правой колонки */
	@media (max-width: 991.98px) {
		.position-sticky[style*="top: 2rem"] {
			position: static !important; /* Отключаем sticky на мобильных */
		}
	}

	/* Обновленные стили для страницы заказа */

	/* Доставка: Карточка */
	.delivery-option-card {
		cursor: pointer;
		border: 1px solid #dee2e6;
		transition: all 0.2s ease;
	}

	/* Подсветка при наведении */
	.delivery-option-card:hover {
		border-color: var(--brand-primary);
		background-color: #f8f9fa !important;
	}

	/* Активная карточка (когда радио выбрано) */
	.delivery-option-card:has(input:checked) {
		border-color: var(--brand-primary);
		background-color: rgba(13, 110, 253, 0.05) !important;
		box-shadow: 0 0 0 1px var(--brand-primary);
	}

	/* Списки товаров */
	.cart-delete {
		opacity: 0.5;
		transition: opacity 0.2s;
	}
	.cart-delete:hover {
		opacity: 1;
		color: #dc3545; /* Красный при наведении */
	}

	/* Отключение sticky на мобильных, чтобы корзина не прыгала */
	@media (max-width: 991.98px) {
		.position-sticky {
			position: static !important;
			z-index: 1 !important;
		}
	}