/* css/product-details.css */
.details-main { padding-bottom: 5rem; }

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

.details-nav { margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center; }

.back-link {
    color: var(--magenta);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    transition: opacity 0.3s;
}
.back-link:hover { opacity: 0.7; }

.details-header {
    margin-bottom: 2rem;
    border-bottom: none;
    padding-bottom: 0;
}
.details-header h1 {
    font-size: 2.2rem;
    color: var(--brand-dark);
    margin: 0;
}

.details-alias {
    margin: 0.55rem 0 0;
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.4;
}

.details-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2rem;
    align-items: start;
}
.details-left, .details-right {
    width: 100%;
}

.details-section {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.section-h {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--magenta);
    margin-bottom: 0.75rem;
    letter-spacing: 0.08rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.4rem;
}

.details-text-block {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-main);
}

.protocol-box, .info-box {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 1rem;
}
.protocol-box h4 {
    color: var(--brand-dark);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.protocol-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-main);
}

.details-ul { padding-left: 1.5rem;}
.details-ul li { margin-bottom: 0.8rem; line-height: 1.6; color: var(--text-main); }

.faq-item { margin-bottom: 1rem; }
.faq-q { font-weight: 700; color: var(--brand-dark); margin-bottom: 0.4rem; font-size: 1.05rem;}
.faq-a { color: var(--text-main); line-height: 1.5; }

.info-box.highlight-left {
    padding-left: 1.5rem;
    border-left: 3px solid var(--magenta);
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.specs-table { width: 100%; border-collapse: collapse; }
.specs-table td {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-main);
}
.specs-table td:last-child { text-align: right; font-weight: 600; color: var(--brand-dark); }

.cert-btn {
    display: block;
    margin-top: 3rem;
    padding: 1rem;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    transition: background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, color 180ms ease-out, transform 180ms ease-out;
}
.cert-btn:hover {
    background: var(--bg-light);
    color: var(--magenta);
    border-color: var(--magenta);
    border-style: solid;
}

.buffer-block {
    background: var(--bg-light);
    border: 1px solid var(--border-dark);
    border-left: 3px solid var(--brand-dark);
    padding: 0.8rem 1.2rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--brand-dark);
    box-shadow: var(--shadow-sm);
}

.kit-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 1.05rem;
}

.kit-item::before {
    content: "✓";
    color: var(--magenta);
    font-weight: 800;
}

/* --- АДАПТИВНОСТЬ (МОБИЛЬНЫЙ ВИД) --- */
@media (max-width: 900px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .details-container {
        margin: 1.5rem auto;
    }

    .details-header h1 {
        font-size: 1.8rem;
    }

    .details-section {
        padding: 1.5rem;
    }

    /* ВАЖНО: Эта логика ломала таблицу в PDF, если мы не отменяли ее в @media print */
    .specs-table td {
        display: block;
        padding: 0.5rem 0;
        border-bottom: none;
    }

    .specs-table td:first-child {
        font-weight: 700;
        font-size: 0.85rem;
        text-transform: uppercase;
        color: var(--text-muted);
        padding-bottom: 0;
    }

    .specs-table td:last-child {
        text-align: left;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border-color);
    }
}

.kit-contents-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.variant-spec-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--magenta);
    border-radius: 8px;
    padding: 15px 20px;
}

