:root {
    --accent: #725460;
    --accent-hover: #412732;
    --link: #90aecf;
    --link-hover: #6b7888;
    --muted: #6B7280;
    --bg: #F9FAFB;
    --card: #fff;
    --head-bg: #2a2f35;
    --menu: #fff;
    --font-main: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.hidden {
    display: none;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.image-map {
    max-height: 60vh;
    max-width: 90vh;
    object-fit: contain;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: #111;
    font-family: var(--font-main);
}

body {
    background-image: url('./img/back.png');
    background-repeat: repeat;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

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

/* Глобальное применение шрифта для элементов форм */
input, button, select, textarea {
    font-family: inherit;
}

header {
    background: var(--head-bg);
    box-shadow: 0 10px 10px rgba(0,0,0,0.1);
}
header .hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}
header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
}
header nav a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--link);
    font-size: 14px;
    transition: color 0.2s;
}
header nav a:hover {
    color: var(--link-hover);
}

.brand {
    padding-left: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.brand-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: 0 0 auto;
}

.brand-main > img:first-child {
    flex: 0 0 auto;
    max-width: 100%;
}

.top-info {
    min-width: 0;
}

.menu {
    display: flex;
    flex-direction: column;
    padding-right: 20px;
    text-align: right;
}

.top-info h1 {
    font-size: 13px;
    color: var(--menu);
    margin: 0;
    font-weight: normal;
}

.header-promo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    flex: 0 1 auto;
}

.header-promo-image {
    width: 52px;
    height: auto;
    display: block;
    flex: 0 0 auto;
}

.header-promo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #fff;
    line-height: 1.15;
    white-space: nowrap;
}

.header-promo-text span:first-child {
    font-size: 15px;
    font-weight: 700;
}

.header-promo-text span:last-child {
    font-size: 12px;
    color: #dfe8f2;
}

main {
    padding: 32px 0;
}

/* Контролы (фильтры + поиск) */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 20px;
    flex-grow: 1;
}

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn:hover {
    background: #f3f4f6;
}
.btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.card .body .row .actions .btn {
    flex: 1;
    padding: 8px 10px;
    white-space: nowrap;
}

.card .body .row .actions .btn.active {
    flex: 1.2;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.pagination-top {
    grid-column: 1 / -1;
    margin: 12px 0;
}

.pagination .btn {
    min-width: 40px;
    text-align: center;
    justify-content: center;
}
.btn:active {
    transform: scale(0.97);
}

.search {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}
.search input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    flex: 1;
    min-width: 0;
    font-size: 14px;
}
.search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
}

/* Сетка товаров */
.catalog-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.catalog-level {
    display: flex;
    padding: 8px 0;
    position: relative;
    align-items: flex-start;
}

.catalog-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

/* Линия разделения между уровнями */
.catalog-level + .catalog-level {
    border-top: 1px solid #e5e7eb;
}

/* Иконка в подкатегориях */
.cat-icon {
    opacity: 0.5;
    margin-right: 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
    color: var(--muted);
    height: 38px; /* Высота кнопки примерно */
}

/* Динамические отступы для уровней вложенности */
.catalog-level-1 { padding-left: 15px; }
.catalog-level-2 { padding-left: 30px; }
.catalog-level-3 { padding-left: 45px; }
.catalog-level-4 { padding-left: 60px; }

/* Визуальная черта для вложенности */
.catalog-level:not(.catalog-level-0)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
    margin: 8px 0;
}

.catalog-level-1::before { left: 5px; }
.catalog-level-2::before { left: 20px; }
.catalog-level-3::before { left: 35px; }
.catalog-level-4::before { left: 50px; }

.catalog-level-0 {
    padding-bottom: 12px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}
@media (max-width: 480px) {
    header .hdr {
        align-items: flex-start;
        gap: 12px;
    }
    .brand {
        padding-left: 0;
        gap: 10px;
        flex: 1 1 100%;
    }
    .brand-main {
        flex-basis: 100%;
    }
    .top-info {
        order: initial;
    }
    .header-promo {
        margin-left: 0;
        padding: 6px 8px;
        gap: 8px;
    }
    .header-promo-image {
        width: 42px;
    }
    .header-promo-text span:first-child {
        font-size: 13px;
    }
    .header-promo-text span:last-child {
        font-size: 11px;
    }
    .menu {
        padding-right: 0;
    }
    .search .btn {
        padding: 8px 10px;
        font-size: 13px;
    }
    .search .btn.active {
        background: var(--accent);
        color: #fff;
    }
}
@media(min-width: 640px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
}
@media(min-width: 1024px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

.card {
    background: var(--card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.card .imgwrap {
    height: 220px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}
.card .body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.title h2 {
    font-size: 15px;
    margin: 0;
    font-weight: 600;
}
.desc {
    font-size: 13px;
    color: var(--muted);
    flex: 1;
}
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.price {
    font-weight: 700;
    font-size: 15px;
}
.actions {
    display: flex;
    gap: 6px;
}
.actions .btn {
    font-size: 13px;
    padding: 6px 10px;
}

/* Разделы */
#how, #contacts {
    margin-top: 36px;
}
#how h3, #contacts h3 {
    font-size: 18px;
    margin-bottom: 8px;
}
#how ol {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 14px;
}

p {
    color: #000000;
    padding-bottom: 10px;
    margin: 0;
}

/* Footer */
footer {
    margin-top: 40px;
    padding: 18px 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

#seo-text h2 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--accent);
}

#seo-text p {
    margin-bottom: 10px;
    color: var(--muted);
}
footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
}

/* Loader */
.loader {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}
