/* ==================================================
   ALITESTED — style.css (cleaned)
   Структура: база → layout → кнопки → главная →
   карточки → обзор → купоны → пагинация → адаптив
   ================================================== */

/* ---------- 1. ПЕРЕМЕННЫЕ И БАЗА ---------- */
:root {
    --primary: #ff4747;
    --primary-dark: #e63939;
    --text: #333333;
    --success: #28a745;
    --danger: #dc3545;
    --border: #e9ecef;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2328;
    background: #f6f7f9;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { line-height: 1.3; margin-bottom: 15px; letter-spacing: -0.02em; color: #16191d; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
p { margin-bottom: 15px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

section[id] { scroll-margin-top: 90px; }

/* Доступность: видимый фокус с клавиатуры */
button:focus, a:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- 2. LAYOUT: ШАПКА / МЕНЮ / ФУТЕР ---------- */
header {
    background: #fff;
    border-bottom: 1px solid #e8eaee;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    position: sticky; top: 0; z-index: 100;
    padding: 12px 0;
    margin-bottom: 30px;
}
header .container { display: flex; justify-content: space-between; align-items: center; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; color: var(--text); text-decoration: none; }
.logo > span:last-child { color: var(--primary); }
.logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, #ff4747, #ff7a59);
    color: #fff; font-size: 14px; font-weight: 800;
    box-shadow: 0 2px 6px rgba(255, 71, 71, .35);
}

nav a { margin-left: 20px; color: var(--text); font-weight: 600; text-decoration: none; }
nav a:hover { color: var(--primary); text-decoration: none; }

/* FIX: липнет только шапка сайта, не <header> внутри страниц */
main header { position: static !important; top: auto !important; z-index: auto !important; }

footer { background: #10131a; color: #98a2b3; padding: 40px 0; margin-top: 60px; font-size: .9rem; text-align: center; }
footer a { color: #fff; }
.affiliate-disclosure {
    max-width: 800px; margin: 0 auto 20px; padding: 15px;
    background: #1a202c; color: #98a2b3; border-radius: 8px;
    border-left: 4px solid var(--primary); text-align: left;
}

/* Бургер */
.burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.burger span { display: block; width: 24px; height: 3px; background: #16191d; border-radius: 2px; transition: all .25s; }

/* ---------- 3. КНОПКИ ---------- */
.btn-cta, .btn-cta:hover {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all .2s;
    box-shadow: 0 4px 6px rgba(255, 71, 71, .3);
}
.btn-cta:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 12px rgba(255, 71, 71, .4); }

.btn-ghost { display: inline-block; padding: 14px 26px; border-radius: 50px; border: 1px solid #344054; color: #e4e7ec; text-decoration: none; font-weight: 600; transition: all .2s; }
.btn-ghost:hover { border-color: #ff7a59; color: #ff7a59; text-decoration: none; }

/* ---------- 4. ГЛАВНАЯ: HERO v3 ---------- */
.hero-v3 { background: #10131a; border-radius: 20px; margin-bottom: 50px; overflow: hidden; }
.hero-v3-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; padding: 60px 50px; align-items: center; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: #ff7a59; margin-bottom: 18px; }
.hero-v3 h1 { color: #fff; font-size: 2.6rem; line-height: 1.15; font-weight: 800; margin-bottom: 18px; }
.hero-v3 h1 em { font-style: normal; color: #ff7a59; }
.hero-v3-text > p { color: #98a2b3; font-size: 1.05rem; line-height: 1.7; max-width: 520px; margin-bottom: 28px; }
.hero-v3-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { color: #fff; font-size: 1.5rem; font-weight: 800; }
.hero-stats span { color: #667085; font-size: .85rem; }

.hero-card { display: block; background: #fff; border-radius: 16px; padding: 14px; text-decoration: none; color: inherit; transform: rotate(2deg); box-shadow: 0 24px 48px -12px rgba(0,0,0,.5); transition: transform .25s; position: relative; }
.hero-card:hover { transform: rotate(0deg) translateY(-4px); }
.hero-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 10px; }
.hero-card .badge-tested { position: absolute; top: 24px; left: 24px; }
.hero-card-body { padding: 14px 6px 6px; }
.hero-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hero-card-top .price { color: var(--primary); font-size: 1.2rem; }
.hero-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.hero-card .go { color: var(--primary); font-weight: 700; font-size: .9rem; }

/* Заголовки секций с красной полоской */
.section-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 24px; display: flex; align-items: center; gap: 12px; }
.section-title::before { content: ""; width: 5px; height: 26px; border-radius: 3px; background: linear-gradient(180deg, #ff4747, #ff7a59); }

/* Карточки сравнений на главной */
.compare-card { display: block; background: #fff; border: 1px solid #e8eaee; border-radius: 14px; padding: 20px; text-decoration: none; color: inherit; transition: all .2s; }
.compare-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -8px rgba(16,24,40,.14); }
.compare-card .vs-imgs { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.compare-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.compare-card .vs { font-weight: 800; color: var(--primary); }
.compare-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.compare-card .go { color: var(--primary); font-weight: 700; font-size: .9rem; }

/* ---------- 5. КАРТОЧКИ ТОВАРОВ + СОРТИРОВКА ---------- */
.review-card, .product-card {
    background: #fff;
    border: 1px solid #e8eaee;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
    transition: transform .2s, box-shadow .2s;
}
.review-card:hover, .product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -8px rgba(16,24,40,.14) !important; }
.review-card img, .product-card img { width: 100%; height: 220px; object-fit: cover; }

.sort-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid #e8eaee; border-radius: 12px; padding: 12px 16px; margin-bottom: 28px; }
.sort-bar > span { font-weight: 600; color: #667085; font-size: .9rem; }
.sort-chip { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: #344054; background: #f2f4f7; font-size: .9rem; font-weight: 600; transition: all .15s; }
.sort-chip:hover { background: #e8eaee; text-decoration: none; }
.sort-chip.active { background: #16191d; color: #fff; }

/* ---------- 6. СТРАНИЦА ОБЗОРА ---------- */
.review-hero { display: flex; gap: 28px; background: #fff; border: 1px solid #e8eaee; border-radius: 14px; padding: 24px; margin-bottom: 20px; }
.hero-img-wrap { flex: 0 0 300px; position: relative; align-self: flex-start; }
.hero-img-wrap img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: #f6f7f9; }
.badge-tested { position: absolute; top: 10px; left: 10px; background: rgba(22,25,29,.85); color: #fff; font-size: .72rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.hero-info h1 { font-size: 1.65rem; margin-bottom: 6px; }
.hero-meta { color: #667085; font-size: .9rem; margin-bottom: 10px; }
.rating-price { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.rating-price .price { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.hero-summary { font-size: 1rem; line-height: 1.7; margin-bottom: 16px; }
.cta-note { font-size: .78rem; color: #98a2b3; margin-top: 8px; }

.toc { background: #fff; border: 1px solid #e8eaee; border-radius: 12px; padding: 14px 20px; margin-bottom: 28px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.toc a { color: var(--primary); font-weight: 600; font-size: .92rem; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; }
.pros-box { background: #e8f5e9; padding: 20px; border-radius: 12px; }
.cons-box { background: #ffebee; padding: 20px; border-radius: 12px; }
.pros-box h3 { color: var(--success); margin-bottom: 12px; }
.cons-box h3 { color: var(--danger); margin-bottom: 12px; }
.pros-cons ul { padding-left: 20px; }
.pros-cons li { margin-bottom: 8px; }

.specs-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(16,24,40,.06); margin-bottom: 32px; }

.timeline-list { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 32px; }
.timeline-list li { flex: 1; min-width: 140px; background: #fff; border: 1px solid #e8eaee; padding: 14px; border-radius: 10px; text-align: center; transition: transform .2s; }
.timeline-list li:hover { transform: translateY(-2px); }
.timeline-list strong { display: block; color: #667085; font-size: .85rem; margin-bottom: 4px; }

.review-content h2 { margin-top: 30px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.review-content p { font-size: 1.05rem; line-height: 1.8; }
.review-content ul, .review-content ol { margin: 15px 0 15px 30px; }

.related-compare { background: #fff; border: 1px solid #e8eaee; border-radius: 14px; padding: 24px; margin: 32px 0; }
.related-compare .links { display: flex; flex-wrap: wrap; gap: 12px; }
.related-compare a { background: #f2f4f7; padding: 10px 16px; border-radius: 999px; text-decoration: none; color: #344054; font-weight: 600; font-size: .9rem; }
.related-compare a:hover { background: #e8eaee; }

/* Липкая CTA (мобильные) */
.sticky-cta { display: none; }

/* ---------- 7. КУПОНЫ ---------- */
.coupon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.coupon { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #fff; border: 2px dashed #ffb648; border-radius: 12px; padding: 16px 18px; cursor: pointer; transition: all .15s; user-select: none; }
.coupon:hover { border-color: var(--primary); box-shadow: 0 6px 16px -6px rgba(16,24,40,.15); transform: translateY(-2px); }
.coupon-left { display: flex; flex-direction: column; gap: 2px; }
.coupon-title { font-size: 1.05rem; }
.coupon-desc { color: #667085; font-size: .85rem; }
.coupon-right { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.coupon-code { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: .05em; background: #fff7e6; border: 1px solid #ffd591; padding: 6px 12px; border-radius: 8px; color: #874d00; }
.copy-hint { font-size: .75rem; color: #98a2b3; }
.coupon.copied { border-style: solid; border-color: var(--success); background: #f0fff4; }
.coupon.copied .copy-hint { color: var(--success); font-weight: 700; }

/* ---------- 8. ПАГИНАЦИЯ / ПРОЧЕЕ ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0; }
.page-num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 1px solid #e8eaee; text-decoration: none; color: #344054; font-weight: 600; transition: all .15s; }
.page-num:hover { background: #f2f4f7; border-color: #d0d5dd; }
.page-num.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.stars { letter-spacing: 2px; }

table { overflow-x: auto; display: block; }

/* ---------- ХЛЕБНЫЕ КРОШКИ ---------- */
.breadcrumbs {
    margin-bottom: 20px;
    font-size: .9rem;
    color: #667085;
}
.breadcrumbs a { color: var(--primary); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span { color: #344054; }

/* ---------- AUTHOR BOX ---------- */
.author-box { display: flex; gap: 18px; background: #fff; border: 1px solid #e8eaee; border-radius: 14px; padding: 24px; margin: 32px 0; align-items: flex-start; }
.author-avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #ff4747, #ff7a59); color: #fff; font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; }
.author-name { font-size: 1.05rem; margin-bottom: 2px; }
.author-role { color: #667085; font-size: .8rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.author-box p { color: #475467; font-size: .95rem; margin-bottom: 8px; }
.author-box a { font-weight: 600; }

/* ---------- RELATED REVIEWS ---------- */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card { display: block; background: #fff; border: 1px solid #e8eaee; border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; transition: all .2s; }
.related-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -8px rgba(16,24,40,.14); }
.related-card img { width: 100%; height: 140px; object-fit: cover; }
.related-card-body { padding: 14px; }
.related-card h3 { font-size: .95rem; margin-bottom: 8px; line-height: 1.4; }
.related-card .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.related-card .price { color: var(--primary); font-weight: 800; }
.related-card .go { color: var(--primary); font-weight: 700; font-size: .85rem; }
.compare-mini { display: block; text-align: center; margin-top: 8px; font-size: .82rem; color: #667085; font-weight: 600; text-decoration: none; }
.compare-mini:hover { color: var(--primary); }

/* ---------- 9. АДАПТИВ ---------- */
@media (min-width: 769px) {
    table { display: table; }
}

@media (max-width: 900px) {
    .hero-v3-inner { grid-template-columns: 1fr; padding: 40px 24px; }
    .hero-v3 h1 { font-size: 2rem; }
    .hero-card { transform: none; max-width: 420px; }
}

@media (max-width: 768px) {
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    .related-grid { grid-template-columns: 1fr; }
    .author-box { flex-direction: column; }
    .btn-cta { padding: 12px 24px; font-size: 1rem; }

    /* Бургер-меню */
    .burger { display: flex; }
    .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid #e8eaee; box-shadow: 0 12px 24px -8px rgba(16,24,40,.12); display: none; flex-direction: column; padding: 8px 20px 16px; }
    .main-nav.open { display: flex; }
    .main-nav a { margin: 0; padding: 14px 0; border-bottom: 1px solid #f2f4f7; font-size: 1.05rem; font-weight: 600; }
    .main-nav a:last-child { border-bottom: none; }
    .burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .burger.open span:nth-child(2) { opacity: 0; }
    .burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Обзор и сравнение в одну колонку */
    .review-hero { flex-direction: column; }
    .hero-img-wrap { flex: none; width: 100%; }
    .pros-cons { grid-template-columns: 1fr; }
    section[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 640px) {
    /* Hero главной — компактно */
    .hero-v3 { margin-bottom: 30px; }
    .hero-v3-inner { padding: 32px 20px 24px; gap: 22px; }
    .eyebrow { margin-bottom: 12px; font-size: .7rem; }
    .hero-v3 h1 { font-size: 1.55rem; margin-bottom: 12px; }
    .hero-v3-text > p { font-size: .95rem; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .hero-v3-actions { margin-bottom: 22px; gap: 10px; }
    .hero-v3-actions .btn-cta, .hero-v3-actions .btn-ghost { padding: 12px 20px; font-size: .95rem; }
    .hero-stats { gap: 20px; }
    .hero-stats strong { font-size: 1.2rem; }
    .hero-stats span { font-size: .75rem; }
    .hero-card { display: flex; align-items: center; gap: 14px; padding: 10px; transform: none; }
    .hero-card img { width: 84px; height: 84px; border-radius: 8px; flex: none; }
    .hero-card .badge-tested { display: none; }
    .hero-card-body { padding: 0; }
    .hero-card-top { margin-bottom: 4px; }
    .hero-card-top .price { font-size: 1rem; }
    .hero-card h3 { font-size: .95rem; margin-bottom: 4px; }
    .hero-card .go { font-size: .8rem; }

    /* Обзор — компактно */
    .review-hero { padding: 16px; gap: 14px; margin-bottom: 14px; }
    .hero-img-wrap img { max-height: 190px; }
    .hero-info h1 { font-size: 1.35rem; }
    .hero-meta { font-size: .8rem; margin-bottom: 8px; }
    .rating-price { gap: 10px; margin-bottom: 10px; }
    .rating-price .price { font-size: 1.25rem; }
    .hero-summary { font-size: 1rem; line-height: 1.65; color: #344054; margin-bottom: 14px; }
    .review-hero .btn-cta { display: block; text-align: center; padding: 13px 20px; font-size: 1rem; border-radius: 12px; }
    .toc { padding: 12px 14px; gap: 6px 12px; }
    .toc a { font-size: .85rem; }
    .pros-box, .cons-box { padding: 16px; }
    .timeline-list { flex-direction: column; }
    .timeline-list li { min-width: 100%; }

    /* Липкая CTA */
    .sticky-cta { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 95; background: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(16,24,40,.12); align-items: center; gap: 12px; }
    .sticky-price { font-weight: 800; font-size: 1.15rem; color: var(--primary); white-space: nowrap; }
    .sticky-btn { flex: 1; text-align: center; padding: 12px 16px; font-size: 1rem; border-radius: 12px; }
    body { padding-bottom: 76px; }
}

@media print {
    header, footer, .btn-cta, nav[aria-label="Breadcrumb"] { display: none !important; }
    body { background: white; }
}

/* ---------- ФОТО-ГАЛЕРЕЯ ---------- */
.photo-gallery { position: relative; }

/* Главное фото */
.hero-img-wrap .gallery-main {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
    background: #f6f7f9;
    cursor: zoom-in;
}

/* Миниатюры: ряд квадратных превью */
.hero-img-wrap .gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.hero-img-wrap .gallery-thumb {
    width: 72px;
    height: 72px;
    max-height: none;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
    border: 2px solid #e8eaee;
    cursor: pointer;
    transition: all .15s;
}
.hero-img-wrap .gallery-thumb:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.hero-img-wrap .gallery-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 71, 71, .2);
}

/* ---------- LIGHTBOX (увеличение фото) ---------- */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all .2s;
}
.lightbox-close:hover {
    color: var(--primary);
    transform: scale(1.2);
}