/* Центрирование блока 'Избранное пусто' */
.no-products {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    width: 100%;
    text-align: center;
}

/* ========================= */
/* Breadcrumbs styles */
/* ========================= */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 12px 18px;
    font-size: 14px;
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.05) 0%, rgba(255, 102, 0, 0.02) 100%);
    border-radius: 8px;
    border-left: 3px solid #ff6600;
}

.breadcrumb-item {
    color: #ff6600;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.breadcrumb-item:hover {
    color: #e65c00;
    transform: translateY(-1px);
}

.breadcrumb-item.active {
    color: #666;
    font-weight: 600;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: #ccc;
    font-weight: 300;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .breadcrumbs {
        background: linear-gradient(135deg, rgba(255, 102, 0, 0.1) 0%, rgba(255, 102, 0, 0.05) 100%);
        border-left-color: #ff6600;
    }
    
    .breadcrumb-item.active {
        color: #aaa;
    }
    
    .breadcrumb-separator {
        color: #666;
    }
}

/* ========================= */
/* Стили для вкладок профиля */
/* ========================= */
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}
/* =================================== */
/* ИСПРАВЛЕННЫЙ CSS БЕЗ КОНФЛИКТОВ */
/* =================================== */

/* Основные стили и переменные */
:root {
    --header-height: 70px;
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --background-dark: #18181b;
    --text-light: #ffffff;
    --text-gray: #9ca3af;
    --primary-red: #dc2626;
    --money-green: #16a34a;
    --gold: #fbbf24;
    --dark: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-top: var(--header-height);
    min-height: 100vh;
}
.categories-search-form { display: none !important; }

/* Homepage product search suggestions dropdown */
.homepage-product-search { margin: 18px 0 20px; }
.homepage-search-form { display: flex; gap: 10px; align-items: center; }
.homepage-search-form .filter-search-wrapper { flex: 1; max-width: 820px; }
.homepage-search-form .filter-search-field { width: 100%; box-sizing: border-box; }
.filter-search-wrapper { position: relative; }

/* Homepage-specific search input styling (distinct from products page) */
.homepage-search-form .filter-search-field,
.homepage-search-input {
    width: 100%;
    padding: 14px 16px 14px 52px; /* room for left icon */
    border-radius: 28px; /* pill shape */
    border: 1px solid rgba(14,20,29,0.06);
    background: linear-gradient(180deg,#ffffff,#fbfdff);
    font-size: 15px;
    color: #0b1220;
    transition: box-shadow 180ms ease, border-color 180ms ease, transform 140ms ease;
    height: 48px;
}
.homepage-search-form .filter-search-field:focus,
.homepage-search-input:focus {
    outline: none;
    border-color: rgba(220,38,38,0.95);
    box-shadow: 0 12px 36px rgba(220,38,38,0.12);
    transform: translateY(-1px);
}
.homepage-search-form .filter-search-field::placeholder,
.homepage-search-input::placeholder { color: #9aa1ab; }

/* left icon inside input - distinct circular background */
.homepage-search-form .filter-search-icon,
.homepage-search-form .filter-search-wrapper .filter-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}
.homepage-search-form .filter-search-icon i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(250,250,250,1);
    color: var(--primary-color);
    font-size: 14px;
    box-shadow: 0 6px 14px rgba(2,6,23,0.04);
}

