/* ============================================================
   Единый стиль таблиц сайта (как на price.html).
   Покрывает: .pzmp-table, таблицы характеристик
   (.m_product_item_spec_table[1], .m_product_item_table,
   .metal-table), прайсы (.price-table) и обычные таблицы
   данных table[border="1"/"2"]. Служебные таблицы раскладки
   (border="0" без классов) не затрагиваются.
   ============================================================ */

/* ---------- База ---------- */
table.pzmp-table,
table.m_product_item_spec_table,
table.m_product_item_spec_table1,
table.m_product_item_table,
table.metal-table,
table.price-table,
.m_product_item_info table[border="1"],
#main table[border="1"],
.m_product_item_info table[border="2"],
#main table[border="2"] {
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin: 15px 0 25px 0;
}
table.price-table { width: auto; margin-left: auto; margin-right: auto; }
@media screen and (min-width: 769px) {
    table.price-table { width: 100%; margin-left: 0; margin-right: 0; }
}
table.metal-table { border: 1px solid #ddd; }

/* ---------- Шапка: thead и первая строка данных ---------- */
table.pzmp-table thead th,
table.m_product_item_spec_table thead th,
table.m_product_item_spec_table1 thead th,
table.m_product_item_table thead th,
table.metal-table thead th,
table.price-table thead th,
.m_product_item_info table[border="1"] thead th,
#main table[border="1"] thead th,
table.pzmp-table > tbody > tr:first-child > th,
table.m_product_item_spec_table > tbody > tr:first-child > td,
table.m_product_item_spec_table > tr:first-child > td,
table.m_product_item_spec_table1 > tbody > tr:first-child > td,
table.m_product_item_spec_table1 > tr:first-child > td,
table.m_product_item_table > tbody > tr:first-child > td,
table.m_product_item_table > tr:first-child > td,
.m_product_item_info table[border="1"] > tbody > tr:first-child > td,
.m_product_item_info table[border="1"] > tr:first-child > td,
#main table[border="1"] > tbody > tr:first-child > td,
#main table[border="1"] > tr:first-child > td,
.m_product_item_info table[border="2"] > tbody > tr:first-child > td,
#main table[border="2"] > tbody > tr:first-child > td {
    background-color: #f2f2f2;
    color: #333;
    padding: 10px 8px;
    border: 1px solid #ddd;
    text-align: center;
    font-weight: bold;
    vertical-align: middle;
}

/* ---------- Ячейки ---------- */
table.pzmp-table th, table.pzmp-table td,
table.m_product_item_spec_table th, table.m_product_item_spec_table td,
table.m_product_item_spec_table1 th, table.m_product_item_spec_table1 td,
table.m_product_item_table th, table.m_product_item_table td,
table.metal-table th, table.metal-table td,
table.price-table th, table.price-table td,
.m_product_item_info table[border="1"] th, .m_product_item_info table[border="1"] td,
#main table[border="1"] th, #main table[border="1"] td,
.m_product_item_info table[border="2"] th, .m_product_item_info table[border="2"] td,
#main table[border="2"] th, #main table[border="2"] td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

/* Липкая шапка у больших прайсов */
table.price-table thead th {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ---------- Hover строки ---------- */
table.pzmp-table tbody tr:hover,
table.m_product_item_spec_table tbody tr:hover,
table.m_product_item_spec_table1 tbody tr:hover,
table.m_product_item_table tbody tr:hover,
table.metal-table tbody tr:hover,
table.price-table tbody tr:hover,
.m_product_item_info table[border="1"] tbody tr:hover,
#main table[border="1"] tbody tr:hover {
    background-color: #f0f8ff;
    transition: background-color 0.2s ease;
}
table.pzmp-table tbody tr:hover td,
table.m_product_item_spec_table tbody tr:hover td,
table.m_product_item_spec_table1 tbody tr:hover td,
table.m_product_item_table tbody tr:hover td,
table.metal-table tbody tr:hover td,
table.price-table tbody tr:hover td,
.m_product_item_info table[border="1"] tbody tr:hover td,
#main table[border="1"] tbody tr:hover td {
    color: #0066cc;
    font-weight: bold;
}

