/* The price list: the public page (templates/prices.html) and the console's editor (admin/prices.html) */

/* ---------- Public page ---------- */

.price-page .price-toolbar { margin-bottom: .75rem; }

.price-chips { margin-bottom: 1rem; }
.price-chips .chip:focus:not(:focus-visible) { box-shadow: none; outline: none; }
.price-chips .chip:focus-visible { outline: 2px solid var(--rv-accent-tint-strong); outline-offset: 1px; }
.price-chips .chip[aria-pressed="false"]:not(:hover) { background: var(--rv-card-bg); color: var(--rv-text); }
.price-chips .chip[aria-pressed="true"] { background: var(--rv-accent); border-color: var(--rv-accent); color: #fff; }

/* A phone: the chips in one row that scrolls sideways inside itself, so the table starts on the first screen */
@media (max-width: 575.98px) {
    .price-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
    .price-chips::-webkit-scrollbar { display: none; }
    .price-chips .chip { flex: 0 0 auto; white-space: nowrap; }
}

.price-table { margin-bottom: 0; }
.price-table > thead th { white-space: nowrap; }

.price-table .price-cell {
    width: 1%;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.price-table .price-ask { font-weight: 400; color: var(--rv-text-muted); }

/* A section: its title across the table, the note under it */
.price-table .price-section-row > th {
    padding-top: 1.25rem;
    border-bottom: 2px solid var(--rv-accent);
    background: var(--rv-card-bg);
}
.price-table tbody:first-of-type .price-section-row > th { padding-top: .75rem; }
.price-section-title { display: block; font-size: 1.05rem; font-weight: 700; }
/* «Подробнее об услуге»: the service page of the section (ContentPage), next to its title */
.price-more { display: inline-block; margin-top: .15rem; font-size: .85rem; font-weight: 400; }
.price-note { display: block; margin-top: .15rem; font-size: .85rem; font-weight: 400; color: var(--rv-text-muted); }

.price-empty { margin: 1rem 0 0; color: var(--rv-text-muted); }

.price-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.5rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--rv-radius);
    background: var(--rv-subtle-bg, #f7f8f9);
}
.price-contact-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Editor ---------- */

.price-bulk {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin: 0;
    padding: .6rem .75rem .75rem;
    border: 1px solid var(--rv-border);
    border-radius: var(--rv-radius);
}
.price-bulk legend {
    float: none;
    width: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: 0;
}
.price-bulk .bulk-unit { flex: 0 0 4.25rem; }
.price-bulk #bulk-apply { align-self: flex-start; }

.price-sections { display: flex; flex-direction: column; gap: 1rem; }
.price-sections[data-empty]:empty::before { content: attr(data-empty); color: var(--rv-text-muted); font-size: .9rem; }
.price-filter-empty { margin: 0; color: var(--rv-text-muted); font-size: .9rem; }

.price-section { display: flex; flex-direction: column; gap: .35rem; }
.price-section[hidden] { display: none; }
.price-section-head {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding-bottom: .35rem;
    border-bottom: 2px solid var(--rv-accent);
}
.price-section-head .price-section-title { font-weight: 600; }
.price-section .price-section-note { margin-left: 1.4rem; width: calc(100% - 1.4rem); }

.price-items { display: flex; flex-direction: column; gap: .3rem; min-height: 1.5rem; }
.price-items[data-empty]:empty::before { content: attr(data-empty); color: var(--rv-text-muted); font-size: .85rem; margin-left: 1.4rem; }

/* A work: handle | title | «от» | price (the saved one under it when changed) | remove */
.price-item {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto 6.5rem auto;
    align-items: start;
    gap: .4rem;
    padding: .15rem 0 .15rem .25rem;
    border-left: 3px solid transparent;
    border-radius: .25rem;
}
.price-item[hidden] { display: none; }
.price-item.changed { border-left-color: var(--rv-accent); background: var(--rv-accent-tint); }
.price-item .price-item-price { text-align: right; font-variant-numeric: tabular-nums; }
.price-item .price-item-title { resize: none; overflow: hidden; line-height: 1.35; }

.price-from {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin: 0;
    min-height: calc(1.5em + .75rem + 2px);
    font-size: .85rem;
    color: var(--rv-text-muted);
    white-space: nowrap;
    cursor: pointer;
}
.price-from:has(input:disabled) { opacity: .45; cursor: default; }

.price-was {
    display: block;
    margin-top: .1rem;
    font-size: .72rem;
    line-height: 1.2;
    text-align: right;
    color: var(--rv-text-muted);
    font-variant-numeric: tabular-nums;
}
.price-was:empty { display: none; }

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: calc(1.5em + .75rem + 2px);
    color: var(--rv-text-faint, #9aa0a6);
    cursor: grab;
    touch-action: none;
}
.drag-handle:hover { color: var(--rv-accent-text); }
.sortable-ghost { opacity: .4; }

/* A phone: the title on its own line, «от» and the price under it */
@media (max-width: 575.98px) {
    .price-item {
        grid-template-columns: 1rem minmax(0, 1fr) auto auto;
        grid-template-areas: "handle title title remove" ". from price price";
    }
    .price-item > .drag-handle { grid-area: handle; }
    .price-item > .price-item-title { grid-area: title; }
    .price-item > .price-from { grid-area: from; justify-self: end; }
    .price-item > .price-value { grid-area: price; width: 7rem; }
    .price-item > [data-remove-item] { grid-area: remove; }
}

/* ТО1–ТО3, the first section of the list: what is included under the name */
.price-to-points { display: block; color: var(--rv-text-muted); font-size: .875rem; }
.price-payment { display: block; font-weight: 600; }