/* Submit button: gradient matching site primary */
.homepage-search-btn {
    margin-left: 0;
    padding: 12px 16px;
    border-radius: 28px;
    background: linear-gradient(90deg, #ff5a52 0%, #d81b2a 100%);
    color: #fff;
    border: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 18px 40px rgba(216,27,42,0.12);
    cursor: pointer;
}
.homepage-search-btn i { color: #fff; font-size: 16px; }

/* Suggestions dropdown tuned to site look */
.homepage-search-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eef2f6;
    box-shadow: 0 18px 40px rgba(2,6,23,0.08);
    z-index: 1500;
}
.homepage-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #111827;
}
.homepage-suggestion-item:hover { background: #fbfbfd; }

.homepage-suggestion-list { display:flex; flex-direction:column; }
.homepage-suggestion-item { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; }
.homepage-suggestion-item.active { background: #f3f6f8; }
.homepage-suggestion-item .hs-left {
    display:flex;
    align-items:center;
    gap:8px;
    flex: 1 1 auto; /* allow left side to take available space */
    min-width: 0; /* allow shortening for text-overflow to work inside flex */
}
.homepage-suggestion-item .hs-text { max-width: 100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.homepage-suggestion-item .hs-right { flex: 0 0 auto; }
.hs-remove-btn { background:transparent; border:none; color:#9ca3af; font-size:16px; padding:4px 8px; cursor:pointer; }
.hs-remove-btn:hover { color:#e11d48; }
.homepage-suggestions-footer { padding:8px; border-top:1px solid #f3f6f8; text-align:right; }
.hs-clear-all { background:transparent; border:none; color:#6b7280; cursor:pointer; font-size:13px; }
.hs-clear-all:hover { color:#111827; }

@media (max-width: 480px) {
    .homepage-search-form { gap: 8px; }
    .homepage-search-btn { padding: 8px 10px; }
    .filter-search-field { padding: 10px 12px 10px 40px; }
}

/* inline circular button inside the search wrapper */
.homepage-search-inline-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: linear-gradient(90deg, #ff5a52 0%, #d81b2a 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 10px 28px rgba(216,27,42,0.12);
    cursor: pointer;
}
.homepage-search-inline-btn i { font-size: 14px; }

/* ensure input has right padding for the inline button */
.homepage-search-form .filter-search-field { padding-right: 56px; }
.homepage-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}
.homepage-suggestion-item:hover { background: #f8fafc; }

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
}

/* =================================== */
/* ЕДИНЫЙ HEADER (убираем дубли) */
/* =================================== */

/* Убираем все дублирующие классы navbar */
.navbar {
    display: none !important; /* Полностью отключаем старую navbar */
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    overflow: visible;
}

.header-container {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    overflow: visible;
}

/* Логотип */
.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-light);
}

.header-logo i {
    font-size: 1.75rem;
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.4));
    transition: transform 0.3s ease;
}

.header-logo:hover i {
    transform: scale(1.1) rotate(-5deg);
}

.header-logo span {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-light), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Навигация */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-light);
}

.nav-link:hover::after {
    width: 100%;
}





/* Мобильное меню */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* =================================== */
/* МОБИЛЬНАЯ АДАПТИВНОСТЬ */
/* =================================== */

/* Скрываем простой мобильный nav по умолчанию (чтобы не показывался на десктопе) */
#mobileNavSimple { display: none; }

@media (max-width: 768px) {
    /* Убираем конфликтующие стили */

    .menu-toggle {
        display: block !important;
    }

    /* Простое мобильное меню (использует jQuery slideToggle) */
    #mobileNavSimple {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid #e6e6e6;
        box-shadow: 0 6px 24px rgba(0,0,0,0.08);
        z-index: 999;
    }

    #mobileNavSimple .mobile-nav-links {
        display: flex;
        flex-direction: column;
    }

    #mobileNavSimple .mobile-nav-link {
        padding: 14px 16px;
        color: #1f2937;
        text-decoration: none;
        display: flex;
        gap: 10px;
        align-items: center;
        border-top: 1px solid #f3f4f6;
    }
    /* Emphasized CTA inside mobile menu */
    #mobileNavSimple .mobile-post-cta{
        font-weight: 800;
        color:#047857;
        background: linear-gradient(180deg, rgba(16,185,129,0.08), rgba(16,185,129,0.12));
        border-radius: 12px;
        margin: 8px 12px;
        border:1px solid rgba(16,185,129,0.25);
    }
    #mobileNavSimple .mobile-post-cta i{ color:#047857; }
    #mobileNavSimple .mobile-post-cta:hover{ background: linear-gradient(180deg, rgba(16,185,129,0.14), rgba(16,185,129,0.18)); }

    body.no-scroll {
        overflow: hidden;
    }
    .header {
        position: fixed !important; /* Принудительно фиксированный */
        height: var(--header-height) !important; /* Принудительная высота */
        overflow: visible !important;
    }
    
    .header-container {
        padding: 0 1rem !important;
        height: var(--header-height) !important;
    }
    
    /* Убираем все старые стили мобильного меню */
    .desktop-only {
        display: none !important;
    }
    
    /* ensure hamburger stays visible on mobile (remove any accidental hiding) */
    .menu-toggle {
        display: block !important;
    }
    
    /* Убираем лишние отступы body на мобильных */
    body {
        padding-top: var(--header-height) !important;
        margin-top: 0 !important;
    }
    
    /* Скрываем имя пользователя на маленьких экранах */
    .user-name {
        display: none !important;
    }
    
    .user-btn {
        padding: 0.5rem !important;
        min-width: auto !important;
    }
}

@media (max-width: 480px) {
    .header-logo span {
        display: none;
    }
    
    .user-btn {
        padding: 0.5rem;
    }
}

/* Force-hide the simple mobile nav on desktop to avoid accidental visibility */
@media (min-width: 769px) {
    #mobileNavSimple {
        display: none !important;
    }
}

