/* ==================== ПЕРЕМЕННЫЕ (меняй цвета здесь) ==================== */
:root {
    --dark: #0f172a;
    --white: #ffffff;
    --accent: #0091FF;
    --accent-hover: #0077dd;
    --yellow: #FFB700;
    --porevit: #dc2626;
    --porablok: #2563eb;
    --insi: #d1d5db;
    --gray-bg: #f8fafc;
    --gray-text: #6b7280;
    --font: 'Montserrat', sans-serif;
}

/* ==================== БУРГЕР ==================== */
.burger { display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 5px; }
.burger span { display: block; width: 26px; height: 3px; background: #1a1a1a; border-radius: 2px; transition: 0.3s; }
body.dark-theme .burger span { background: #e2e8f0; }
.burger-wrapper { position: relative; }

/* ==================== МОБИЛЬНОЕ МЕНЮ (выпадающее) ==================== */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0%;
    right: auto;
    z-index: 99;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.8rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    min-width: 200px;
    animation: slideDown 0.5s ease;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    font-weight: 600; font-size: 0.9rem;
    padding: 10px 14px; color: #1a1a1a;
    border-radius: 6px; transition: 0.15s;
}
.mobile-menu a:hover { background: #f3f4f6; color: var(--accent); }
body.dark-theme .mobile-menu { background: #1e293b; border-color: #334155; }
body.dark-theme .mobile-menu a { color: #e2e8f0; }
body.dark-theme .mobile-menu a:hover { background: #334155; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .burger { display: flex; }
    .header__phone { font-size: 0.85rem; }
    .header__messengers { display: none; }
}

@media (max-width: 768px) {
    .logo__icon {
        width: 32px;
        height: 32px;
    }
}


/* ==================== HERO СЛАЙДЕР ==================== */
.hero {
    position: relative;
    overflow: hidden;
    background: #0f172a; /* fallback */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero__slider {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

.hero__slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    object-fit: cover;
    display: none;
}
.hero__slide.active {
    opacity: 1;
    display: block;
}
.hero__slide img, .hero__slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Затемнение поверх слайдера, но под контентом */
.hero__overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

/* Прогресс-бары */
.hero__progress {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3; /* над оверлеем, под контентом */
    width: 90%;
    max-width: 600px;
}
.hero__progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}
.hero__progress-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 2px;
    transition: width 0.1s linear; /* будет переопределяться в JS */
}

/* Стрелки */
.hero__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(0,0,0,0.4);
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    display: none; /* скрыты по умолчанию, показываются при наведении на hero */
}
.hero:hover .hero__arrow {
    display: block;
}
.hero__arrow--prev { left: 15px; }
.hero__arrow--next { right: 15px; }
.hero__arrow:hover { background: rgba(0,0,0,0.7); }

/* Контент всегда поверх */
.hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 0 50px;
}

/* На мобильных стрелки всегда видны */
@media (max-width: 768px) {
    .hero__arrow {
        display: block;
        font-size: 1.5rem;
        padding: 6px 10px;
    }
}


/* ==================== ТЁМНАЯ ТЕМА ==================== */
body.dark-theme {
    --dark: #0f172a;
    --white: #1e293b;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --yellow: #f59e0b;
    --gray-bg: #1e293b;
    --gray-text: #94a3b8;
    background: #0f172a;
    color: #e2e8f0;
}

