/* === BOSPA v6.0 — Nature's Warmth UI === */
:root {
    --primary: #4d3123;
    --primary-light: #5c4033;
    --primary-dark: #3a2218;
    --accent: #c8850a;
    --accent-light: #daa520;
    --accent-dark: #9e6b06;
    --warm: #b5651d;
    --green: #518833;
    --green-light: #e8f3de;
    --red: #b7090b;
    --bg: #fdf7f0;
    --bg-alt: #f5ede2;
    --bg-card: #fff;
    --text: #4d3123;
    --text-secondary: #7a5f4f;
    --text-light: #a08a7a;
    --border: #e8ddd0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(77,49,35,0.06);
    --shadow-md: 0 4px 20px rgba(77,49,35,0.1);
    --shadow-lg: 0 8px 32px rgba(77,49,35,0.14);
    --glow: 0 0 25px rgba(255,195,41,0.35);
    --glow-green: 0 0 25px rgba(81,136,51,0.3);
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
    --container: 1200px;
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Comfortaa', 'Nunito', cursive;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
a { color: var(--green); text-decoration: none; transition: all var(--transition); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }

/* === HEADER === */
.header {
    background: var(--bg);
    color: var(--text);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 0 40px rgba(77,49,35,0.1);
    border-bottom: none;
    transition: box-shadow 0.3s ease;
}
.header--scrolled {
    background: rgba(253,247,240,0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 40px rgba(77,49,35,0.15);
}
.header--scrolled .header__inner {
    height: 64px;
    transition: height 0.3s ease;
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 16px;
}

/* Logo sprite: 270x198 GIF, top half = normal, bottom half = hover.
   background-position мгновенно переключает половинки */
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo__sprite {
    display: block;
    width: 220px;
    height: 80px;
    background: url('/assets/img/logo.gif') no-repeat 0 0;
    background-size: 220px 160px;
}
.logo:hover .logo__sprite {
    background-position: 0 -80px;
}

.header__contacts { display: flex; gap: 16px; align-items: center; }
.header__phone {
    color: var(--green);
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    border: 2px solid var(--green);
    padding: 6px 18px;
    border-radius: 30px;
    transition: all var(--transition);
}
.header__phone:hover { background: var(--green); color: #fff; }
.header__email { color: var(--text-light); font-size: 0.85rem; }
.header__email:hover { color: var(--accent); }

/* Mobile phone (hidden on desktop, shown on mobile between logo and burger) */
.header__phone-mobile { display: none; }

/* Burger */
.burger {
    display: none;
    width: 42px; height: 42px;
    background: #f5f3ef;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background var(--transition);
}
.burger:hover { background: var(--border); }
.burger span {
    display: block; width: 22px; height: 2px;
    background: var(--primary); border-radius: 2px;
    transition: var(--transition);
}

/* === NAV === */
.nav {
    background: var(--primary);
    border-top: none;
    border-bottom: 3px solid var(--green);
    position: relative;
    z-index: 90;
}
.nav__list { display: flex; list-style: none; flex-wrap: nowrap; align-items: stretch; }
.nav__item { position: relative; }
.nav__link {
    display: flex; align-items: center; gap: 5px;
    color: rgba(255,255,255,0.8);
    padding: 11px 14px; font-size: 0.88rem;
    font-weight: 500; transition: all var(--transition);
    position: relative; white-space: nowrap; height: 100%;
}
.nav__icon { display: inline-flex; vertical-align: middle; opacity: 0.5; position: relative; top: -1px; transition: opacity var(--transition); flex-shrink: 0; }
.nav__link:hover .nav__icon { opacity: 1; }
.nav__link::after {
    content: ''; position: absolute; bottom: 0; left: 50%; width: 0;
    height: 3px;
    background: var(--green);
    transition: all var(--transition);
    transform: translateX(-50%);
    border-radius: 3px 3px 0 0;
}
.nav__link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav__link:hover::after { width: 80%; }

/* Стрелка у родительского пункта */
.nav__arrow {
    font-size: 0.65rem; opacity: 0.6; margin-left: 1px;
    transition: transform var(--transition); display: inline-block;
}
.nav__item--has-dropdown:hover .nav__arrow,
.nav__item--has-dropdown.open .nav__arrow { transform: rotate(180deg); opacity: 1; }

/* Dropdown */
.nav__dropdown {
    display: none;
    position: absolute; top: 100%; left: 0;
    background: #fff; min-width: 200px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    border-top: 3px solid var(--green);
    z-index: 200;
    animation: dropDown 0.18s ease;
}
@keyframes dropDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.nav__item--has-dropdown:hover .nav__dropdown { display: block; }

.nav__dropdown-link {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 16px; font-size: 0.87rem; color: var(--text);
    transition: all var(--transition); border-bottom: 1px solid var(--border);
}
.nav__dropdown-link:last-child { border-bottom: none; }
.nav__dropdown-link:hover { background: rgba(81,136,51,0.06); color: var(--green); padding-left: 22px; }
.nav__dropdown-link .nav__icon { opacity: 0.4; }
.nav__dropdown-link:hover .nav__icon { opacity: 0.9; }

/* Мега-дропдаун (Каталог) */
.nav__dropdown--mega {
    display: none;
    min-width: 420px;
    padding: 0;
}
.nav__item--has-dropdown:hover .nav__dropdown--mega { display: flex; }
.nav__dropdown-col { flex: 1; padding: 8px 0; }
.nav__dropdown-col + .nav__dropdown-col {
    border-left: 1px solid var(--border);
}
.nav__dropdown-group {
    padding: 8px 16px 4px;
    font-family: var(--font-heading);
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--green);
}

/* === MAIN === */
.main { flex: 1; padding: 24px 0 40px; }

/* === SLIDER === */
.slider { margin-bottom: 32px; border-radius: var(--radius); overflow: hidden; position: relative; box-shadow: 0 4px 24px rgba(45,37,32,0.12); border: 1px solid var(--border); }
.slider img { width: 100%; display: block; aspect-ratio: 3/1; object-fit: cover; }
.slider__item { position: absolute; top: 0; left: 0; width: 100%; opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }
.slider__item.active { position: relative; opacity: 1; pointer-events: auto; }

/* === SECTION TITLES === */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 28px;
    padding-bottom: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.section-title::before {
    content: '';
    width: 5px;
    height: 30px;
    background: linear-gradient(180deg, var(--green), var(--accent));
    border-radius: 3px;
    flex-shrink: 0;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--green) 0%, rgba(81,136,51,0.15) 50%, transparent 100%);
    border-radius: 2px;
}