/* =================================== */
/* ОСТАЛЬНЫЕ СТИЛИ (без изменений) */
/* =================================== */

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

/* Главная секция */
.hero {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 120px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="10" y="20" fill="rgba(22,163,74,0.1)" font-size="16">$</text><text x="70" y="50" fill="rgba(22,163,74,0.1)" font-size="12">₴</text><text x="30" y="80" fill="rgba(251,191,36,0.1)" font-size="14">💰</text></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: #f0f8ff; /* Светло-голубой цвет */
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s both;
}

/* Кнопки */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-red), #b91c1c);
    color: white;
}

/* Views counter chip used on product page */
.sp-views .sp-chip {
    background: linear-gradient(90deg, #fff, #f8fafc);
    border-color: #e6e6e6;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid var(--money-green);
}

.btn-danger {
    background: linear-gradient(45deg, var(--primary-red), #b91c1c);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.4);
}

.btn-secondary:hover {
    background: var(--money-green);
    color: #000;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.4);
}

/* Новые стили для кнопок на главной странице */
.btn-hero-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-size: 1.1rem;
    padding: 15px 35px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.btn-hero-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.btn-hero-primary:hover::before {
    left: 100%;
}

.btn-hero-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #5b52f7, #8b5cf6);
}

.btn-hero-secondary {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    font-size: 1.1rem;
    padding: 15px 35px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.btn-hero-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.btn-hero-secondary:hover::before {
    left: 100%;
}

.btn-hero-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.4);
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.btn-view-all {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 1.2rem;
    padding: 18px 40px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-view-all::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.btn-view-all:hover::before {
    left: 100%;
}

.btn-view-all:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #047857);
}

.view-all-wrapper {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
}

/* Адаптивность для новых кнопок */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        font-size: 1rem;
        padding: 12px 28px;
        width: 250px;
        max-width: 90%;
    }
    
    .btn-view-all {
        font-size: 1.1rem;
        padding: 15px 35px;
        width: 200px;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        font-size: 0.95rem;
        padding: 10px 25px;
        width: 220px;
    }
    
    .btn-view-all {
        font-size: 1rem;
        padding: 12px 30px;
        width: 180px;
        letter-spacing: 0.5px;
    }
}



.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input, .category-select, .condition-select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.category-select, .condition-select {
    min-width: 150px;
}

.search-input:focus, 
.category-select:focus, 
.condition-select:focus {
    outline: none;
    border-color: var(--primary-red);
}


.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.2rem;
    }
}
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.8rem;
    }
}
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.6rem;
    }
}

/* Остальные стили остаются без изменений... */

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--money-green);
}

.notification-info {
    border-left: 4px solid #3498db;
}

.notification i {
    color: var(--money-green);
    font-size: 1.2rem;
}
* {
  -webkit-tap-highlight-color: transparent;
}
/* ВАЖНО: Убираем ВСЕ дублирующие стили для мобильного меню */
/* Все что начинается с .mobile-menu, .hamburger и т.д. - УДАЛЕНО */

/* Pagination summary (shows "Показано с X по Y...") */
.pagination-summary {
    margin: 16px auto 24px; /* vertical spacing, centered horizontally */
    color: #1f2937; /* dark-gray matching site's text */
    font-size: 16px;
    text-align: center; /* center text under the pagination */
    width: 100%;
    max-width: 1200px; /* keep summary within main content width */
    box-sizing: border-box;
}

/* Ensure pagination wrapper keeps its centered box */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 8px; /* reduce gap between pagination and summary */
}

/* Load-more UI removed: server-side pagination is used instead */

.promo-section {
    padding: 40px 0;
}

.promo-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: 10px; /* Уменьшили отступ для кнопки */
}

.promo-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.promo-viewport {
    position: relative;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 350px;
    width: 100%;
}

.promo-viewport.expanded {
    max-height: 2500px; /* Большое значение для плавной анимации */
    transition: max-height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.promo-full {
    padding: 40px 40px 80px 40px; /* Добавили отступ снизу для кнопки */
    line-height: 1.7;
    color: #333;
    width: 100%;
}

.promo-full h2 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
    position: relative;
    padding-left: 20px;
}

.promo-full h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 2px;
}

.promo-full h2:first-child {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 25px;
}

.promo-full h2:first-child::before {
    height: 40px;
    width: 5px;
}

.promo-full p {
    margin-bottom: 20px;
    font-size: 16px;
    text-align: justify;
    color: #555;
}

.promo-full p strong {
    color: #667eea;
    font-weight: 600;
}

.promo-full ul {
    margin: 20px 0;
    padding-left: 30px;
}

