* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* ===== СКРЫТЫЕ ЭЛЕМЕНТЫ ===== */
.hidden {
    display: none !important;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* ===== ШАПКА ===== */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    flex-shrink: 0; /* Шапка не сжимается */
    min-height: 56px;
}

#header h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.menu-btn,
.profile-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.menu-btn:hover,
.profile-btn:hover {
    opacity: 0.8;
}

/* ===== КОНТЕНТ ===== */
#content {
    flex: 1; /* Растягивается на всё свободное пространство */
    overflow-y: auto; /* Прокрутка если контента много */
	margin: 0 2%;
    width: 96%;
	padding: 10px 0;
    background: #fafafa;
}

/* ===== ПОДВАЛ ===== */
#footer {
    text-align: center;
	padding: 0 10px;
    background: #ffffff;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0; /* Подвал не сжимается */
    font-size: 14px;
    color: #999;
	height: 66px;
}


/* Блок кнопок справа */
.footer-menu {
	display: flex;
	/*gap: 16px;*/
	justify-content: space-evenly;
}
.action-item {
	background: none;
	border: none;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 500;
	color: #334155;
	padding: 4px 8px;
}
.action-item i {
	font-size: 1.8rem;
	color: #475569;
}
.action-item span {
	font-weight: 500;
}



/* Всплывающее окно авторизации */
.auth-popup {
	position: fixed;
    top: 0;
    left: 50%;
    transform: translate(-50%, 5%);
	width: 280px;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 4px 12px #9E9E9E;
	padding: 20px;
	z-index: 200;
	transition: opacity 0.2s ease, visibility 0.2s;
}

.popup-title {
	font-weight: 600;
	font-size: 1rem;
	margin-bottom: 18px;
	color: #1e293b;
	text-align: center;
}

.input-group {
	display: flex;
	align-items: center;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 48px;
	padding: 10px 14px;
	margin-bottom: 14px;
	transition: 0.2s;
}
.input-group i {
	color: #94a3b8;
	font-size: 1rem;
	margin-right: 10px;
}
.input-group input {
	border: none;
	background: transparent;
	width: 100%;
	font-size: 0.9rem;
	outline: none;
}
.input-group:focus-within {
	border-color: #3b82f6;
	box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.login-btn {
	width: 100%;
	background: #3b82f6;
	color: white;
	border: none;
	border-radius: 48px;
	padding: 10px 0;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	margin-top: 8px;
	font-size: 0.9rem;
}
.login-btn:hover {
	background: #2563eb;
}
#loginError {
    color: #e63946;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

.menu-badge {
	position: absolute;
	top: -8px;
	right: -4px;
	background-color: #e63946;
	color: white;
	font-size: 0.8rem;
	font-weight: bold;
	min-width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
	line-height: 1;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.menu-badge.hidden {
	display: none;
}
.menu-badge.pulse {
	animation: pulse 0.3s ease;
}
@keyframes pulse {
	0% { transform: translateY(-50%) scale(1); }
	50% { transform: translateY(-50%) scale(1.3); }
	100% { transform: translateY(-50%) scale(1); }
}


/* Сетка карточек */
.products-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* ===== КАРТОЧКА ===== */
.product-card {
	position: relative;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-radius: 20px;
	overflow: hidden;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	aspect-ratio: 3 / 4;
	background-color: #2d2d2d;
}
/* Затемнение */
.product-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.70) 0%, rgba(0, 0, 0, 0.20) 50%, rgba(0, 0, 0, 0.05) 100%);
	z-index: 1;
	pointer-events: none;
}

