﻿
.price-period-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 12px 0 6px;
}

.price-period-options label {
    display: inline-block;
    margin: 0 12px 0 4px;
    cursor: pointer;
}

.price-period-options input { accent-color: #117d8e; }

.price-period-note {
    display: block;
    color: #52616b;
    font-size: 13px;
    line-height: 1.4;
}

.price-change {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}

.price-increase { color: #b42318; }
.price-decrease { color: #16713b; }

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f5f6f8;
    color: #263238;
    margin: 0;
    padding: 30px;
}

.catalog-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
}

h1 {
    color: #117d8e;
    margin-top: 0;
}

/* Поиск */

.search-box {
    padding: 10px;
    font-size: 15px;
    border: 1px solid #ccd3da;
    border-radius: 5px;
}

.search-button {
    padding: 11px 22px;
    background: #117d8e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

    .search-button:hover {
        background: #096478;
    }

.reset-button {
    padding: 11px 20px;
    background: #eef2f6;
    color: #117d8e;
    border: 1px solid #ccd3da;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 8px;
}

    .reset-button:hover {
        background: #dce6ef;
    }

/* Управление группами */

.group-controls {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

    .group-controls button {
        padding: 9px 16px;
        background: #eef2f6;
        color: #117d8e;
        border: 1px solid #ccd3da;
        border-radius: 5px;
        font-size: 14px;
        cursor: pointer;
    }

        .group-controls button:hover {
            background: #dce6ef;
        }

/* Группы товаров */

.catalog-group {
    margin-top: 12px;
    border: 1px solid #e5e9ed;
    border-radius: 6px;
    overflow: hidden;
}

    .catalog-group summary {
        padding: 15px 18px;
        background: #eef2f6;
        color: #117d8e;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        border-left: 4px solid #35658e;
        letter-spacing: 0.2px;
    }

        .catalog-group summary:hover {
            background: #dce6ef;
        }

    .catalog-group[open] summary {
        background: #117d8e;
        color: white;
        border-left-color: #7bd0d4;
    }

/* Таблица товаров */

.catalog-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

.catalog-group .catalog-table {
    margin-top: 0;
}

.catalog-table th {
    background: #117d8e;
    color: white;
    padding: 12px;
    text-align: left;
}

    .catalog-table th a {
        color: white;
        text-decoration: none;
    }

.catalog-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e9ed;
}

.catalog-table tr:hover td {
    background: #f0f5fa;
}

.catalog-group .catalog-table tbody tr:nth-child(even) {
    background-color: #f7f9fc;
}

.catalog-group .catalog-table tbody tr:hover {
    background-color: #e8f1fa;
}

.catalog-group .catalog-table td {
    padding: 12px 14px;
    line-height: 1.5;
}

/* Ссылка на основной сайт */

.site-navigation {
    margin: 12px 0 22px;
}

    .site-navigation a {
        display: inline-block;
        padding: 9px 16px;
        background: #eef2f6;
        color: #117d8e;
        border: 1px solid #ccd3da;
        border-radius: 5px;
        text-decoration: none;
        font-size: 14px;
    }

        .site-navigation a:hover {
            background: #dce6ef;
        }

/* На компьютере артикул под названием не показываем */
.mobile-article {
    display: none;
}

/* Мобильный каталог */
@media screen and (max-width: 600px) {
    body {
        padding: 8px;
    }

    .catalog-container {
        padding: 12px;
    }

    .search-box {
        box-sizing: border-box;
        width: 100% !important;
        margin-bottom: 10px;
    }

    .catalog-group {
        overflow: hidden;
    }

        .catalog-group .catalog-table {
            width: 100%;
            margin-top: 0;
        }

    .catalog-table,
    .catalog-table tbody {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

        .catalog-table thead,
        .catalog-table .article-column,
        .catalog-table .product-unit {
            display: none;
        }

    .catalog-group .catalog-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 75px 90px;
        grid-template-rows: auto auto;
        column-gap: 8px;
        row-gap: 4px;
        align-content: start;
        align-items: center;
        height: auto;
        min-height: 0;
        padding: 8px 12px;
        margin: 0 0 5px;
        border: 1px solid #dce3eb;
        border-radius: 8px;
        background: #fff;
        box-sizing: border-box;
    }

        .catalog-group .catalog-table tbody tr:nth-child(even) {
            background: #f7f9fc;
        }

        .catalog-group .catalog-table tbody tr:hover {
            background: #e8f1fa;
        }

    .catalog-group .catalog-table tbody td {
        display: block;
        width: auto;
        height: auto;
        min-height: 0;
        padding: 2px 0;
        margin: 0;
        border: 0;
        background: transparent;
        line-height: 1.3;
        box-sizing: border-box;
    }

    /* Не окрашиваем каждую ячейку отдельно при касании */
    .catalog-table tr:hover td {
        background: transparent;
    }

    .catalog-table .product-name {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .catalog-table .mobile-article {
        display: block;
        margin-top: 4px;
        font-size: 12px;
        font-weight: 400;
        color: #64748b;
        overflow-wrap: anywhere;
    }

    .catalog-table .product-price {
        grid-column: 1;
        grid-row: 2;
        font-size: 20px;
        font-weight: 700;
        text-align: left;
    }

    .catalog-table .product-places {
        grid-column: 2;
        grid-row: 2;
    }

        .catalog-table .product-places input {
            width: 70px !important;
            max-width: 100%;
            height: 38px;
            box-sizing: border-box;
            font-size: 18px;
            text-align: center;
        }

    .catalog-table .product-action {
        grid-column: 3;
        grid-row: 2;
        text-align: center;
    }

        .catalog-table .product-action a {
            white-space: nowrap;
        }

    .catalog-table td[data-label]::before {
        display: none;
    }
}

/* Keep the existing table typography while exposing crawlable links. */
.catalog-seo-link { color: inherit; text-decoration: none; }
.catalog-seo-link:hover, .catalog-seo-link:focus-visible { text-decoration: underline; }