.promo-full ul li {
    margin-bottom: 8px;
    color: #666;
    position: relative;
}

.promo-full ul li::marker {
    color: #667eea;
}

.promo-full ol {
    margin: 20px 0;
    padding-left: 30px;
    counter-reset: item;
}

.promo-full ol li {
    margin-bottom: 12px;
    color: #666;
    position: relative;
    padding-left: 10px;
}

.promo-full ol li::marker {
    color: #667eea;
    font-weight: 600;
}

.promo-full details {
    margin: 15px 0;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border-left: 3px solid #667eea;
}

.promo-full details summary {
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    padding: 5px 0;
    list-style: none;
    position: relative;
    padding-left: 25px;
}

.promo-full details summary::before {
    content: '▶';
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.promo-full details[open] summary::before {
    transform: rotate(90deg);
}

.promo-full details summary::-webkit-details-marker {
    display: none;
}

.promo-full details p {
    margin-top: 10px;
    padding-left: 25px;
}

.promo-full hr {
    margin: 30px 0;
    border: none;
    border-top: 2px solid rgba(102, 126, 234, 0.2);
}

.promo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.95));
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.promo-overlay.hidden {
    opacity: 0;
}

.expand-btn {
    position: absolute;
    bottom: 15px; /* Уменьшили отступ снизу */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.expand-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.expand-btn:active {
    transform: translateX(-50%) translateY(0);
}

.expand-btn .icon {
    margin-left: 10px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.expand-btn.expanded .icon {
    transform: rotate(180deg);
}

.expand-btn .text {
    transition: opacity 0.2s ease;
}

@media (max-width: 768px) {
    .promo-card {
        padding-bottom: 15px; /* Уменьшили отступ для кнопки на мобильных */
    }
    
    .promo-full {
        padding: 30px 25px 70px 25px; /* Добавили отступ снизу для кнопки на мобильных */
    }

    .promo-full h2 {
        font-size: 24px;
        padding-left: 15px;
    }

    .promo-full h2:first-child {
        font-size: 28px;
    }

    .promo-viewport {
        max-height: 300px; /* Уменьшили для мобильных */
    }
    
    .promo-viewport.expanded {
        max-height: 3500px; /* Увеличили для мобильных */
        transition: max-height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .expand-btn {
        padding: 12px 25px;
        font-size: 14px;
        bottom: 15px; /* Единый отступ снизу для всех экранов */
    }
}

/* Анимация появления контента */
.promo-full > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.promo-full > *:nth-child(1) { animation-delay: 0.1s; }
.promo-full > *:nth-child(2) { animation-delay: 0.2s; }
.promo-full > *:nth-child(3) { animation-delay: 0.3s; }
.promo-full > *:nth-child(4) { animation-delay: 0.4s; }
.promo-full > *:nth-child(5) { animation-delay: 0.5s; }
.promo-full > *:nth-child(6) { animation-delay: 0.6s; }
.promo-full > *:nth-child(7) { animation-delay: 0.7s; }
.promo-full > *:nth-child(8) { animation-delay: 0.8s; }
.promo-full > *:nth-child(9) { animation-delay: 0.9s; }
.promo-full > *:nth-child(10) { animation-delay: 1.0s; }
.promo-full > *:nth-child(11) { animation-delay: 1.1s; }
.promo-full > *:nth-child(12) { animation-delay: 1.2s; }
.promo-full > *:nth-child(13) { animation-delay: 1.3s; }
.promo-full > *:nth-child(14) { animation-delay: 1.4s; }
.promo-full > *:nth-child(15) { animation-delay: 1.5s; }
.promo-full > *:nth-child(16) { animation-delay: 1.6s; }
.promo-full > *:nth-child(17) { animation-delay: 1.7s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Categories tile grid: 10 columns on desktop, responsive fewer on smaller screens */
.categories-grid-wrapper { margin: 18px 0 6px; }
.categories-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    /* default: let tiles fill their grid cell so layout spans full width */
    align-items: stretch;
    justify-items: stretch;
}

/* When user filters results, avoid stretching remaining tiles to fill wide grid cells */
.categories-grid.is-filtered {
    align-items: start;
    justify-items: start;
}

/* When filtered, keep tiles visually uniform despite varying label lengths */
.categories-grid.is-filtered .cat-tile {
    /* fixed tile box so remaining items form a tidy row */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px; /* tweak this value if you want taller/shorter tiles */
    min-width: 100px;
    box-sizing: border-box;
}
.categories-grid.is-filtered .cat-tile-btn {
    /* let the button content flow naturally inside the fixed tile */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
}
.categories-grid.is-filtered .cat-tile-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 13px;
}
.cat-tile {
    position: relative;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 6px 18px rgba(16,24,40,0.04);
    overflow: hidden;
    text-align: center;
}
.cat-tile-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    gap: 8px;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    position: relative; /* ensure z-index works for underline */
    z-index: 2;
}
.cat-tile-icon { font-size: 28px; line-height:1; }
.cat-tile img, .cat-tile-icon img { border-radius: 0 !important; }
.cat-tile-name { display: block; font-size: 12px; color: #111827; }
.cat-tile-link { position: absolute; inset: 0; text-indent: -9999px; overflow: hidden; z-index: 1; }

/* Modal */
.cat-modal { display: none; position: fixed; inset: 0; z-index: 1200; }
.cat-modal[aria-hidden="false"] { display: block; }
.cat-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.cat-modal-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 520px; max-width: calc(100% - 32px); background: #fff; border-radius: 10px; box-shadow: 0 20px 60px rgba(2,6,23,0.2); overflow: hidden; }
.cat-modal-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid #f3f4f6; }
.cat-modal-header h3 { margin:0; font-size:16px; }
.cat-modal-close { background:none; border:none; font-size:22px; padding:6px 8px; cursor:pointer; }
.cat-modal-body { padding:12px 16px; max-height:60vh; overflow:auto; }
.cat-modal-list { display:flex; flex-direction:column; gap:8px; }
.cat-modal-link { padding:8px 10px; border-radius:6px; text-decoration:none; color:#111827; background:#f8fafc; display:block; }
.cat-modal-link:hover,
.cat-modal-link:focus {
    text-decoration: underline;
    text-decoration-color: #000;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    outline: none;
}
.cat-modal-footer { padding:12px 16px; border-top:1px solid #f3f4f6; text-align:right; }

/* responsive breakpoints */
@media (max-width: 1200px) { .categories-grid { grid-template-columns: repeat(8, 1fr); } }
@media (max-width: 992px)  { .categories-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 768px)  { .categories-grid { grid-template-columns: repeat(4, 1fr); } .cat-tile-name{ font-size:13px; } }
@media (max-width: 480px)  {
    /* Horizontal paged grid: each column is 2 tiles (rows), column width = 50% so viewport shows 2x2 block */
    .categories-grid {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: calc(50% - 8px); /* each column takes half viewport minus gap */
        grid-template-rows: repeat(2, auto); /* two rows per column */
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* native momentum scrolling */
    padding: 6px;
    scroll-snap-type: none; /* disable snap so small drags don't snap back */
    scroll-behavior: smooth;
    touch-action: auto; /* allow vertical page scrolling when user drags on categories */
        align-items: start;
    }
    .cat-tile {
        width: 100%;
        min-width: auto;
        scroll-snap-align: start;
    }
    .cat-modal-panel{ width:95%; }
}

/* Small tablets / large phones: show categories as horizontal paged 2x2 blocks (two rows per column) */
@media (min-width: 481px) and (max-width: 600px) {
    .categories-grid {
        display: grid;
        grid-auto-flow: column;
        /* each column shows two tiles (rows); column width ~50% of viewport minus gap */
        grid-auto-columns: calc(50% - 10px);
        grid-template-rows: repeat(2, auto);
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 6px;
        scroll-snap-type: none;
        scroll-behavior: smooth;
        touch-action: auto; /* allow vertical page scroll while swiping */
        align-items: start;
    }
    .categories-grid .cat-tile {
        width: 100%;
        min-width: auto;
        scroll-snap-align: start;
    }
    .categories-grid::-webkit-scrollbar { height: 8px; }
    .categories-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
    .categories-grid { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.12) transparent; }
}

/* Force visible horizontal scrollbar for categories on mobile to improve UX */
@media (max-width: 480px) {
    .categories-grid {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
    /* Chrome/Safari */
    .categories-grid::-webkit-scrollbar { height: 8px; }
    .categories-grid::-webkit-scrollbar-track { background: transparent; }
    .categories-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
    /* Firefox */
    .categories-grid { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.15) transparent; }
}

/* small accessibility niceties */
.cat-tile-btn:focus { outline: 3px solid rgba(99,102,241,0.12); }
.cat-modal-link:focus { outline: 3px solid rgba(99,102,241,0.12); }
/* Hidden child links for SEO — present in DOM but invisible to users */
.cat-children-hidden {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Hero section styles for main page H1 */
.hero-section {
    padding: 40px 0 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    text-align: center;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .hero-section {
        padding: 30px 0 15px;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 25px 0 10px;
    }
    
    .hero-title {
        font-size: 1.4rem;
        line-height: 1.3;
    }
}