/* ---------- Авторское выравнивание ячеек (поверх базового) ---------- */
table td[align="center"], table th[align="center"] { text-align: center !important; }
table td[align="right"], table th[align="right"] { text-align: right !important; }
table td[align="left"], table th[align="left"] { text-align: left !important; }

/* ---------- Вспомогательные классы прайсов ---------- */
.category { background-color: #e6f7ff; font-weight: bold; }
.category td { background-color: #e6f7ff; font-weight: bold; padding-left: 15px; }
.subcategory { background-color: #f0f8ff; font-weight: bold; }
.subcategory td { background-color: #f0f8ff; font-weight: bold; padding-left: 30px; }
.model { padding-left: 45px; }
.col-center { text-align: center; }
.col-price { text-align: right; font-weight: 600; padding-right: 15px; }
.col-name { text-align: left; padding-left: 14px; font-weight: 500; }
.price-header { float: right; font-weight: normal; margin-right: 15px; }
.price-table .col-img img { max-width: 60px; max-height: 45px; display: block; margin: 0 auto; cursor: zoom-in; }
.price-section-title {
    text-align: center;
    background: #e6eef9;
    color: #003366;
    padding: 10px;
    margin: 30px 0 10px 0;
    border-bottom: 3px solid #b0c8e0;
    font-size: 18px;
    font-weight: 700;
}
.price-note, .note {
    font-size: 13px;
    color: #666;
    margin-top: 20px;
    font-style: italic;
    padding: 10px 14px;
    background: #f8fafc;
    border-left: 4px solid #b0c8e0;
}

/* ---------- Мобильные: горизонтальный скролл широких таблиц ---------- */
@media screen and (max-width: 768px) {
    table.pzmp-table,
    table.m_product_item_spec_table,
    table.m_product_item_spec_table1,
    table.m_product_item_table,
    table.metal-table,
    table.price-table,
    .m_product_item_info table[border="1"],
    #main table[border="1"] {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table.pzmp-table th, table.pzmp-table td,
    table.m_product_item_spec_table th, table.m_product_item_spec_table td,
    table.m_product_item_spec_table1 th, table.m_product_item_spec_table1 td,
    table.price-table th, table.price-table td {
        padding: 6px;
        font-size: 13px;
    }
}

/* ---------- Мобильный скролл таблиц через обёртку ---------- */
.pzmp-table-scroll,
.metal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0 25px 0;
}
.pzmp-table-scroll > table,
.metal-table-wrap > table {
    margin: 0 !important;
}
.pzmp-table-scroll:focus {
    outline: 2px solid #b0c8e0;
    outline-offset: -2px;
}

/* ---------- Подсказка горизонтального скролла ---------- */
.pzmp-table-scroll.pzmp-scrollable,
.metal-table-wrap.pzmp-scrollable {
    box-shadow: inset -24px 0 18px -18px rgba(10, 73, 126, 0.45);
}

@media screen and (max-width: 768px) {
    .pzmp-table-scroll > table.kpp-top {
        width: 100% !important;
    }
    table.kpp-top td[rowspan] img {
        width: 140px !important;
        max-width: 140px;
        height: auto !important;
    }
}

/* ============================================================
   PZMP-THEME: тёмная палитра таблиц
   ============================================================ */
html[data-theme="dark"] table.pzmp-table,
html[data-theme="dark"] table.m_product_item_spec_table,
html[data-theme="dark"] table.m_product_item_spec_table1,
html[data-theme="dark"] table.m_product_item_table,
html[data-theme="dark"] table.metal-table,
html[data-theme="dark"] table.price-table,
html[data-theme="dark"] table.price-table-1,
html[data-theme="dark"] table.price-table-2 {
    color: #dfe4ea;
}
html[data-theme="dark"] table.price-table thead th,
html[data-theme="dark"] table.price-table-1 thead th,
html[data-theme="dark"] table.price-table-2 thead th {
    background-color: #243040;
    color: #e6e9ee;
    border-color: #3a4656;
}
html[data-theme="dark"] table.pzmp-table > tbody > tr:first-child > td,
html[data-theme="dark"] table.m_product_item_spec_table > tbody > tr:first-child > td,
html[data-theme="dark"] table.m_product_item_spec_table1 > tbody > tr:first-child > td,
html[data-theme="dark"] table.m_product_item_table > tbody > tr:first-child > td,
html[data-theme="dark"] .m_product_item_info table[border="1"] > tbody > tr:first-child > td,
html[data-theme="dark"] #main table[border="1"] > tbody > tr:first-child > td {
    background-color: #243040;
    color: #e6e9ee;
    border-color: #3a4656;
}
html[data-theme="dark"] table.pzmp-table th, html[data-theme="dark"] table.pzmp-table td,
html[data-theme="dark"] table.m_product_item_spec_table th, html[data-theme="dark"] table.m_product_item_spec_table td,
html[data-theme="dark"] table.m_product_item_spec_table1 th, html[data-theme="dark"] table.m_product_item_spec_table1 td,
html[data-theme="dark"] table.m_product_item_table th, html[data-theme="dark"] table.m_product_item_table td,
html[data-theme="dark"] table.metal-table th, html[data-theme="dark"] table.metal-table td,
html[data-theme="dark"] table.price-table th, html[data-theme="dark"] table.price-table td,
html[data-theme="dark"] table.price-table-1 th, html[data-theme="dark"] table.price-table-1 td,
html[data-theme="dark"] table.price-table-2 th, html[data-theme="dark"] table.price-table-2 td,
html[data-theme="dark"] .m_product_item_info table[border="1"] th, html[data-theme="dark"] .m_product_item_info table[border="1"] td,
html[data-theme="dark"] #main table[border="1"] th, html[data-theme="dark"] #main table[border="1"] td {
    border-color: #3a4656;
}
html[data-theme="dark"] table.pzmp-table tbody tr:hover,
html[data-theme="dark"] table.m_product_item_spec_table tbody tr:hover,
html[data-theme="dark"] table.m_product_item_spec_table1 tbody tr:hover,
html[data-theme="dark"] table.price-table tbody tr:hover,
html[data-theme="dark"] table.price-table-1 tbody tr:hover,
html[data-theme="dark"] table.price-table-2 tbody tr:hover {
    background-color: #1d2c44 !important;
}
html[data-theme="dark"] table.pzmp-table tbody tr:hover td,
html[data-theme="dark"] table.price-table tbody tr:hover td,
html[data-theme="dark"] table.price-table-1 tbody tr:hover td,
html[data-theme="dark"] table.price-table-2 tbody tr:hover td {
    color: #9fc3e8 !important;
}
html[data-theme="dark"] .category, html[data-theme="dark"] .category td { background-color: #1d2c44; }
html[data-theme="dark"] .subcategory, html[data-theme="dark"] .subcategory td { background-color: #182435; }
html[data-theme="dark"] .price-section-title {
    background: #1d2f45;
    color: #9fc3e8;
    border-bottom-color: #2e4a6b;
}
html[data-theme="dark"] .price-note, html[data-theme="dark"] .note {
    background: #18202b;
    color: #9aa5b1;
    border-left-color: #2e4a6b;
}
html[data-theme="dark"] .price-download-btn { color: #fff; }
html[data-theme="dark"] .col-price { color: #e6e9ee; }

/* PZMP-THEME fixes v6: first-row headers for border=2 tables */
html[data-theme="dark"] .m_product_item_info table[border="2"] > tbody > tr:first-child > td,
html[data-theme="dark"] #main table[border="2"] > tbody > tr:first-child > td {
    background-color: #243040;
    color: #e6e9ee;
    border-color: #3a4656;
    text-align: center;
    font-weight: bold;
    vertical-align: middle;
    padding: 10px 8px;
}
