:root {
    --bg: #0b0e14;
    --card: #141b22;
    --muted: white;
    --accent: #7c3aed; /* Фиолетовый акцент */
    --bg-gradient: linear-gradient(135deg, #0b1220 0%, #1a1e29 60%, #0b1220 100%);
    --border: 1px solid rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
    color: #e5e7eb;
    background: var(--bg-gradient);
}

.container {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 0 16px;
}

.site-header {
    background: rgba(20, 25, 30, 0.9);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: var(--border);
    padding: 16px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: .5px;
    color: var(--accent);
}

.accent {
    font-weight: 1700;
    font-size: 1.2rem;
    letter-spacing: .5px;
    color: var(--accent);
}

.btn {
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: darken(var(--accent), 10%);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, .3);
}


.btn-outline-warning {
	background: transparent;
	color: #f59e0b; /* жёлтый Bootstrap warning */
	border: 1px solid #f59e0b;
	transition: background 0.2s, color 0.2s;
}
.btn-outline-warning:hover {
	background: #f59e0b;
	color: #fff;
}



.cart-drawer {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100%;
    background: #111827;
    color: #e5e7eb;
    border-left: var(--border);
    padding: 16px;
    box-shadow: -6px 0 20px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
	max-height: 100vh;
    overflow-y: auto;
}

.cart-drawer[hidden] {
    transform: translateX(100%);
}

.main-content {
    padding: 20px 0 40px;
    display: grid;
    gap: 20px;
}


.user-menu .dropdown {
    position: relative;
}

