[data-page="for_sale1_view1"][data-itemid="page_image_ash8f23hr"] {
  width: 400px;
}


/* Бети Консулт — отворена оферта, Продажби */
[data-page="for_sale1_view1"] {
    --sale-paper: var(--theme-surface, #c5a86d);
    --sale-ink: #35271d;
    --sale-muted: #6c5847;
    --sale-gold: var(--theme-gold, #c2a16b);
    --sale-price: #c5a86d;
    --sale-details-bg: #e2cfaf;
    --sale-title-font: Georgia, "Times New Roman", serif;
    --sale-text-font: Arial, Helvetica, sans-serif;
    --sale-title-size: clamp(21px, 2vw, 30px);
    --sale-price-size: clamp(22px, 2.2vw, 30px);
    --sale-text-size: 16px;
    --sale-thumb-width: 200px;
}

/* Заглавен ред */
[data-page="for_sale1_view1"][data-location="above-grid"] > .row:has([data-field="cena"]) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 16px;
    margin: 0;
    padding: 12px 16px;
    background: var(--sale-paper);
    border-bottom: 2px solid var(--sale-gold);
}
[data-page="for_sale1_view1"][data-location="above-grid"] > .row:has([data-field="cena"])::before,
[data-page="for_sale1_view1"][data-location="above-grid"] > .row:has([data-field="cena"])::after { display: none; }

[data-page="for_sale1_view1"][data-location="above-grid"] > .row:has([data-field="cena"]) > [data-cellid] {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px 7px;
    width: auto !important;
    min-width: 0;
    padding: 0;
    font: 400 var(--sale-text-size)/1.35 var(--sale-text-font);
    color: var(--sale-ink);
}
[data-page="for_sale1_view1"][data-location="above-grid"] [data-cellid="above-grid_c2"] { justify-content: center; }
[data-page="for_sale1_view1"][data-location="above-grid"] [data-cellid="above-grid_c"] { justify-content: flex-end; }
[data-page="for_sale1_view1"][data-location="above-grid"] .r-view-label {
    margin: 0;
    font: 400 15px/1.35 var(--sale-text-font) !important;
    color: var(--sale-muted) !important;
}
[data-page="for_sale1_view1"][data-location="above-grid"] .r-view-field > span {
    font: 600 var(--sale-text-size)/1.35 var(--sale-text-font) !important;
    color: var(--sale-ink) !important;
}
[data-page="for_sale1_view1"][data-location="above-grid"] [data-field="vid_imot"] {
    flex-basis: 100%;
    text-align: center;
}
[data-page="for_sale1_view1"][data-location="above-grid"] [data-field="vid_imot"] > span {
    font: 700 var(--sale-title-size)/1.2 var(--sale-title-font) !important;
}
[data-page="for_sale1_view1"][data-location="above-grid"] [data-field="cena"] > span,
[data-page="for_sale1_view1"][data-location="above-grid"] [data-itemid="text"] {
    font: 700 var(--sale-price-size)/1.2 var(--sale-text-font) !important;
    color: var(--sale-price) !important;
}
[data-page="for_sale1_view1"][data-location="above-grid"] .r-view-field:has(> span:empty) { display: none; }

/* Галерия */
table[data-page="for_sale1_view1"][data-location="grid"] {
    width: 100%;
    table-layout: fixed;
}
table[data-page="for_sale1_view1"][data-location="grid"] > tbody > tr > td {
    background: var(--sale-paper) !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
}
table[data-page="for_sale1_view1"][data-location="grid"] [data-cellid="grid_c115"] .r-view-field {
    width: min(100%, 600px) !important;
    max-width: 100%;
    margin-inline: auto !important;
    display: block;
}
table[data-page="for_sale1_view1"][data-location="grid"] .r-images {
    max-width: 100% !important;
}
table[data-page="for_sale1_view1"][data-location="grid"] .r-images img {
    max-width: 100% !important;
    border-radius: 5px;
}
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) > [edit-form-cell] {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, var(--sale-thumb-width)));
    justify-content: center;
    gap: 8px;
}
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) > [edit-form-cell]::before,
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) > [edit-form-cell]::after { display: none; }
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) .r-view-field {
    width: 100% !important;
    min-width: 0;
    margin: 0 !important;
}
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) .r-view-field:has(> span:empty) { display: none; }
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) .r-images,
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) .r-images img { width: 100% !important; }
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) .r-images img {
    height: auto !important;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

/* Характеристики – използват текста от View as Custom */
table[data-page="for_sale1_view1"][data-location="grid"] > tbody > tr > td:is([data-cellid="grid_c123"], [data-cellid="grid_c122"]) {
    background: var(--sale-details-bg) !important;
    border-left: 3px solid var(--sale-gold);
    padding: 7px 12px !important;
}
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c123"], [data-cellid="grid_c122"]) > [edit-form-cell] {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 18px;
    align-items: baseline;
}
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c123"], [data-cellid="grid_c122"]) > [edit-form-cell]::before,
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c123"], [data-cellid="grid_c122"]) > [edit-form-cell]::after,
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c123"], [data-cellid="grid_c122"]) .r-view-field:has(> span:empty),
table[data-page="for_sale1_view1"][data-location="grid"] tr:has(> td:is([data-cellid="grid_c123"], [data-cellid="grid_c122"])):not(:has(.r-view-field > span:not(:empty))) {
    display: none;
}
table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c123"], [data-cellid="grid_c122"]) .r-view-field > span {
    font: 600 15px/1.5 var(--sale-text-font) !important;
    color: var(--sale-ink) !important;
}

/* Описание и бутон */
table[data-page="for_sale1_view1"][data-location="grid"] [data-field="opisanie"] > span {
    display: block;
    max-width: 85ch;
    margin: 10px auto;
    font: 400 var(--sale-text-size)/1.6 var(--sale-text-font) !important;
    color: var(--sale-ink) !important;
    overflow-wrap: anywhere;
}
table[data-page="for_sale1_view1"][data-location="grid"] [data-itemtype="view_back_list"] a.btn {
    background: #503d2e !important;
    color: var(--sale-paper) !important;
    border: 1px solid var(--sale-gold) !important;
    border-radius: 4px !important;
    padding: 7px 14px !important;
    font: 600 15px/1.35 var(--sale-text-font) !important;
}
table[data-page="for_sale1_view1"][data-location="grid"] [data-itemtype="view_back_list"] a.btn:is(:hover, :focus-visible) {
    background: var(--sale-ink) !important;
}

@media (max-width: 600px) {
    [data-page="for_sale1_view1"][data-location="above-grid"] > .row:has([data-field="cena"]) {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 10px;
    }
    [data-page="for_sale1_view1"][data-location="above-grid"] [data-cellid="above-grid_c2"] {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-content: flex-start;
    }
    [data-page="for_sale1_view1"][data-location="above-grid"] [data-field="vid_imot"] { text-align: left; }
    table[data-page="for_sale1_view1"][data-location="grid"] :is([data-cellid="grid_c116"], [data-cellid="grid_c117"], [data-cellid="grid_c118"]) > [edit-form-cell] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