.v-spec-badge {
    display: inline-block;
    background: var(--white);
    color: var(--brand-dark);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.v-spec-text {
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.6;
    font-weight: 400;
}

.qc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

.product-documents-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.product-documents-group-title {
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.document-card-manual {
    border-left: 3px solid var(--brand-dark);
}

.document-card-extended-description {
    border-left: 3px solid var(--magenta);
}

.document-card-quality-certificate {
    border-left: 3px solid var(--border-active);
}

.qc-download-card {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    text-decoration: none;
    transition: background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, color 180ms ease-out, transform 180ms ease-out;
    cursor: pointer;
}

.qc-download-card:hover {
    border-color: var(--magenta);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.qc-icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

.qc-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.qc-label {
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.qc-cat {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.qc-arrow {
    color: var(--magenta);
    font-weight: 900;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.qc-download-card:hover .qc-arrow {
    transform: translateY(3px);
}

.proof-container {
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.mechanism-image {
    width: 100%;
    max-height: 40vh;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.proof-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}

.protocol-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.protocol-table th {
    background: var(--magenta-light-bg);
    color: var(--brand-dark);
    font-weight: 700;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border-active);
}
.protocol-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.cf-troubleshooting {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.cf-troubleshooting summary {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-dark);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
}

.cf-troubleshooting summary::after {
    content: "+";
    color: var(--magenta);
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 900;
}

.cf-troubleshooting[open] summary::after {
    content: "−";
}

.cf-troubleshooting summary:hover {
    background: var(--magenta-light-bg);
}

.cf-troubleshooting-content {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border-top: 1px dashed var(--border-active);
}

.cf-accordion-full {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.cf-accordion-full summary {
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--brand-dark);
    cursor: pointer;
    background: var(--card-bg-alt);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.cf-accordion-full summary:hover {
    background: var(--magenta-light-bg);
}

.cf-accordion-full summary::after {
    content: "+";
    color: var(--magenta);
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.cf-accordion-full[open] summary::after {
    content: "−";
}

.cf-accordion-body {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.proof-gallery {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.proof-card {
    flex: 1 1 0;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.proof-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.proof-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

.ts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .ts-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.ts-problem {
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.ts-solution {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
}

.protocol-step-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--brand-dark);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.protocol-table {
    width: auto !important;
    max-width: 580px;
    margin: 0.5rem 0 0.8rem 0;
    font-size: 0.88rem;
    box-shadow: none;
}

.protocol-table th {
    background: var(--magenta-light-bg) !important;
    color: var(--brand-dark);
    font-weight: 700;
    padding: 8px 12px !important;
}

.protocol-table td {
    padding: 6px 12px !important;
    color: var(--text-main);
}

.table-caption {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.2rem;
    margin-bottom: 0.5rem;
    padding-left: 2px;
}

/* =========================================================================
   ИДЕАЛЬНАЯ ПЕЧАТНАЯ ВЕРСИЯ (PDF)
   ========================================================================= */
@media print {
    /* 1. ПРИВЯЗКА ВСЕГО ДОКУМЕНТА К FUTURA */
    html, body, table, td, th, p, li, span, div {
        font-family: 'Futura', 'Arial', sans-serif !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 2. УНИФИКАЦИЯ ТЕКСТА ВНУТРИ БЛОКОВ (Один размер для всей прозы) */
    .details-text-block,
    .protocol-step-text,
    .ts-solution,
    .ts-solution ul li,
    .details-ul li,
    .info-box,
    .buffer-block,
    .table-caption,
    .specs-table td:first-child,
    .protocol-table td:not([rowspan]) {
        font-size: 10.5pt !important;
        line-height: 1.45 !important;
        color: #222222 !important;
    }

    /* 3. ЧИСЛОВАЯ И КЛЮЧЕВАЯ ИНФОРМАЦИЯ */
    .specs-table td:last-child,
    .protocol-table td[rowspan],
    .variant-spec-card,
    .highlight-number,
    .protocol-table th,
    .specs-table th {
        font-size: 11.5pt !important;
        font-weight: 700 !important;
    }

    /* 4. ЗАГОЛОВКИ */
    .section-h {
        font-size: 13pt !important;
        font-weight: 800 !important;
        color: var(--magenta) !important;
        margin-bottom: 0.6rem !important;
        border-bottom: 1px solid #cccccc !important;
        padding-bottom: 0.3rem !important;
    }

    .cf-accordion-full summary {
        font-size: 14pt !important;
        font-weight: 800 !important;
        color: var(--brand-dark) !important;
        border-bottom: 2px solid var(--magenta) !important;
        margin-bottom: 0.8rem !important;
        background: transparent !important;
        padding: 0.5rem 0 !important;
    }

    .ts-problem {
        font-size: 11pt !important;
        font-weight: 700 !important;
        color: var(--brand-dark) !important;
        margin-bottom: 0.3rem !important;
    }

    /* 5. СТРУКТУРНЫЕ ИСПРАВЛЕНИЯ ДЛЯ ПЕЧАТИ */
    .details-section {
        margin-bottom: 1.2rem !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    /* ВАЖНО: Возвращаем таблицам нормальный вид, отменяя мобильные стили */
    .specs-table td, .protocol-table td, .specs-table th, .protocol-table th {
        display: table-cell !important;
    }

    .protocol-table {
        width: 100% !important; /* На листе А4 таблица должна занимать всю ширину */
        max-width: none !important;
    }

    .protocol-table, .specs-table, .cf-accordion-full, .proof-card, .ts-item {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .proof-gallery {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 1rem !important;
        overflow-x: hidden !important;
    }

    .proof-card {
        flex: 0 0 48% !important;
        min-width: 48% !important;
    }

    /* Скрываем интерфейсный мусор на печати */
    .cf-accordion-full summary::after,
    .cf-troubleshooting summary::after,
    .cert-btn,
    .quick-buy-trigger {
        display: none !important;
    }
}