/* === CARDS GRID === */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 36px;
}
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(77,49,35,0.12);
    border-color: rgba(200,133,10,0.3);
}
.card__image-wrap {
    position: relative;
    background: var(--bg);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.card__image {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: contain;
    display: block;
    padding: 10px;
    transition: transform 0.4s ease, filter 0.4s ease;
}
.card:hover .card__image {
    transform: scale(1.1);
    filter: drop-shadow(0 0 25px rgba(255,195,41,0.5));
}
.card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card__category {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 4px 12px;
    background: var(--green-light);
    border-radius: 20px;
    align-self: flex-start;
    transition: all var(--transition);
}
.card:hover .card__category { background: var(--green); color: #fff; }
.card__title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--accent); }
.card__excerpt { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; flex: 1; }
.card__meta {
    display: flex; justify-content: space-between;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem; color: var(--text-light);
}

/* === ARTICLE PAGE === */
.article {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.article__title { font-family: var(--font-heading); font-size: 1.75rem; margin-bottom: 12px; color: var(--primary); line-height: 1.3; font-weight: 700; }
.article__meta {
    color: var(--text-light); font-size: 0.88rem;
    margin-bottom: 24px; padding-bottom: 16px;
    border-bottom: 2px solid rgba(81,136,51,0.2);
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.article__meta a { color: var(--green); font-weight: 500; }
.article__image { margin-bottom: 24px; border-radius: var(--radius-sm); }

.article__content {
    line-height: 1.8;
    font-size: 1.02rem;
    color: var(--text);
    /* Комфортная ширина строки для чтения */
    max-width: 760px;
}

/* Переопределяем inline text-align: center из WYSIWYG-редакторов.
   Центровка текста — нечитаемо; только для изображений допустимо. */
.article__content p,
.article__content p[style],
.article__content p * {
    text-align: left !important;
}
.article__content h1,
.article__content h1[style],
.article__content h2,
.article__content h2[style],
.article__content h3,
.article__content h3[style],
.article__content h4,
.article__content h4[style] {
    text-align: left !important;
}
/* Span-ы с инлайн font-size внутри заголовков — выравниваем */
.article__content h1 *,
.article__content h2 *,
.article__content h3 * { text-align: left !important; }

.article__content p { margin-bottom: 1em; }
.article__content p:last-child { margin-bottom: 0; }

.article__content img {
    border-radius: var(--radius-sm);
    margin: 20px auto;
    max-width: 100%; height: auto;
    cursor: pointer; transition: opacity var(--transition);
    float: none !important; display: block;
    box-shadow: var(--shadow);
}
.article__content img:hover { opacity: 0.88; }

.article__content h1,
.article__content h2,
.article__content h3,
.article__content h4 {
    font-family: var(--font-heading);
    line-height: 1.3;
    color: var(--primary);
    margin-top: 1.8em;
    margin-bottom: 0.5em;
    font-weight: 700;
}
.article__content h1 { font-size: 1.6rem; }
.article__content h2 {
    font-size: 1.3rem;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(81,136,51,0.2);
}
.article__content h3 { font-size: 1.12rem; color: var(--text-secondary); }
.article__content h4 { font-size: 1rem; color: var(--text-secondary); }

/* Первый заголовок — без отступа сверху */
.article__content > h1:first-child,
.article__content > h2:first-child,
.article__content > h3:first-child { margin-top: 0; }

.article__content ul,
.article__content ol {
    margin: 0.6em 0 1em 1.5em;
    padding: 0;
}
.article__content li { margin-bottom: 0.35em; line-height: 1.65; }
.article__content ul li::marker { color: var(--green); }

.article__content table {
    width: 100%; border-collapse: collapse;
    margin: 1.2em 0; font-size: 0.92rem;
    border-radius: var(--radius-sm); overflow: hidden;
    box-shadow: var(--shadow);
}
.article__content td,
.article__content th {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.article__content th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.article__content tr:nth-child(even) td { background: #faf8f5; }

.article__content blockquote {
    border-left: 4px solid var(--green);
    padding: 14px 20px;
    margin: 1.4em 0;
    background: rgba(81,136,51,0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
}
.article__content blockquote p { margin-bottom: 0; }

/* Ссылки внутри текста */
.article__content a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.article__content a:hover { color: var(--accent-dark); }

/* Strong, em */
.article__content strong { font-weight: 700; color: var(--primary); }
.article__content em { font-style: italic; }

/* === BREADCRUMBS === */
.breadcrumbs { margin-bottom: 20px; font-size: 0.85rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; align-items: center; padding: 8px 14px; background: rgba(81,136,51,0.04); border-radius: var(--radius-sm); border: 1px solid rgba(81,136,51,0.08); }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs span { margin: 0 6px; opacity: 0.7; }

/* === PAGINATION === */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500;
    background: var(--bg-card); color: var(--text);
    box-shadow: var(--shadow); border: 1px solid var(--border);
    transition: all var(--transition);
}
.pagination a:hover { background: var(--green); color: #fff; border-color: var(--green); transform: translateY(-1px); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* === STATIC PAGE === */
.static-page { background: var(--bg-card); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.static-page h1 { font-family: var(--font-heading); font-size: 1.75rem; margin-bottom: 20px; color: var(--primary); }
.static-page p { margin-bottom: 16px; }
.static-page ul, .static-page ol { margin: 10px 0 16px 24px; }
.static-page a { color: var(--accent-dark); }

/* === 404 === */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 h1 { font-family: var(--font-heading); font-size: 5rem; color: var(--accent); font-weight: 900; line-height: 1; }
.page-404 p { font-size: 1.15rem; color: var(--text-secondary); margin: 16px 0 28px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px;
    background: var(--green);
    color: #fff;
    border: none; border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition);
    box-shadow: 0 2px 12px rgba(81,136,51,0.2);
}
.btn:hover { color: #fff; transform: translateY(-2px) scale(1.03); box-shadow: 0 6px 24px rgba(81,136,51,0.3); filter: brightness(1.1); }
.btn--dark { background: var(--primary); box-shadow: 0 2px 12px rgba(77,49,35,0.2); }
.btn--dark:hover { background: var(--primary-light); filter: brightness(1.15); }
.btn--warm { background: var(--accent); box-shadow: 0 2px 12px rgba(200,133,10,0.2); }
.btn--warm:hover { filter: brightness(1.1); }

/* === FOOTER === */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.65);
    padding: 40px 0 32px;
    margin-top: auto;
    border-top: 4px solid var(--green);
    position: relative;
}
.footer__inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
.footer__copy { font-family: var(--font-heading); font-weight: 700; color: rgba(255,255,255,0.9); margin-bottom: 6px; font-size: 1rem; }
.footer__info { font-size: 0.82rem; line-height: 1.7; max-width: 500px; }
.footer__contacts { display: flex; gap: 12px; flex-wrap: wrap; }
.footer__contacts a {
    color: #fff; padding: 6px 14px;
    background: rgba(81,136,51,0.2); border: 1px solid rgba(81,136,51,0.3);
    border-radius: 20px; font-size: 0.85rem;
    transition: all var(--transition);
}
.footer__contacts a:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* === LIGHTBOX === */
.lightbox {
    display: none; position: fixed; z-index: 9999;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30,24,20,0.92);
    align-items: center; justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    animation: lbFadeIn 0.25s ease;
}
.lightbox.active { display: flex; }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox__img {
    max-width: 92vw; max-height: 88vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 48px rgba(0,0,0,0.6);
    animation: lbZoomIn 0.3s ease; cursor: default;
}
@keyframes lbZoomIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lightbox__close {
    position: absolute; top: 16px; right: 20px;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.8rem; font-weight: 300; cursor: pointer;
    background: rgba(255,255,255,0.08); border-radius: 50%;
    transition: all var(--transition);
}
.lightbox__close:hover { background: var(--accent); transform: rotate(90deg); }
.lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    color: #fff; font-size: 1.5rem; cursor: pointer;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08); border-radius: 50%;
    user-select: none; transition: all var(--transition);
}
.lightbox__nav:hover { background: var(--accent); }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 768px) {
    :root { --container: 100%; }
    .container { padding: 0 12px; }

    .header__inner { height: 56px; }
    .header__contacts { display: none; }
    .header__phone-mobile {
        display: block;
        margin-left: auto;
        color: var(--accent-dark);
        font-weight: 700;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    .burger { display: flex; }
    .logo__sprite { width: 120px; height: 44px; background-size: 120px 88px; }
    .logo:hover .logo__sprite { background-position: 0 -44px; }

    .nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--primary); box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 99;
        max-height: 80vh; overflow-y: auto;
    }
    .nav--open { display: block; animation: slideDown 0.3s ease; }
    @keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
    .nav__list { flex-direction: column; flex-wrap: wrap; }
    .nav__item { width: 100%; }
    .nav__link { padding: 13px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.95rem; }
    .nav__link::after { display: none; }

    /* Мобильный дропдаун — аккордеон */
    .nav__dropdown,
    .nav__dropdown--mega {
        display: none !important;
        position: static; box-shadow: none; border-top: none; border-radius: 0;
        border-left: 3px solid var(--green); margin-left: 20px;
        background: rgba(255,255,255,0.05); animation: none;
        flex-direction: column; min-width: auto; width: auto;
    }
    .nav__item--has-dropdown.open .nav__dropdown,
    .nav__item--has-dropdown.open .nav__dropdown--mega { display: flex !important; }
    .nav__dropdown-col { border-left: none; padding: 0; }
    .nav__dropdown-group { color: rgba(81,136,51,0.8); padding: 8px 14px 4px; }
    .nav__dropdown-link { color: rgba(255,255,255,0.7); border-bottom: 1px solid rgba(255,255,255,0.05); padding: 10px 14px; }
    .nav__dropdown-link:hover { background: rgba(255,255,255,0.06); color: #fff; padding-left: 18px; }
    .nav__link--parent { cursor: pointer; }

    .cards { grid-template-columns: 1fr; gap: 14px; }
    .card__image { aspect-ratio: 16/9; padding: 6px; }

    .article { padding: 16px; border-radius: var(--radius-sm); }
    .article__title { font-size: 1.35rem; }
    .article__content { font-size: 0.97rem; line-height: 1.75; max-width: 100%; }
    .article__content img { margin: 14px auto; border-radius: 6px; }
    .article__content h1 { font-size: 1.25rem; }
    .article__content h2 { font-size: 1.1rem; }

    .breadcrumbs { font-size: 0.8rem; margin-bottom: 14px; }
    .static-page { padding: 16px; }
    .static-page h1 { font-size: 1.4rem; }
    .section-title { font-size: 1.2rem; margin-bottom: 16px; }

    .footer { padding: 24px 0; }
    .footer__inner { flex-direction: column; align-items: center; text-align: center; }
    .footer__contacts { justify-content: center; }

    .lightbox__img { max-width: 96vw; max-height: 80vh; border-radius: 6px; }
    .lightbox__nav { width: 40px; height: 40px; font-size: 1.2rem; }
    .lightbox__prev { left: 8px; }
    .lightbox__next { right: 8px; }
    .lightbox__close { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 1.5rem; }

    .page-404 { padding: 50px 16px; }
    .page-404 h1 { font-size: 3.5rem; }
}

@media (max-width: 400px) {
    .logo__sprite { width: 100px; height: 37px; background-size: 100px 74px; }
    .logo:hover .logo__sprite { background-position: 0 -37px; }
    .header__phone-mobile { font-size: 0.8rem; }
    .cards { grid-template-columns: 1fr; }
    .card__title { font-size: 0.95rem; }
    .article__title { font-size: 1.2rem; }
}

/* === SEARCH === */
.header__search-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-secondary); transition: all var(--transition);
    flex-shrink: 0;
}
.header__search-btn:hover { background: var(--bg); color: var(--accent); }
.header__search-wrap {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-top: 1px solid var(--border);
    padding: 12px 0; z-index: 98;
    display: none;
}
.header__search-wrap.open { display: block; animation: slideDown 0.2s ease; }
.header__search-inner {
    max-width: var(--container); margin: 0 auto; padding: 0 16px;
    display: flex; gap: 10px; align-items: center;
}
.header__search-input {
    flex: 1; padding: 10px 16px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-size: 1rem; font-family: var(--font);
    outline: none; transition: border-color var(--transition);
}
.header__search-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(81,136,51,0.12); }
.header__search-submit {
    padding: 10px 20px; background: var(--green); color: #fff;
    border: none; border-radius: 30px; font-size: 0.9rem;
    font-weight: 600; cursor: pointer; transition: all var(--transition);
    font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 0.3px;
}
.header__search-submit:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* === SLIDER CONTROLS === */
.slider { position: relative; }
.slider__arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; z-index: 10;
    background: rgba(0,0,0,0.4); color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 1.2rem;
    transition: background var(--transition); user-select: none;
    backdrop-filter: blur(4px);
}
.slider__arrow:hover { background: var(--accent); }
.slider__arrow--prev { left: 14px; }
.slider__arrow--next { right: 14px; }
.slider__dots {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 10;
}
.slider__dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,0.5); border: none; cursor: pointer;
    padding: 0; transition: all var(--transition);
}
.slider__dot.active { background: var(--accent); transform: scale(1.25); }