body.dark-theme .header { background: #1e293b; box-shadow: 0 2px 15px rgba(0,0,0,0.3); }
body.dark-theme .header__phone { color: #e2e8f0; }
body.dark-theme .logo { color: #e2e8f0; }
body.dark-theme .top-bar { background: #020617; }
body.dark-theme .categories { background: #1e293b; }
body.dark-theme .category-card { background: #0f172a; border-color: #334155; }
body.dark-theme .category-card__title { color: #e2e8f0; }
body.dark-theme .catalog { background: #0f172a; }
body.dark-theme .product-card { background: #1e293b; border-color: #334155; }
body.dark-theme .product-card__title { color: #e2e8f0; }
body.dark-theme .product-card__location { color: #94a3b8; }
body.dark-theme .product-card__spec { background: #0f172a; }
body.dark-theme .product-card__price { color: #e2e8f0; }
body.dark-theme .product-card--porevit { border-top-color: #ef4444; }
body.dark-theme .product-card--porablok { border-top-color: #60a5fa; }
body.dark-theme .product-card--insi { border-top-color: #d1d5db; }
body.dark-theme .calculator { background: #1e293b; }
body.dark-theme .calculator__box { background: #0f172a; border-color: #334155; }
body.dark-theme .calculator__field label { color: #e2e8f0; }
body.dark-theme .calculator__field input,
body.dark-theme .calculator__field select { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-theme .calculator__result.show { background: #1e293b !important; color: #e2e8f0; border: 1px solid #334155; }
body.dark-theme .calculator__field input[type="number"]::-webkit-inner-spin-button,
body.dark-theme .calculator__field input[type="number"]::-webkit-outer-spin-button {filter: invert(1);}
body.dark-theme .form-section { background: #0f172a; }
body.dark-theme .form input,
body.dark-theme .form textarea { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-theme .reviews { background: #1e293b; }
body.dark-theme .review-card { background: #0f172a; border-color: #334155; }
body.dark-theme .review-card__text { color: #94a3b8; }
body.dark-theme .review-card__author { color: #e2e8f0; }
body.dark-theme .reviews__avito { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-theme .footer { background: #020617; }
body.dark-theme .about { background: #0f172a; }
body.dark-theme .about__text { color: #e2e8f0; }
body.dark-theme .about__text p { color: #94a3b8; }
body.dark-theme .about__stat { background: #1e293b; border-color: #334155; }
body.dark-theme .about__contacts { background: #1e293b; border-color: #334155; }
body.dark-theme .about__contacts p { color: #94a3b8; }
body.dark-theme .about__phones a { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-theme .section-title { color: #e2e8f0; }
body.dark-theme .section-subtitle { color: #94a3b8; }
body.dark-theme .catalog__cat-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark-theme .catalog__cat-btn.active { background: #60a5fa; color: #fff; }
.catalog__cat-btn img {
    width: 36px;
    height: 36px;
    vertical-align: middle;
    margin-right: 10px;
}
body.dark-theme .catalog__cat-btn--sub {
    background: #1e293b;
    border-color: #334155;
}
body.dark-theme .filter-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark-theme .filter-btn.active { background: #60a5fa; color: #fff; }
body.dark-theme .theme-toggle { border-color: #334155; color: #e2e8f0; }
body.dark-theme .theme-toggle:hover { background: #334155; }
body.dark-theme .nav a { color: #94a3b8; }
body.dark-theme .nav a:hover { color: #fff; }
body.dark-theme section[style] { background: #0f172a !important; }
body.dark-theme section[style] h1,
body.dark-theme section[style] h2,
body.dark-theme section[style] h3,
body.dark-theme section[style] strong { color: #e2e8f0 !important; }
body.dark-theme section[style] p,
body.dark-theme section[style] li { color: #94a3b8 !important; }
body.dark-theme div[style*="background:#f8fafc"],
body.dark-theme div[style*="background: #f8fafc"] { background: #1e293b !important; border-color: #334155 !important; }
body.dark-theme div[style*="background:#eff6ff"],
body.dark-theme div[style*="background: #eff6ff"] { background: #1e3a5f !important; }
body.dark-theme div[style*="background:linear-gradient"] { background: #1e293b !important; border-color: #334155 !important; }
body.dark-theme div[style*="border-left:4px"] { border-left-color: var(--accent) !important; }
body.dark-theme .certificates { background: #1e293b; }
body.dark-theme .cert-card { background: #0f172a; border-color: #334155; }
body.dark-theme .cert-card p { color: #94a3b8; }
body.dark-theme .about__map iframe { filter: grayscale(0.3); }
body.dark-theme .review-card__avatar { background: #334155; }

/* ==================== СТРАНИЦА ТОВАРА ==================== */
.product-page { background: #fff; padding: 60px 0; }
.product-page__container { max-width: 900px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2rem; }

/* Основное изображение */

.product-page__gallery {
    flex: 1 1 300px;
    max-width: 400px;
}

.product-page__info {
    flex: 1 1 300px;
    min-width: 250px;
}

.product-page__price-m3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-text);
    margin-top: 4px;
}

.product-page__pallet-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}


.product-page__main-image {
    flex: 1;
    min-width: 300px;
    background: #f9fafb;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    /* фиксируем высоту */
    height: 400px;          
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-page__main-image img {
    width: 100%;
    height: 100%;
    object-fit: none;    
}

/* Переключалка размеров */
.product-page__size-switcher {
    position: relative;
    margin-bottom: 1.5rem;
}
.size-switcher__list {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 4px 0 0;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 200px;
}
.size-switcher__list li {
    padding: 0;
}
.size-switcher__list li a {
    display: block;
    padding: 8px 16px;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
}
.size-switcher__list li a:hover,
.size-switcher__list li.active a {
    background: var(--accent);
    color: #fff;
}
body.dark-theme .size-switcher__list {
    background: #1e293b;
    border-color: #334155;
}
body.dark-theme .size-switcher__list li a {
    color: #e2e8f0;
}


/* Стрелки слайдера */
.product-page__arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.4); color: #fff; border: none;
    font-size: 1.5rem; padding: 8px 12px; cursor: pointer;
    z-index: 2; transition: background 0.2s;
}
.product-page__arrow:hover { background: rgba(0,0,0,0.7); }
.product-page__arrow--prev { left: 10px; }
.product-page__arrow--next { right: 10px; }

/* Миниатюры */
.product-page__thumbnails {
    display: flex; gap: 10px; margin-top: 15px;
    flex-wrap: wrap; justify-content: center;
}
.product-page__thumb {
    width: 70px; height: 70px; border-radius: 8px;
    overflow: hidden; cursor: pointer; border: 2px solid transparent;
    transition: border-color 0.2s;
}
.product-page__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-page__thumb.active { border-color: var(--accent); }

/* Информация о товаре */
.product-page__info { flex: 1; min-width: 300px; }
.product-page__info h1 { font-size: 2rem; font-weight: 900; margin-bottom: 0.5rem; color: #1a1a1a; }
.product-page__info .location { color: var(--gray-text); margin-bottom: 1.5rem; }
.product-page__specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 2rem; }
.product-page__spec {
    background: var(--gray-bg);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.product-page__spec-label {
    font-size: 0.75rem;
    color: var(--gray-text);
    text-transform: uppercase;
    min-width: auto;
    flex-shrink: 1;
}

.product-page__spec-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: normal;
    text-align: left;
}
.product-page__price { font-size: 2rem; font-weight: 900; color: var(--accent); margin-bottom: 1.5rem; }
.product-page__btn { display: inline-block; }



/* Тёмная тема */
body.dark-theme .product-page { background: #0f172a; }
body.dark-theme .product-page__main-image { background: #1e293b; }
body.dark-theme .product-page__info h1 { color: #e2e8f0; }
body.dark-theme .product-page__spec { background: #1e293b; border: 1px solid #334155; }
body.dark-theme .product-page__spec-value { color: #e2e8f0; }
body.dark-theme .product-page__thumb { border-color: #334155; }
body.dark-theme .product-page__thumb.active { border-color: var(--accent); }

@media (max-width: 768px) {
    .product-page__container { flex-direction: column; }
}

/* ==================== КНОПКА ТЕМЫ ==================== */
.theme-toggle {
    background: none;
    border: 1px solid #e5e7eb;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    font-family: var(--font);
    transition: 0.2s;
    line-height: 1;
}
.theme-toggle:hover { background: #f3f4f6; }

/* ==================== RESET ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: #1a1a1a; background: #f5f5f5; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
a { color: inherit; text-decoration: none; }
.section-title { text-align: center; font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 800; margin-bottom: 0.5rem; color: #1a1a1a; }
.section-subtitle { text-align: center; color: var(--gray-text); margin-bottom: 2.5rem; font-size: 0.95rem; }
section[id] { scroll-margin-top: 80px; }



/* ==================== КНОПКИ ==================== */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-family: var(--font); cursor: pointer; border: none; transition: 0.2s; white-space: nowrap; }
.btn--primary { background: var(--accent); color: #fff; border-radius: 6px; padding: 12px 24px; font-size: 14px; }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,145,255,0.3); }
.btn--large { padding: 16px 40px; font-size: 16px; }
.product-page__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn--secondary {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 14px 24px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    font-family: var(--font);
    transition: 0.2s;
    white-space: nowrap;
}
.btn--secondary:hover {
    background: var(--accent);
    color: #fff;
}

/* Тёмная тема */
body.dark-theme .btn--secondary {
    border-color: var(--accent);
    color: var(--accent);
}
body.dark-theme .btn--secondary:hover {
    background: var(--accent);
    color: #fff;
}

/* ==================== TOP BAR ==================== */
.top-bar { background: var(--dark); font-size: 12px; padding: 6px 0; color: rgba(255,255,255,0.7); }
.top-bar__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.top-bar__badge { background: rgba(255,255,255,0.1); padding: 3px 10px; border-radius: 20px; font-weight: 600; color: #fff; font-size: 11px; }
.top-bar__right { display: flex; gap: 1rem; }
.top-bar__right a { color: rgba(255,255,255,0.7); font-size: 12px; }
.top-bar__right a:hover { color: #fff; }

/* ==================== HEADER ==================== */
.header { background: #fff; padding: 16px 0; box-shadow: 0 2px 15px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 100; }
.header__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.logo { display: flex; flex-direction: column; color: #1a1a1a; }
.logo__main { font-size: 1.5rem; font-weight: 900; letter-spacing: 0.5px; }
.logo__accent { color: var(--accent); }
.logo__sub { font-size: 9px; letter-spacing: 2px; color: var(--gray-text); text-transform: uppercase; }
.header__phone { font-size: 1rem; font-weight: 700; }
.header__phone:hover { color: var(--accent); }
.header__messengers { display: flex; gap: 6px; }
.header__messenger { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; color: #fff; }
.header__messenger--vk { background: #0077ff; }
.header__messenger--max {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.6rem;
}
.header__messenger--avito {
  background: #25d366; /* зелёный */
  color: #fff;
  font-weight: 700;
  font-size: 0.6rem;
}

.header__messenger:hover { transform: scale(1.1); }

/* Логотип с картинкой */
.logo--with-icon {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 10px;
}
.logo__icon {
    width: 40px;     
    height: 40px;
    object-fit: contain;
}
.logo__text {
    display: flex;
    flex-direction: column;
}


/* ==================== HERO ==================== */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
    min-height: 800px;            
    display: flex;
    align-items: center;          
    justify-content: center;      
    text-align: center;
    padding: 40px 0;         
}
.hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    padding: 0 15px;
}
.hero__tagline { display: inline-block; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); padding: 6px 18px; border-radius: 30px; font-size: 0.8rem; font-weight: 600; letter-spacing: 1px; color: rgba(255,255,255,0.9); margin-bottom: 1.5rem; }
.hero__factories { display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; color: #fff; font-weight: 700; }
.hero__dot { width: 22px; height: 22px; border-radius: 6px; display: inline-block; margin-right: 0.5rem; vertical-align: middle; }
.hero__dot--white { background: #fff; border: 3px solid #d1d5db; box-shadow: 0 0 25px rgba(255,255,255,0.6); } /* Инси */
.hero__dot--blue { background: #2563eb; box-shadow: 0 0 25px rgba(37,99,235,0.8); } /* Пораблок */
.hero__dot--red { background: #dc2626; box-shadow: 0 0 25px rgba(220,38,38,0.8); } /* Поревит */
.hero__title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.2; color: #fff; margin-bottom: 0.8rem; }
.hero__price { display: block; color: var(--yellow); font-size: 1.2em; margin-top: 5px; }
.hero__subtitle { font-size: 1rem; color: rgba(255,255,255,0.8); max-width: 600px; margin: 0 auto 1.5rem; }
.hero__features { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem; color: rgba(255,255,255,0.9); font-weight: 600; font-size: 0.9rem; }

/* ==================== Анимация кнопки узнать мою цену ==================== */
.hero__price-cta {
    position: relative;
    display: inline-block;
    margin-top: 20px;
}
.hero__price-btn {
    position: relative;
}
.hero__price-tooltip {
    position: absolute;
    top: 100%; /* Появляется строго под кнопкой */
    left: 50%;
    transform: translateX(-50%);
    margin-top: 12px; /* Небольшой отступ от кнопки */
    background: #ffffff;
    color: #1a1a1a;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.5;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, margin-top 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    pointer-events: none;
    min-width: 320px; /* Широкая плашка */
    border: 1px solid #e5e7eb;
}
.hero__price-btn:hover .hero__price-tooltip {
    opacity: 1;
    visibility: visible;
    margin-top: 16px; /* Лёгкое смещение вниз при появлении */
}

/* ==================== ABOUT ==================== */
.about { background: #fff; padding: 60px 0; }
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.about__text h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; }
.about__text p { color: #4b5563; line-height: 1.7; margin-bottom: 1rem; }
.about__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.about__stat { background: var(--gray-bg); padding: 1.2rem; border-radius: 12px; text-align: center; border: 1px solid #e2e8f0; }
.about__stat-num { font-size: 2rem; font-weight: 900; color: var(--accent); display: block; }
.about__stat-label { font-size: 0.8rem; color: var(--gray-text); }
.about__contacts { background: var(--gray-bg); padding: 1.5rem; border-radius: 12px; border: 1px solid #e2e8f0; }
.about__contacts h3 { margin-bottom: 0.8rem; }
.about__contacts p { font-size: 0.85rem; color: #4b5563; margin-bottom: 0.3rem; }
.about__phones { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.about__phones a { background: #fff; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; border: 1px solid #e5e7eb; }

/* ==================== CATEGORIES ==================== */
.categories { background: var(--gray-bg); padding: 60px 0; }
.categories__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.category-card { background: #fff; border-radius: 16px; padding: 1.8rem 1.3rem; text-align: center; border: 1px solid #e5e7eb; cursor: pointer; transition: 0.3s; }
.category-card:hover { transform: translateY(-6px); box-shadow: 0 16px 35px rgba(0,0,0,0.08); border-color: var(--accent); }
.category-card__icon { font-size: 2.8rem; margin-bottom: 0.8rem; }
.category-card__title { font-weight: 700; font-size: 1rem; }
.category-card__icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 0.8rem;
}

/* ==================== CATALOG ==================== */
.catalog { background: #fff; padding: 60px 0; }
.catalog__cat-btn--sub {
    padding-left: 35px;
    font-size: 0.8rem;
    font-weight: 400;
    background: #f9fafb;
    border: 1px solid #e5e7eb;}
    .catalog__sub {
    display: none;
}
.catalog__sub.active {
    display: block;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 2rem; }
.filter-btn { padding: 8px 18px; border-radius: 30px; border: 1px solid #e5e7eb; background: #fff; font-weight: 600; font-size: 0.85rem; cursor: pointer; font-family: var(--font); transition: 0.2s; }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.catalog__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.product-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #e5e7eb; border-top: 5px solid #e5e7eb; transition: 0.3s; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 16px 35px rgba(0,0,0,0.08); }
.product-card--porevit { border-top-color: var(--porevit); }
.product-card--porablok { border-top-color: var(--porablok); }
.product-card--insi { border-top-color: var(--insi); }
.product-card__badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.65rem; font-weight: 700; margin-bottom: 0.8rem; background: #eff6ff; color: var(--accent); align-self: flex-start; }
.product-card__title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.2rem; }
.product-card__location { font-size: 0.78rem; color: var(--gray-text); margin-bottom: 0.8rem; }
.product-card__specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-bottom: 1rem; font-size: 0.8rem; }
.product-card__spec { background: #f9fafb; padding: 0.4rem 0.5rem; border-radius: 6px; display: flex; flex-direction: column; }
.product-card__spec-label { font-size: 0.65rem; color: var(--gray-text); text-transform: uppercase; }
.product-card__spec-value { font-weight: 700; }
.product-card__price-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; gap: 0.5rem; }
.product-card__price { font-weight: 800; font-size: 1.3rem; }
.product-card__price-m3 { font-size: 0.73rem; color: var(--gray-text); }
.product-card__factory { font-size: 1.3rem; font-weight: 800; }
.product-card__price { font-size: 1.6rem; font-weight: 900; }

/* ==================== CALCULATOR ==================== */
.calculator { background: var(--gray-bg); padding: 60px 0; }
.calculator__box { max-width: 500px; margin: 0 auto; background: #fff; padding: 2rem; border-radius: 16px; border: 1px solid #e5e7eb; }
.calculator__inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.calculator__field { display: flex; flex-direction: column; gap: 0.3rem; }
.calculator__field label { font-size: 0.8rem; font-weight: 600; }
.calculator__field input, .calculator__field select { padding: 10px; border: 1px solid #e5e7eb; border-radius: 6px; font-family: var(--font); font-size: 0.9rem; }
.calculator__result { margin-top: 1.5rem; padding: 1rem; background: #f0fdf4; border-radius: 8px; font-weight: 700; text-align: center; display: none; }
.calculator__result.show { display: block; }

/* ==================== FORM ==================== */
.form-section { background: #fff; padding: 60px 0; }
.form { max-width: 500px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.form input, .form textarea { padding: 12px 16px; border: 1px solid #e5e7eb; border-radius: 8px; font-family: var(--font); font-size: 0.9rem; }
.form button { width: 100%; justify-content: center; }

/* ==================== REVIEWS ==================== */
.reviews { background: var(--gray-bg); padding: 60px 0; }
.reviews__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.review-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #e5e7eb; }
.review-card__stars { color: #f59e0b; font-size: 1.1rem; margin-bottom: 0.6rem; }
.review-card__text { font-size: 0.9rem; color: #4b5563; line-height: 1.6; margin-bottom: 1rem; font-style: italic; }
.review-card__author { font-weight: 700; font-size: 0.85rem; }
.reviews__avito { text-align: center; margin-top: 2rem; padding: 1rem; background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; max-width: 500px; margin-left: auto; margin-right: auto; }

/* ==================== FOOTER ==================== */
.footer { background: var(--dark); color: #9ca3af; padding: 2.5rem 0; font-size: 0.82rem; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.footer h4 { color: #fff; margin-bottom: 0.8rem; font-size: 0.9rem; }
.footer p, .footer a { display: block; margin-bottom: 0.3rem; }
.footer a:hover { color: #fff; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; text-align: center; }

/* ==================== АДАПТИВ ==================== */
@media (max-width: 768px) {
    .about__grid { grid-template-columns: 1fr; }
    .hero__features { flex-direction: column; align-items: center; gap: 0.8rem; }
    .categories__grid { grid-template-columns: repeat(2, 1fr); }
    .catalog__grid { grid-template-columns: 1fr; }
    .calculator__inputs { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .categories__grid { grid-template-columns: 1fr; }
}
.btn--sm { padding: 8px 16px; font-size: 0.82rem; }


/* Сертификаты */
.certificates { background: var(--gray-bg); padding: 60px 0; }
.certificates__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.cert-card { background: #fff; border-radius: 12px; overflow: hidden; text-align: center; border: 
    1px solid #e5e7eb; padding: 1rem; }
.cert-card img { width: 100%; height: auto; object-fit: contain; border-radius: 8px; margin-bottom: 0.5rem; }
.cert-card p { font-size: 0.85rem; color: #6b7280; }

a.cert-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Мобильный слайдер сертификатов */
.cert-slider {
    display: none;          /* скрыт на ПК */
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
.cert-slider__slide {
    text-align: center;
}
.cert-slider__slide img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;        /* чтобы было понятно, что можно нажать */
}
.cert-slider__slide p {
    margin-top: 10px;
    font-weight: 600;
    color: var(--gray-text);
}
.cert-slider__btn {
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.cert-slider__btn:hover {
    background: var(--accent-hover);
}

/* Показываем слайдер только на мобильных */
@media (max-width: 768px) {
    .certificates__grid {
        display: none;          /* скрываем сетку из трёх карточек */
    }
    .cert-slider {
        display: flex;          /* показываем слайдер */
    }
}

/* Лайтбокс */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.lightbox.active { display: flex; }
.lightbox img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    object-fit: contain;
}
.lightbox__close {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10;
}
.lightbox__prev, .lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 3rem;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 6px;
    z-index: 10;
}
.lightbox__prev { left: 10px; }
.lightbox__next { right: 10px; }
.lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,0.4); }

@media (max-width: 600px) {
    .lightbox__prev, .lightbox__next {
        font-size: 2rem;
        padding: 5px 10px;
    }
}


/* Карта */
.about__map { margin-top: 1.5rem; }

/* Аватарки */
.review-card__header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}
.review-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}
.review-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.review-card__photo {
    width: 100%;
    height: 180px;
    background: var(--gray-bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}
.review-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.review-card__photo-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    display: none; /* скрыт по умолчанию */
}
/* Если картинка не загрузилась — показываем placeholder */
.review-card__photo img[style*="display: none"] ~ .review-card__photo-placeholder {
    display: block;
}

body.dark-theme .review-card__avatar {
    box-shadow: 0 0 0 2px var(--accent);
}

    /* ==================== ТЁМНАЯ ТЕМА ДЛЯ ПОЛИТИКИ ==================== */
body.dark-theme section[style*="background:#f5f5f5"] {
    background: #0f172a !important;
}
body.dark-theme div[style*="background:#fff"] {
    background: #1e293b !important;
}
body.dark-theme div[style*="background:#fff"] h1,
body.dark-theme div[style*="background:#fff"] h2,
body.dark-theme div[style*="background:#fff"] h3,
body.dark-theme div[style*="background:#fff"] p,
body.dark-theme div[style*="background:#fff"] li {
    color: #e2e8f0 !important;
}
body.dark-theme div[style*="background:#fff"] a {
    color: #60a5fa !important;
}

.top-bar__city {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin-right: 8px;
}
.top-bar__btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font);
    margin-left: 6px;
    transition: 0.2s;
}
.top-bar__btn:hover {
    background: rgba(255, 255, 255, 0.25);
}