.user-menu .dropdown-toggle {
    padding: 10px 16px;
    border-radius: 8px;
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-menu .dropdown-menu {
    background: var(--card);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-menu .dropdown-item {
    color: white;
    padding: 10px 16px;
    transition: background 0.3s;
}

.user-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-button .btn {
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-button .btn i {
    font-size: 1.2rem;
}


.categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.chip {
    background: rgba(124, 58, 237, .15);
    border: 1px solid rgba(124, 58, 237, .4);
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    color: white;
	margin: .2rem;
    white-space: nowrap;
    transition: background .2s, color .2s;
}

.chip:hover {
    background: rgba(124, 58, 237, .2);
}

/* Активная кнопка */
.chip.active {
  background: #007bff;   /* любой цвет фона по вашему вкусу */
  color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,
	minmax(250px, 1fr));
	gap: 20px;
}

.card {
	background: var(--card);
	border-radius: 8px;
	padding: 16px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transition: transform 0.2s;
}

.card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.image {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
}

.image img {
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.name {
	font-size: 1.3rem;
	font-weight: 600;
	margin: 12px 0 6px;
	color: white;
}

.price {
	font-size: 1.1rem;
	font-weight: 500;
	color: white;
}

.volume {
	font-size: 1.1rem;
	font-weight: 300;
	color: white;
}

.raiting {
	font-size: 1.1rem;
	font-weight: 300;
	color: white;
}

.packings {
	font-size: 0.9rem;
	color: var(--muted);
	margin-bottom: 8px;
}

.add-btn {
	width: 100%;
	margin-top: 12px;
}

.product-desc {
	width: 100%;
	padding: 12px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	color: white;
}

.cart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.cart-item {
	display: flex;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-thumb {
	width: 60px;
	height: 60px;
	border-radius: 8px;
	overflow: hidden;
}

.cart-thumb img {
	height: 100%;
	object-fit: cover;
}

.cart-item-info {
	flex: 1;
}

.cart-item-name {
	font-weight: 600;
}

.cart-item-variant {
	font-size: 0.9rem;
	color: var(--muted);
}

.cart-qty-form {
	display: flex;
	align-items: center;
	gap: 6px;
}

.qty-input {
	width: 60px;
	padding: 6px;
	text-align: center;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
}

.cart-total {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 16px 0;
}

.site-footer {
	padding: 20px 0;
	background: rgba(0, 0, 0, 0.8);
	color: #9ca3af;
	border-top: var(--border);
}


.product-detail-container {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.product-main {
	display: flex;
	gap: 20px;
}
.product-image {
	flex: 1;
	cursor: pointer;
}
.product-image img {
	height: 100%;
	border-radius: 8px;
}
.product-info {
	flex: 1;
	display: flex;
	flex-direction: column;
}
.product-title {
	font-size: 2rem;
	font-weight: bold;
}
.product-price {
	font-size: 1.5rem;
	color: var(--accent);
	margin: 10px 0;
}
.recommendations h4 {
	margin-top: 30px;
}
.recommended-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 15px;
}
.recommended-products .card {
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.2s;
}
.recommended-products .card:hover {
	transform: translateY(-2px);
}
.card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.card-body {
	color: white;
	padding: 8px;
}

/* сама картинка в карточке */
.card .image img {
	width: 100%;
	max-height: 400px;
	object-fit: cover;
}

/* Общие стили для «плейсхолдера» без картинки */
.product-img.placeholder,
.recproduct-img.placeholder {
	/* Растянуть на всю ширину родителя (карточки) */
	width: 100%;
	/* Задать соотношение сторон 1:1 => квадрат */
	aspect-ratio: 1 / 1;
	/* Фон и цвет текста по вкусу */
	background-color: #f0f0f0;
	color: #888;
	/* Опционально: размер шрифта и перенос строки, если текст длиннее */
	font-size: 14px;
	text-align: center;
	/* Flex-центрирование */
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center; /* на всякий случай, если строка многострочная */
}


/* Если браузер не поддерживает aspect-ratio, можно обойтись «padding-трюком» */
.no-aspect-ratio .product-img.placeholder,
.no-aspect-ratio .recproduct-img.placeholder {
	position: relative;
	width: 100%;
	padding-top: 100%; /* высота = ширина */
}
.no-aspect-ratio .product-img.placeholder > *,
.no-aspect-ratio .recproduct-img.placeholder > * {
	position: absolute;
	top: 0; bottom: 0; left: 0; right: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center; /* на всякий случай, если строка многострочная */
}

/* Для увеличение изображения */
#modalImage {
    max-height: 90vh;
    object-fit: contain;
}


#recommendations-list .card-body img,
#recommendations-list .card-body .recproduct-img {
	display: block;
	margin-bottom: 0.5rem; /* регулируйте величину под ваш дизайн */
}

#recommendations-list .recproduct-img.placeholder {
	display: flex !important;
	justify-content: center;
	align-items: center;
}

@media (max-width: 768px) {
	.main-content {
		grid-template-columns: 1fr;
	}
 
	.header-inner {
		flex-direction: column;
		align-items: center;
	}
 
	.categories {
		flex-wrap: wrap;
	}
	.account-container .row {
		flex-direction: column;
		width: 100%;
	}
	/* Сделать колонки полно шириной */
	.col-md-4,
	.col-md-8 {
		flex: 1 1 100%;
		max-width: 100%;
	}
	/* Обеспечить, чтобы контейнер внутри account-container имел 98% ширины */
	.account-container {
		width: 100%;
		margin: 0 auto; /* Центрирование */
		box-sizing: border-box;
	}
	.products-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.card {
		width: 100%; /* явно растягивать */
	}
	.card img {
		height: 100%;
		object-fit: cover;
	}
	/* Чтобы все контейнеры растягивались на 100% */
	.container {
		max-width: 100% !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	/* Внутри аккаунта — убрать лишние отступы */
		#shop-content .header-inner,
		#shop-content .container {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}

@media (max-width: 480px) {
	.cart-drawer {
		width: 100%;
	}

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

	.card img {
		height: 100%;
		object-fit: cover;
	}
	/* Чтобы все контейнеры растягивались на 100% */
	.container {
		max-width: 100% !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	/* Внутри аккаунта — убрать лишние отступы */
		#shop-content .header-inner,
		#shop-content .container {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}



/* Базовый стиль для всех ссылок */
a {
    color: white;         /* Белый цвет текста */
    text-decoration: none; /* Убираем стандартное подчеркивание */
    transition: color 0.3s; /* Плавное изменение цвета при наведении */
}

/* Опциональные состояния ссылок */
a:hover {
    color: var(--accent);  /* При наведении меняем цвет на акцентный */
    text-decoration: none; /* Сохраняем отсутствие подчеркивания */
}

a:visited {
    color: white;         /* Цвет посещенной ссылки */
    text-decoration: none;
}

a:active {
    color: var(--accent);  /* Цвет при нажатии */
    text-decoration: none;
}


.star-rating {
	direction: rtl;
	font-size: 2rem;
}
.star-rating input { display: none; }
.star-rating label {
	color: #ccc;
	cursor: pointer;
}
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
	color: #ffd700;
}

/* Переопределяем цвет ссылок в блоке поиска */
#search-results a {
	/* по умолчанию делаем их фиолетовыми */
	color: var(--accent);
	transition: color 0.3s;
}

#search-results a:hover,
#search-results a:active {
	/* при наведении и нажатии тоже можно чуть изменить, если нужно */
	color: var(--accent);
}

#search-results a:visited {
	/* важное — !important, чтобы перебить глобальный a:visited { color: white } */
	color: var(--accent) !important;
}

#search-results .list-group-item,
#search-results .list-group-item:visited {
	color: var(--accent) !important;
}

#ai-chat-widget {
	position: fixed;
	bottom: 20px; right: 20px;
	width: 300px; max-height: 400px;
	background: white; border: 1px solid #ccc;
	box-shadow:0 2px 8px rgba(0,0,0,0.2);
	display:none; flex-direction: column;
	font-family: sans-serif;
}

#ai-chat-widget header {
	background:#007bff; color:white; padding:8px;
	cursor:pointer;
}

#ai-chat-widget .messages {
	flex:1; overflow-y:auto; padding:8px; color:black;
}

#ai-chat-widget .input {
	display:flex; border-top:1px solid #eee;
}

#ai-chat-widget .input input {
	flex:1; border:none; padding:8px;
}

#ai-chat-widget .input button {
	border:none; background:#007bff; color:white; padding:0 16px;
}

#ai-chat-toggle {
	position: fixed; bottom:20px; right:20px;
	background:#007bff; color:white; width:50px; height:50px;
	border-radius:50%; border:none; font-size:24px;
	cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,0.2);
}