/* === SLIDER HERO (текст поверх слайда) === */
.slider__item { position: relative; display: none; }
.slider__item.active { display: block; }
.slider__caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 40px 32px 24px;
    background: linear-gradient(to top, rgba(30,24,20,0.8) 0%, rgba(30,24,20,0.2) 60%, transparent 100%);
    color: #fff;
}
.slider__caption-title {
    font-family: var(--font-heading);
    font-size: 1.6rem; font-weight: 700; margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4); line-height: 1.3;
}
.slider__caption-btn {
    display: inline-block; padding: 10px 24px;
    background: var(--green); color: #fff;
    border-radius: 30px; font-family: var(--font-heading);
    font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
    transition: all var(--transition);
}
.slider__caption-btn:hover { filter: brightness(1.15); color: #fff; transform: translateY(-1px); }

/* === HOME ABOUT === */
.home-about {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    padding: 32px 36px; margin-bottom: 36px;
    display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
}
.home-about__text h2 { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; color: var(--primary); }
.home-about__text p { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.6; }
.home-about__contacts { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.home-about__phone {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 1rem; color: var(--green);
    white-space: nowrap; border: 2px solid var(--green);
    padding: 8px 18px; border-radius: 30px; transition: all var(--transition);
}
.home-about__phone:hover { background: var(--green); color: #fff; }
.home-about__links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.home-about__link {
    padding: 6px 14px; background: var(--green-light);
    border: 1px solid rgba(81,136,51,0.2); border-radius: 20px;
    font-size: 0.82rem; color: var(--green); transition: all var(--transition);
}
.home-about__link:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* === BACK TO TOP === */
.back-to-top {
    position: fixed; bottom: 28px; right: 24px; z-index: 200;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--green);
    color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(81,136,51,0.3); transition: all var(--transition);
    opacity: 0; transform: translateY(16px); pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(81,136,51,0.4); }

/* === NAV ACTIVE === */
.nav__link.active { color: #fff !important; }
.nav__link.active::after { width: 80% !important; }
.nav__link.active .nav__icon { opacity: 1; }

/* === SEARCH PAGE === */
.search-page { }
.search-page__form { display: flex; gap: 10px; margin-bottom: 28px; }
.search-page__input {
    flex: 1; padding: 12px 18px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-size: 1rem; font-family: var(--font);
    outline: none; transition: border-color var(--transition);
}
.search-page__input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(81,136,51,0.12); }
.search-page__empty { text-align: center; padding: 48px 0; color: var(--text-secondary); font-size: 1.05rem; }
.search-results__count { color: var(--text-light); font-size: 0.9rem; margin-bottom: 20px; }

/* === VK SVG ICON === */
.footer__contacts a svg { vertical-align: middle; margin-right: 4px; display: inline; }

/* === 404 IMPROVED === */
.page-404__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* === ZOO INTERACTIVE MAP === */
.zoo-map-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 32px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.zoo-map {
    position: relative;
    width: 1200px;
    height: 916px;
    background: url('/assets/img/zoo/fon.jpg') no-repeat 0 0;
    background-size: 1200px 916px;
    transform-origin: top left;
}

/* Спрайт-элементы */
.zoo-sprite {
    position: absolute;
    display: block;
    background-image: url('/assets/img/zoo/sprites.png');
    background-repeat: no-repeat;
    cursor: pointer;
    transition: filter 0.25s ease, transform 0.25s ease;
    z-index: 2;
}
.zoo-sprite:hover {
    background-image: url('/assets/img/zoo/sprites_active.png');
    filter: drop-shadow(0 0 12px rgba(212,147,13,0.7));
    transform: scale(1.05);
    z-index: 10;
}

/* Тултип-лейбл */
.zoo-sprite__label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.zoo-sprite__label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--primary);
}
.zoo-sprite:hover .zoo-sprite__label {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Позиции спрайтов — из оригинального CSS zoo.bospa.ru */
.zoo-sprite--red-parrot {
    width: 190px; height: 140px;
    background-position: -10px -11px;
    top: 42px; left: -7px;
}
.zoo-sprite--canary {
    width: 250px; height: 194px;
    background-position: -487px -385px;
    top: 91px; left: 906px;
}
.zoo-sprite--birds {
    width: 174px; height: 157px;
    background-position: -665px -62px;
    left: 931px; top: 272px;
}
.zoo-sprite--shell-parakeet {
    width: 106px; height: 172px;
    background-position: -864px 0;
    top: 660px; left: 155px;
}
.zoo-sprite--parrot-hamster {
    width: 116px; height: 192px;
    background-position: -860px -194px;
    top: 352px; left: -6px;
}
.zoo-sprite--hamsters {
    width: 153px; height: 119px;
    background-position: -520px -230px;
    top: 700px; left: 787px;
}
.zoo-sprite--single-hamster {
    width: 110px; height: 134px;
    background-position: -353px -425px;
    top: 710px; left: 938px;
}
.zoo-sprite--guinea-pig {
    width: 134px; height: 134px;
    background-position: -734px -258px;
    top: 719px; left: 666px;
}
.zoo-sprite--rabbit {
    width: 236px; height: 162px;
    background-position: -750px -408px;
    top: 498px; left: 9px;
}

/* Кнопки ПТИЦЫ / ГРЫЗУНЫ */
.zoo-sprite--btn-birds {
    width: 175px; height: 47px;
    background-position: -354px -607px;
    left: 947px; top: 404px;
}
.zoo-sprite--btn-rodents {
    width: 174px; height: 57px;
    background-position: -652px -8px;
    left: 948px; top: 450px;
}
.zoo-sprite--btn-birds:hover,
.zoo-sprite--btn-rodents:hover {
    transform: scale(1.08);
}

/* === ZOO CATEGORY PAGE HEADERS (Грызуны / Птицы) === */
.zoo-cat-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 28px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.zoo-cat-map {
    position: relative;
    width: 1200px;
    transform-origin: top left;
}
.zoo-cat-map--grizuny {
    height: 800px;
    background: url('/assets/img/zoo/header_grizuny.png') no-repeat 0 0;
    background-size: 1200px 800px;
}
.zoo-cat-map--pticy {
    height: 775px;
    background: url('/assets/img/zoo/header_pticy.png') no-repeat 0 0;
    background-size: 1200px 775px;
}

/* Спрайты животных на внутренних страницах */
.zoo-cat-sprite {
    position: absolute;
    display: block;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: filter 0.25s ease, transform 0.25s ease;
    z-index: 2;
}
.zoo-cat-sprite:hover {
    filter: drop-shadow(0 0 12px rgba(212,147,13,0.7));
    transform: scale(1.08);
    z-index: 10;
}

/* --- Грызуны: спрайты --- */
.zoo-cat-sprite[class*="--gz-"] { background-image: url('/assets/img/zoo/sprites_grizuny.png'); }
.zoo-cat-sprite[class*="--gz-"]:hover { background-image: url('/assets/img/zoo/sprites_grizuny_active.png'); }

.zoo-cat-sprite--gz-hamster {
    width: 118px; height: 121px;
    background-position: -92px -645px;
    top: 640px; left: 95px;
}
.zoo-cat-sprite--gz-porpoises {
    width: 133px; height: 121px;
    background-position: -316px -601px;
    top: 590px; left: 305px;
}
.zoo-cat-sprite--gz-mouse {
    width: 126px; height: 121px;
    background-position: -511px -476px;
    top: 482px; left: 515px;
}
.zoo-cat-sprite--gz-rabbit {
    width: 239px; height: 152px;
    background-position: -943px -671px;
    top: 681px; left: 934px;
}

/* --- Птицы: спрайты --- */
.zoo-cat-sprite[class*="--pt-"] { background-image: url('/assets/img/zoo/sprites_pticy.png'); }
.zoo-cat-sprite[class*="--pt-"]:hover { background-image: url('/assets/img/zoo/sprites_pticy_active.png'); }

.zoo-cat-sprite--pt-parakeet {
    width: 97px; height: 163px;
    background-position: -156px -374px;
    top: 359px; left: 239px;
}
.zoo-cat-sprite--pt-ara {
    width: 349px; height: 248px;
    background-position: -306px -408px;
    top: 402px; left: 306px;
}
.zoo-cat-sprite--pt-canary {
    width: 244px; height: 188px;
    background-position: -509px -128px;
    top: 135px; left: 639px;
}
.zoo-cat-sprite--pt-lovebird {
    width: 169px; height: 151px;
    background-position: -814px -218px;
    top: 211px; left: 819px;
}
.zoo-cat-sprite--pt-cockatiel {
    width: 99px; height: 151px;
    background-position: -1027px -533px;
    top: 530px; left: 1024px;
}

/* --- Табы ПТИЦЫ / ГРЫЗУНЫ (на доске справа) --- */
.zoo-cat-tab {
    position: absolute;
    display: block;
    background-image: url('/assets/img/zoo/tabs.png');
    background-repeat: no-repeat;
    cursor: pointer;
    z-index: 5;
    transition: filter 0.2s;
}
.zoo-cat-tab:hover { background-image: url('/assets/img/zoo/tabs_active.png'); }
.zoo-cat-tab--active { background-image: url('/assets/img/zoo/tabs_active.png') !important; cursor: default; }

/* Грызуны: ПТИЦЫ слева, ГРЫЗУНЫ справа */
.zoo-cat-tab--left {
    width: 116px; height: 53px;
    background-position: -73px -73px;
    top: 354px; left: 785px;
}
.zoo-cat-tab--right {
    width: 117px; height: 46px;
    background-position: -199px -70px;
    top: 354px; left: 917px;
}
/* Птицы: те же позиции, чуть сдвинуты */
.zoo-cat-tab--left-pt {
    width: 116px; height: 53px;
    background-position: -73px -73px;
    top: 354px; left: 789px;
}
.zoo-cat-tab--right-pt {
    width: 117px; height: 46px;
    background-position: -199px -70px;
    top: 354px; left: 917px;
}

/* --- Текстовое меню видов (на доске) --- */
.zoo-cat-link {
    position: absolute;
    left: 930px;
    width: 92px;
    height: 24px;
    font-size: 17px;
    font-weight: 700;
    color: #4e1800;
    text-align: center;
    text-decoration: none;
    z-index: 6;
    transition: color 0.2s;
}
.zoo-cat-link:hover { color: var(--accent); font-size: 18px; }

/* Птицы — меню слева на доске */
.zoo-cat-link--pt {
    left: 789px;
    width: 122px;
}

/* Мобильный fallback */
.zoo-mobile-cards {
    display: none;
    gap: 16px;
    margin-bottom: 32px;
}
.zoo-mobile-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    transition: all var(--transition);
}
.zoo-mobile-card svg { color: var(--accent); }
.zoo-mobile-card:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* === LAZY LOADING PLACEHOLDER === */
img[loading="lazy"] { background: #f0ede8; }

@media (max-width: 768px) {
    .home-about { grid-template-columns: 1fr; }
    .home-about__contacts { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .home-about__links { justify-content: flex-start; }
    .home-about__phone { font-size: 0.9rem; }
    .slider__caption-title { font-size: 1.1rem; }
    /* Зоо: на мобиле скрываем карты, показываем карточки */
    .zoo-map-wrap { display: none; }
    .zoo-mobile-cards { display: flex; }
    .zoo-cat-wrap { display: none; }
    .slider__caption { padding: 24px 16px 16px; }
    .slider__arrow { width: 36px; height: 36px; font-size: 1rem; }
    .back-to-top { bottom: 16px; right: 12px; width: 40px; height: 40px; }
    .reveal { transform: translateY(20px); transition-duration: 0.5s; }
    .section-title.reveal { transform: translateY(15px); }
    .header--scrolled .header__inner { height: 48px; }
    .search-page__form { flex-direction: column; }
}

/* === ALTERNATING SECTION BACKGROUND === */
.section--alt {
    background: var(--bg-alt);
    padding: 36px 0 40px;
}

/* === SCROLL REVEAL === */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0, 0.15, 1),
                transform 0.6s cubic-bezier(0.25, 0, 0.15, 1);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
.card.reveal {
    transition-delay: calc(var(--reveal-delay, 0) * 0.08s);
}
.section-title.reveal {
    transform: translateX(-20px);
    opacity: 0;
}
.section-title.reveal.revealed {
    transform: translateX(0);
    opacity: 1;
}
.home-about.reveal {
    transform: translateY(40px) scale(0.98);
}
.home-about.reveal.revealed {
    transform: translateY(0) scale(1);
}
.slider.reveal {
    transform: translateY(20px) scale(0.99);
    opacity: 0;
}
.slider.reveal.revealed {
    transform: translateY(0) scale(1);
    opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* === ADMIN === */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 20px; }
.admin-header { background: var(--primary); color: #fff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }
.admin-header a { color: var(--accent-light); }
.admin-nav { background: var(--primary-dark); padding: 0; border-bottom: 2px solid var(--accent); }
.admin-nav a { display: inline-block; color: rgba(255,255,255,0.75); padding: 10px 20px; font-size: 0.9rem; transition: all var(--transition); }
.admin-nav a:hover { background: rgba(255,255,255,0.08); color: var(--accent-light); }

.table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--shadow); border-radius: var(--radius-sm); overflow: hidden; }
.table th { background: var(--primary); color: #fff; padding: 10px 15px; text-align: left; font-weight: 500; font-size: 0.9rem; }
.table td { padding: 10px 15px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.table tr:hover td { background: #faf8f5; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 1rem; font-family: var(--font);
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212,147,13,0.12);
}
.form-group textarea { min-height: 200px; resize: vertical; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; }
.alert--success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.alert--error { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }

.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: var(--primary); }
.login-box { background: #fff; padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; border-top: 4px solid var(--accent); }
.login-box h1 { text-align: center; margin-bottom: 28px; color: var(--primary); font-size: 1.8rem; }
