/*
 * MemberShops common CSS: small rules for MemberShops content that every shop page needs, whatever the
 * "Old libraries" switch says (assets/css/mshops-base.css loads only with the switch off).
 *
 * AI-written note, verify against the code before relying on it.
 * Added: plugin 1.9.8 (4 Nov 2026), task 268 follow-up.
 * Why: the master app's product view prints "View more" under the sales page links as a <button>. The master app's
 * own public/layouts/css/core.css never reaches shop pages, so on shops without their own rule it showed as the
 * browser's grey system button.
 * Watch out:
 * - Keep every selector at one class, so a shop theme or layout CSS (for example the idplr theme's
 *   .idplr-design .plr-pub-html-preview .web-files-list-more) always wins without !important.
 * - Only neutral resets here; colours, sizes and icons are the shop's look and belong in the theme or layout CSS.
 */

/* "View more" under a product's sales page links: a plain text link in the text colour by default */
.web-files-list-more {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/*
 * AI-written note, verify against the code before relying on it.
 * Added: task 383, step 2b, plugin 1.9.15 (22 Nov 2026). The Rewrite and Translate buttons of the Preview popup.
 * MemberShops prints them hidden (the "hidden" attribute and display:none on the element); mshops-preview.js takes
 * both off when the shop offers the rewriter for the product, and these rules then show them in the popup's bar.
 * Colours are the popup's own variables (--pv-*, set by the product layout's CSS), with neutral fallbacks.
 */
.plr-pub-pv-rw-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--pv-line, #e4e4df);
    border-radius: 9px;
    background: none;
    color: var(--pv-ink, inherit);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.plr-pub-pv-rw-button:hover { background: var(--pv-soft, #f6f6f4); }
/*
 * Rewrite is the main action of the two (Goran, 23 Nov 2026: "more visible, in some other color"): filled with the
 * popup's own accent, which the product layout takes from the shop's design (--pv-accent, text --pv-on-accent).
 * Translate keeps the outline. Watch out: no colour of our own beyond the neutral fallbacks. On a shop whose accent
 * is light (the yellow of the test store and demo4: white on it has a contrast of 1.76) mshops-preview.js sets the
 * class plr-pub-pv-rw-ink and the text takes the popup's ink instead.
 */
.plr-pub-pv-rw-button[data-pv-rewriter="rewrite"] {
    border-color: var(--pv-accent, #1c1c1f);
    background: var(--pv-accent, #1c1c1f);
    color: var(--pv-on-accent, #fff);
}
.plr-pub-pv-rw-button[data-pv-rewriter="rewrite"].plr-pub-pv-rw-ink { color: var(--pv-ink, #1c1c1f); }
.plr-pub-pv-rw-button[data-pv-rewriter="rewrite"]:hover { background: var(--pv-accent, #1c1c1f); filter: brightness(0.93); }
.plr-pub-pv-rw-button svg { width: 18px; height: 18px; }
/*
 * On a phone the bar has no room for two more buttons with words, and a pencil and a globe alone say too little:
 * while the buttons are shown they take a row of their own under the file's name. Watch out: the bar and the name
 * are the product layout's (MemberShops), so the first two rules only apply while a button is shown.
 */
@media (max-width: 640px) {
    .plr-pub-pv-bar:has(.plr-pub-pv-rw-button:not([hidden])) { flex-wrap: wrap; }
    /* the name takes the room of the first row (the bar's own spacer would share it half and half) */
    .plr-pub-pv-bar:has(.plr-pub-pv-rw-button:not([hidden])) .plr-pub-pv-name { flex: 100 1 0; }
    .plr-pub-pv-rw-button { order: 9; flex: 1 1 40%; justify-content: center; }
}