/* ===== БЕЙДЖИ ===== */
.badges {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 4;
	display: flex;
	flex-direction: column;
	pointer-events: none;
}
.badge-2 {
	display: inline-block;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	padding: 4px 12px;
	border-radius: 30px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	width: fit-content;
}
.badge-2.hit { background: #e67e22; }
.badge-2.new { background: #22c55e; }
.badge-2.discount { background: #ef4444; }
.badge-2.bestseller { background: #8b5cf6; }

/* ===== ОВЕРЛЕЙ ===== */
.card-overlay {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 2%;
	color: #fff;
}
/* ===== КНОПКА КОРЗИНЫ (справа вверху) ===== */
.cart-top {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 4;
}
.cart-btn {
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	width: 34px;
	height: 34px;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.25s ease, transform 0.2s ease;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.10);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}
.cart-btn.in-cart {
	background: #22c55e;
	border-color: #22c55e;
}
.cart-btn i {
	pointer-events: none;
}

/* ===== НИЖНИЙ БЛОК ===== */
.card-bottom {
	display: flex;
	justify-content: space-between;
	gap: 4px;
	flex-wrap: wrap;
	flex-direction: row;
	align-items: center;
	margin-bottom: 4px;
}
/* Левая часть (наличие + семена) */
.card-bottom .left {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	background: rgba(0, 0, 0, 0.55);
	padding: 6px 12px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.stock {
	font-size: 0.5rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 5px;
	color: #86efac;
}
.stock i {
	font-size: 0.75rem;
}
.stock.out-of-stock {
	color: #fca5a5;
}
.specs {
	font-size: 0.65rem;
	color: #d1d5db;
	display: flex;
	align-items: center;
	gap: 4px;
}
.specs i {
	font-size: 0.7rem;
	color: #9ca3af;
}
.card-bottom .price-tag {
	font-weight: 700;
	color: #ffd966;
	white-space: nowrap;
	flex-shrink: 0;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
	padding: 6px;
	font-size: 14px;
}
.product-title {
	background: rgba(0, 0, 0, 0.45);
	padding: 8px 14px;
	border-radius: 40px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	text-align: center;
	color: #fff;
	font-weight: 600;
	font-size: 0.8rem;
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.2s ease;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.40);
}


/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: #f5f5f5;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	height: calc(100dvh - 66px);
	max-height: calc(100dvh - 66px);
}
.modal-content {
	border-radius: unset;
	max-width: 100%;
	width: 100%;
	height: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0 0 10px 0;
	max-height: 90vh;
	overflow-y: auto;
}

@keyframes modalIn {
	from {
		opacity: 0;
		transform: scale(0.95) translateY(20px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}
.modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 10;
	background: rgba(0, 0, 0, 0.50);
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 1.4rem;
	cursor: pointer;
	transition: 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}
.modal-body {
	display: flex;
	gap: 20px;
	flex-direction: column;
	padding: unset;
	flex: 1;
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
.modal-gallery {
	width: auto;
}
#modalFullText {
	flex: 1;
	border-top: 2px solid #eef1f5;
	width: 100%;
	padding: 10px 10px 0;
}
#modalFullText .text-content {
	font-size: 1rem;
	color: #4b5563;
	max-width: 100%;
	white-space: pre-wrap;
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery-main {
	position: relative;
	overflow: hidden;
	background: #f1f3f6;
	aspect-ratio: 1 / 1;
	max-height: 365px;
	width: 100%;
}
.gallery-main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.3s ease;
}
.gallery-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.50);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border: none;
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	transition: 0.2s;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
}
.gallery-nav:hover {
	background: rgba(0, 0, 0, 0.75);
}
.gallery-nav.prev {
	left: 10px;
}
.gallery-nav.next {
	right: 10px;
}
.gallery-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	overflow-x: auto;
	padding: 0 2%;
}
.gallery-thumbs img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 10px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: 0.2s;
	flex-shrink: 0;
	background: #f1f3f6;
}
.gallery-thumbs img:hover {
	border-color: #9ca3af;
}
.gallery-thumbs img.active {
	border-color: #1e40af;
}

