/* Страница общего прайса. */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    color: var(--color-text-deep);
    background: var(--color-price-background);
}

.price-page {
    width: 100%;
    max-width: 1280px;

    margin: 0 auto;
    padding: 48px 32px 64px;
}

.price-header {
    margin-bottom: 32px;
}

.price-title {
    margin: 0;

    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;

    letter-spacing: -0.5px;

    color: var(--color-text-strong);
}

.price-subtitle {
    margin: 8px 0 0;

    font-size: 16px;
    line-height: 1.5;

    color: var(--color-text-soft);
}

/* Поиск и счётчик товаров. */

.price-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 20px;
}

.price-filters {
    display: flex;
    flex: 1 1 650px;
    gap: 12px;
}

.price-search {
    width: 100%;
    max-width: 520px;

    height: 48px;

    padding: 0 18px;

    font-family: inherit;
    font-size: 15px;

    color: var(--color-text-strong);
    background: var(--color-surface);

    border: 1px solid var(--price-field-border);
    border-radius: 10px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.price-search::placeholder {
    color: var(--price-placeholder-text);
}

.price-search:hover {
    border-color: var(--price-field-hover-border);
}

.price-search:focus {
    border-color: var(--price-field-focus-border);

    box-shadow:
        0 0 0 3px var(--price-field-focus-ring);
}

/* Стандартный крестик поля поиска скрыт для одинакового вида в браузерах. */

.price-search::-webkit-search-cancel-button {
    cursor: pointer;
}

.price-category-filter {
    min-width: 220px;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    color: var(--color-text-strong);
    background: var(--color-surface);
    border: 1px solid var(--price-field-border);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.price-category-filter:focus {
    border-color: var(--price-field-focus-border);
    box-shadow: 0 0 0 3px var(--price-field-focus-ring);
}

.price-count {
    flex-shrink: 0;

    font-size: 14px;
    font-weight: 500;

    color: var(--color-text-soft);
}

/* Таблица прайса. */

.price-table-container {
    overflow: hidden;
    border: 1px solid var(--price-table-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px var(--price-table-shadow-soft), 0 4px 12px var(--price-table-shadow);
}

.price-table {
    border-spacing: 0;
}

.price-table th {
    padding: 15px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--price-muted-text);
    border-bottom: 1px solid var(--price-table-border);
}

.price-table td {
    padding: 17px 20px;

    font-size: 15px;
    line-height: 1.4;

    color: var(--price-heading-text);

    border-bottom: 1px solid var(--price-row-border);
}

.price-table td:first-child {
    width: 190px;

    font-size: 14px;
    font-weight: 500;

    color: var(--price-muted-text);

    white-space: nowrap;
}

.price-table td:nth-child(3) {
    font-weight: 500;

    color: var(--color-text-deep);
}

.price-table th:last-child,
.price-table td:last-child {
    width: 220px;

    text-align: right;
}

.price-table td:last-child {
    font-size: 16px;
    font-weight: 600;

    color: var(--color-text-strong);

    white-space: nowrap;
}

.price-empty {
    padding: 64px 24px;

    font-size: 15px;

    text-align: center;

    color: var(--price-muted-text);
}

@media (max-width: 768px) {

    .price-page {
        padding:
            32px 20px
            48px;
    }

    .price-title {
        font-size: 30px;
    }

    .price-controls {
        flex-direction: column;
        align-items: stretch;

        gap: 12px;
    }

    .price-search {
        max-width: none;
    }

    .price-filters {
        flex: 0 0 auto;
        flex-direction: column;
    }

    .price-category-filter {
        width: 100%;
    }

    .price-count {
        text-align: right;
    }

    .price-table th,
    .price-table td {
        padding:
            14px 16px;
    }
    .price-actions {
        width: 100%;

        justify-content: space-between;
    }

}

/* На телефоне строки таблицы показаны карточками. */

@media (max-width: 600px) {

    body {
        background: var(--color-surface);
    }

    .price-page {
        padding:
            24px 16px
            40px;
    }

    .price-header {
        margin-bottom: 24px;
    }

    .price-title {
        font-size: 27px;
    }

    .price-subtitle {
        font-size: 14px;
    }

    .price-table-container {
        border: none;
        border-radius: 0;

        box-shadow: none;
    }

    .price-table thead {
        display: none;
    }

    .price-table,
    .price-table tbody,
    .price-table tr,
    .price-table td {
        display: block;
        width: 100%;
    }

    .price-table tbody tr {
        position: relative;

        padding: 18px 0;

        border-bottom: 1px solid var(--color-border-subtle);
    }

    .price-table tbody tr:first-child {
        border-top: 1px solid var(--color-border-subtle);
    }

    .price-table tbody tr:hover {
        background: transparent;
    }

    .price-table td {
        padding: 0;

        border: none;
    }

    .price-table td:first-child {
        width: auto;

        margin-bottom: 6px;

        font-size: 12px;
        font-weight: 500;

        color: var(--price-empty-text);
    }

    .price-table td:nth-child(2) {
        margin-bottom: 6px;
        color: var(--price-muted-text);
        font-size: 13px;
    }

    .price-table td:nth-child(2)::before {
        content: "Категория: ";
        font-weight: 500;
    }

    .price-table td:nth-child(3) {
        padding-right: 10px;

        font-size: 15px;
        line-height: 1.45;
    }

    .price-table td:last-child {
        width: auto;

        margin-top: 10px;

        font-size: 17px;

        text-align: left;
    }

}

@media (max-width: 480px) {

    .price-actions {
        flex-direction: column;
        align-items: stretch;

        gap: 10px;
    }

    .price-count {
        text-align: left;
    }

    .price-download {
        width: 100%;
    }

}
/* Дата актуальности прайса. */

.price-updated {
    display: inline-block;

    margin: 14px 0 0;
    padding: 6px 10px;

    font-size: 13px;
    font-weight: 500;

    color: var(--price-filter-text);
    background: var(--price-filter-surface);

    border-radius: 6px;
}

/* Счётчик товаров и скачивание PDF. */

.price-actions {
    display: flex;
    align-items: center;

    gap: 18px;

    flex-shrink: 0;
}

.price-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 44px;

    padding: 0 18px;

    font-size: 14px;
    font-weight: 600;

    line-height: 1;

    color: var(--color-text-white);
    background: var(--price-export-surface);

    border: 1px solid var(--price-export-surface);
    border-radius: 9px;

    text-decoration: none;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        transform 0.1s ease;
}

.price-download:hover {
    background: var(--price-export-hover-surface);
    border-color: var(--price-export-hover-surface);
}

.price-download:active {
    transform: translateY(1px);
}