/* ===== ИНФОРМАЦИЯ ===== */
.modal-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	max-width: 100%;
	padding: 0 10px;
}
.modal-title {
	font-size: 1.4rem;
	font-weight: 700;
	color: #1e466e;
}
.modal-block {
	display: flex;
	align-items: center;
	/*justify-content: center;*/
	gap: 12px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}
.modal-block .left {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 6px 12px;
	border-radius: 12px;
	box-shadow: 0 4px 12px #9E9E9E;
}
.modal-price {
	font-weight: 700;
	font-size: 20px;
	color: #e67e22;
	white-space: nowrap;
	flex-shrink: 0;
	padding: 12px 14px;
	border-radius: 12px;
	box-shadow: 0 4px 12px #9E9E9E;
}
.modal-stock {
	font-size: 0.9rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 6px;
}
.modal-stock.in-stock {
	color: #22c55e;
}
.modal-stock.out-of-stock {
	color: #ef4444;
}
.modal-specs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	font-size: 0.95rem;
	color: #4b5563;
}
.modal-specs span {
	display: flex;
	align-items: center;
	gap: 4px;
}
.modal-description {
	font-size: 0.9rem;
	color: #4b5563;
	line-height: 1.6;
	margin: 4px 0;
	white-space: pre-wrap;
}
.modal-actions {
	display: flex;
	gap: 10px;
	margin-top: 4px;
	flex-wrap: wrap;
}
.btn-add-to-cart {
	background: #ff9800;
	color: #fff;
	border: none;
	padding: 12px 24px;
	border-radius: 40px;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: 0.2s;
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: center;
}



/* ===== Меню категорий ===== */
		.menu-container {
			position: fixed;
			top: 0;
			right: 0;
			left: 0;
			width: 100%;
			margin: 0 auto;
			background: #fff;
			display: flex;
			flex-direction: column;
			/*box-shadow: 0 4px 24px #9E9E9E;*/
			height: calc(100dvh - 66px);
			max-height: calc(100dvh - 66px);
			z-index: 2000;
        }
		
		/* ===== ПОИСКОВАЯ ФОРМА ===== */
		.search {
			position: relative;
			width: 92%;
			z-index: 100;
			margin: 10px 4%;
		}
        .search form {
            display: flex;
            border-radius: 16px;
            overflow: hidden;
			box-shadow: 0 4px 12px rgb(0 0 0 / 50%);
            background: #fff;
            transition: 0.2s;
        }
        .search-input {
            flex: 1;
            padding: 14px 20px;
            border: none;
            outline: none;
            font-size: 1rem;
            background: transparent;
            font-family: inherit;
        }
        .search-btn {
            padding: 14px 24px;
            background: #1e40af;
            color: #fff;
            border: none;
            cursor: pointer;
            font-size: 1rem;
            transition: 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* ===== РЕЗУЛЬТАТЫ ПОИСКА (скролл внутри) ===== */
        .search-results {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            right: 0;
            background: #fff;
            border-radius: 16px;
            max-height: 480px;
            display: none;
            z-index: 1000;
            padding: 8px 0;
            overflow: hidden; /* <-- скролл внутри */
            display: none;
            flex-direction: column;
			box-shadow: 0 4px 24px #9E9E9E;
        }
        .search-results.active {
            display: flex;
        }

        /* Контейнер для прокрутки */
        .search-results-scroll {
            flex: 1;
            overflow-y: auto;
            padding: 0;
        }

        /* Стилизация скроллбара (внутри блока) */
        .search-results-scroll::-webkit-scrollbar {
            width: 5px;
        }

        .search-results-scroll::-webkit-scrollbar-track {
            background: transparent;
        }

        .search-results-scroll::-webkit-scrollbar-thumb {
            background: #d1d5db;
            border-radius: 10px;
        }

        .search-results-scroll::-webkit-scrollbar-thumb:hover {
            background: #9ca3af;
        }

        /* ===== ЭЛЕМЕНТ РЕЗУЛЬТАТА ===== */
        .result-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 20px;
            cursor: pointer;
            transition: 0.15s;
            text-decoration: none;
            color: #1f2937;
        }
        .result-item:hover {
            background: #f1f5f9;
        }
        .result-item .result-icon {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 0.9rem;
            color: #fff;
        }
        .result-item .result-icon.product {
            background: #1e40af;
        }
        .result-item .result-icon.category {
            background: #7c3aed;
        }

        .result-item .result-info {
            flex: 1;
            min-width: 0;
        }

        .result-item .result-info .result-name {
            font-size: 0.95rem;
            font-weight: 500;
            color: #0a0a0a;
        }

        .result-item .result-info .result-name mark {
            background: #fef08a;
            padding: 0 2px;
            border-radius: 3px;
        }

        .result-item .result-info .result-path {
            font-size: 0.75rem;
            color: #6b7280;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .result-item .result-price {
            font-size: 0.9rem;
            font-weight: 700;
            color: #e67e22;
            flex-shrink: 0;
        }

        /* ===== СОСТОЯНИЕ ЗАГРУЗКИ ===== */
        .search-loading {
            padding: 20px;
            text-align: center;
            color: #6b7280;
            font-size: 0.95rem;
        }

        .search-loading .spinner {
            display: inline-block;
            width: 24px;
            height: 24px;
            border: 3px solid #e2e8f0;
            border-top-color: #1e40af;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* ===== ПУСТОЙ РЕЗУЛЬТАТ ===== */
        .search-empty {
            padding: 30px 20px;
            text-align: center;
            color: #6b7280;
        }

        .search-empty i {
            font-size: 2rem;
            color: #d1d5db;
            display: block;
            margin-bottom: 8px;
        }

		
		
		

        /* ===== ОСНОВНЫЕ КАТЕГОРИИ (level 0) ===== */
.categories-level0 {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid #eef1f5;
    padding: 10px;
}

.cat-btn {
    padding: 6px 16px;
    border: 1px solid #eef1f5;
    border-radius: 40px;
    background: #f9fafc;
    color: #1f2937;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.cat-btn:hover {
    background: #eef1f5;
    border-color: #d1d5db;
}

.cat-btn.active {
    background: #1e40af;
    color: #fff;
    border-color: #1e40af;
}

/* ===== ПОДКАТЕГОРИИ (вертикальный список) ===== */
.subcategories {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.subcategory-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    color: #1f2937;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    position: relative;
}

.subcategory-item:hover {
    background: #f1f5f9;
}

.subcategory-item .level-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
}

.subcategory-item .level-icon.level1 {
    background: #7c3aed;
}

.subcategory-item .sub-name {
    flex: 1;
}

.subcategory-item.level2-item {
    padding-left: 36px;
    font-size: 0.85rem;
    font-weight: 400;
    color: #4b5563;
    position: relative;
}

.subcategory-item.level2-item::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
    border-radius: 2px;
}

.subcategory-item.level2-item .level-icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    background: #0ea5e9;
}

.subcategory-item.level2-item:hover {
    background: #f0f9ff;
    color: #0c4a6e;
}

.subcategory-item.active {
    background: #1e40af;
    color: #fff;
}

.subcategory-item.active .level-icon.level1 {
    background: #fff;
    color: #7c3aed;
}

.subcategory-item.active .level-icon.level2 {
    background: #fff;
    color: #0ea5e9;
}

.subcategory-item.active.level2-item::before {
    background: #1e40af;
}

.subcategory-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.subcategory-group .level1-wrapper {
    display: flex;
    flex-direction: column;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.empty-state i {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
    color: #d1d5db;
}




	




















/* ===== СКРОЛЛ (стилизация) ===== */
#content::-webkit-scrollbar {
    width: 4px;
}

#content::-webkit-scrollbar-track {
    background: transparent;
}

#content::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

#content::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}