/* Redesign 2026-10-15, second handover: profile_search. Built from tokens.css; shared components live in ui.css.
   Seller profile (Prodavac, Prodavac--ocjene, ProdavacMobile), search (Pretraga, Pretraga--nema-rezultata,
   PretragaMobile) and the member page of saved searches and followed sellers. */

/* Colours this file mixes from tokens: the pressed outline of "Prati" and
   "Spremi" (green over white), and light text and panels on the navy head. */
:root {
    --ps-pressed-border: color-mix(in srgb, var(--green-600) 30%, var(--surface));
    --ps-on-navy-muted: var(--border-strong);
    --ps-on-navy-panel: color-mix(in srgb, var(--surface) 8%, transparent);
    --ps-on-navy-line: color-mix(in srgb, var(--surface) 14%, transparent);
    --ps-on-navy-edge: color-mix(in srgb, var(--surface) 55%, transparent);
}

/* Words that differ between the desktop and the phone (not shorter, different). */
.ps-phone { display: none; }
@media (max-width: 700px) {
    .ps-desk { display: none !important; }
    .ps-phone { display: inline; }
    p.ps-phone { display: block; }
}

.psflash { margin: var(--space-4) 0 0; }

/* ═══════════════════════════════════════════════════════════════════════
   Seller profile: head card
   ═══════════════════════════════════════════════════════════════════════ */
.pshead { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "top actions" "stats stats"; column-gap: var(--space-6); }
.pshead .sellerhead__top { grid-area: top; }
.pshead .sellerhead__actions { grid-area: actions; align-self: start; display: flex; gap: var(--space-3); padding-top: var(--space-5); }
.pshead .sellerstats { grid-area: stats; }
.pshead .sellerhead__name { font-size: 34px; line-height: 40px; }
.pshead .sellerhead__name .chip { font-size: 13px; }
.pshead .sellerhead__meta { font-size: 15px; color: var(--muted); }

.psfollow { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-5); }
.psfollow svg { flex: none; }
/* `!important` because ui.css sets .btn--secondary's colours with it. */
.psfollow.is-on { background: var(--green-100) !important; border-color: var(--ps-pressed-border) !important; color: var(--green-700) !important; }
.psask { min-height: 48px; padding: 0 var(--space-5); }
.sellerhead__legal { display: none; }

.pshead .sellerstats dd { font-size: 26px; }
.pshead .sellerstats dd small { font-size: 13px; }

/* Tabs: "Aktivni oglasi (22)", "Ocjene (6)", "O prodavatelju"; the current
   one in ink with a navy bar (the rule naming the ids is in eaukcije.css). */
body .sellertabs { gap: var(--space-2); }
body .sellertabs a, body .sellertabs a:visited { padding: 0 var(--space-3); font-size: 16px; color: var(--muted); }
body .sellertabs a:hover { color: var(--ink); }
.sellerpage__tabs:has(#predmeti:target) .sellertabs a[href="#predmeti"],
.sellerpage__tabs:has(#ocjene:target) .sellertabs a[href="#ocjene"],
.sellerpage__tabs:has(#o-prodavatelju:target) .sellertabs a[href="#o-prodavatelju"],
.sellerpage__tabs:not(:has(> .tabpanels > .tabpanel:target)) .sellertabs a:first-child {
    color: var(--ink);
    box-shadow: inset 0 -3px 0 var(--navy-900);
}

/* "Prikaži sve oglase (22)" under the grid. */
.psall { margin: var(--space-6) 0 0; display: flex; justify-content: center; }
.psall__btn { min-height: 48px; padding: 0 var(--space-6); }
.sellerpage__tabs .tabpanel { padding-top: var(--space-2); }

/* Ratings: the lot each rating was about, and the filter's counts. */
body .ratings .fback__lot { margin: var(--space-2) 0 0; font: 500 13px/1.4 var(--font-sans); color: var(--muted); }
/* A standalone link, so a 44 px target; the negative margin keeps the line
   as tall as the design draws it. */
body .ratings .fback__lot a, body .ratings .fback__lot a:visited { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; color: var(--blue-700); font-weight: 700; }
/* "Kupac A**s · 12.10.2026." is one muted line (Prodavac--ocjene). */
body .ratings .fback__who { font-weight: 500; color: var(--muted); }
.ratings__scope { margin: 0 0 var(--space-3); font: 500 13px/1.45 var(--font-sans); color: var(--muted); }

/* The split's bars: a <meter> per tone, coloured by class (no inline width). */
.psmeter {
    -webkit-appearance: none; appearance: none;
    display: block; width: 100%; height: 6px; margin: 0;
    border: 0; border-radius: var(--radius-pill); background: var(--border);
    --ps-meter: var(--muted);
}
.psmeter--pos { --ps-meter: var(--green-600); }
.psmeter--neu { --ps-meter: var(--muted); }
.psmeter--neg { --ps-meter: var(--orange-600); }
.psmeter::-webkit-meter-inner-element { display: block; }
.psmeter::-webkit-meter-bar { height: 6px; border: 0; border-radius: var(--radius-pill); background: var(--border); }
.psmeter::-webkit-meter-optimum-value,
.psmeter::-webkit-meter-suboptimum-value,
.psmeter::-webkit-meter-even-less-good-value { border-radius: var(--radius-pill); background: var(--ps-meter); }
.psmeter::-moz-meter-bar { border-radius: var(--radius-pill); background: var(--ps-meter); }
body .ratings .fback__lot b { color: var(--ink); }
body .ratings .fback__tone { font-size: 12px; }
.ratings__filter .catpill { min-height: 44px; }
.ratings__filter .catpill span { white-space: nowrap; }
.ratings__sub { margin-bottom: var(--space-4); }

/* Phone (ProdavacMobile): the head is navy under the app bar, edge to edge,
   three figures and one button; two tabs on a white bar. */
@media (max-width: 700px) {
    .psflash { margin-top: var(--space-3); }
    .pshead {
        grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "stats" "actions";
        margin: 0 calc(-1 * var(--space-4)); padding: var(--space-2) var(--space-4) var(--space-5);
        border: 0; border-radius: 0; background: var(--navy-900); color: var(--surface);
    }
    main > .pshead:first-child, .breadcrumbs + .pshead, .psflash + .pshead { margin-top: 0; }
    .pshead .sellerhead__top { gap: var(--space-4); }
    .pshead .avatar--xl { width: 60px; height: 60px; font-size: 20px; background: var(--ps-on-navy-panel); color: var(--peach-200); }
    .pshead .sellerhead__name { font-size: 24px; line-height: 30px; color: var(--surface); }
    .pshead .sellerhead__meta { margin-top: 2px; font-size: 14px; color: var(--ps-on-navy-muted); }
    /* The business name on its own line, and the way to "O prodavatelju". */
    .pshead .sellerhead__legal { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); margin: 0; font: 500 13px/1.35 var(--font-sans); color: var(--ps-on-navy-muted); }
    .pshead .sellerhead__legal a, .pshead .sellerhead__legal a:visited { display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0 -12px; color: var(--surface); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
    .pshead .sellerhead__legal a:focus-visible { outline-color: var(--peach-200); }
    .pshead .sellerstats { margin-top: var(--space-4); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
    .pshead .sellerstats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: var(--space-3); background: var(--ps-on-navy-panel); border: 1px solid var(--ps-on-navy-line); }
    .pshead .sellerstats dt { font: 500 13px/1.3 var(--font-sans); color: var(--ps-on-navy-muted); }
    .pshead .sellerstats dd { margin: 0; font-size: 20px; color: var(--surface); }
    .pshead .sellerstats dd small { color: var(--ps-on-navy-muted); font-size: 13px; }
    .pshead .sellerstats .sellerstats__extra { display: none; }
    /* Two halves (ProdavacMobile): outlined "Prati", white "Postavi pitanje"; no icon. */
    .pshead .sellerhead__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--space-2); padding-top: var(--space-4); }
    .pshead .sellerhead__actions form { display: flex; }
    .pshead .psfollow, .pshead .psask { width: 100%; min-height: 48px; padding: 0 var(--space-3); justify-content: center; font-size: 15px; }
    .pshead .psfollow__icon { display: none; }
    /* `!important` against ui.css's own on .btn--secondary and .btn--dark. */
    .pshead .psfollow { background: transparent !important; border-color: var(--ps-on-navy-edge) !important; color: var(--surface) !important; }
    .pshead .psfollow.is-on { background: var(--ps-on-navy-panel) !important; }
    .pshead .psask { background: var(--surface) !important; color: var(--navy-900) !important; }
    .pshead .psfollow:focus-visible, .pshead .psask:focus-visible { outline-color: var(--peach-200); }

    .sellerpage__tabs { margin: 0 calc(-1 * var(--space-4)); }
    body .sellertabs { gap: 0; margin-bottom: 0; background: var(--surface); }
    body .sellertabs a, body .sellertabs a:visited { flex: 1; justify-content: center; min-height: 52px; font-size: 16px; }
    body .sellertabs .sellertabs__about { display: none; }
    .sellerpage__tabs .tabpanels { padding: var(--space-4) var(--space-4) 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Search (Pretraga, Pretraga--nema-rezultata, PretragaMobile)
   ═══════════════════════════════════════════════════════════════════════ */
.pssearchhead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.pssearchhead > div { min-width: 0; }
.pssearchhead .searchhead__title { overflow-wrap: anywhere; }
.searchsave { flex: none; margin: 0; }
.searchsave__btn { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-5); white-space: nowrap; }
.searchsave__btn svg { flex: none; }
.searchsave__btn.is-on { background: var(--green-100) !important; border-color: var(--ps-pressed-border) !important; color: var(--green-700) !important; }
.searchsave__btn[disabled] { opacity: .55; cursor: not-allowed; }

.searchtoast { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-5); }
.searchtoast svg { flex: none; }
.searchtoast .pstatus__title { flex: 1 1 260px; font-weight: 600; font-size: 14px; }
.searchtoast__link, .searchtoast__link:visited { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue-700); font: 700 14px/1 var(--font-sans); }

body .searchcats .catpill { min-height: 44px; }
.searchfilters > summary { min-height: 44px; }
.searchcats .catpill__n { color: var(--muted); font-weight: 600; }

/* Nothing found: the tips beside the invitation to save the search. */
.searchnone { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-6); align-items: stretch; }
.searchnone .searchempty { padding: var(--space-6) var(--space-6) var(--space-8); }
.searchnone .searchempty__title { font-size: 20px; }
.searchnone .searchempty__title a { color: var(--blue-700); text-decoration: underline; text-underline-offset: 3px; }
.searchnone .searchempty p { margin: 0 0 var(--space-3); }
.searchnone .searchempty li { margin-bottom: var(--space-1); }
.searchpromo { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--navy-900); color: var(--surface); }
.searchpromo > svg { color: var(--peach-200); }
.searchpromo__title { margin: 0; font: 800 20px/1.35 var(--font-sans); color: var(--surface); }
.searchpromo__body { margin: 0; font: 500 15px/1.6 var(--font-sans); color: var(--ps-on-navy-muted); }
.searchpromo form { margin: var(--space-2) 0 0; }
.searchpromo .btn:focus-visible { outline-color: var(--peach-200); }
/* Outlined, not orange: the masthead's "Prodaj predmet" is the screen's one orange action. */
.searchpromo .btn--ghost-navy { margin-top: var(--space-2); min-height: 48px; }
.searchpromo form .btn--ghost-navy { margin-top: 0; }
.searchpopular .rail__title { font-size: 24px; }

/* "Popularno u …": compact cards on the five-column grid, photograph, title
   and price only (Pretraga--nema-rezultata). */
body .searchpopular .railrow.cardgrid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.searchpopular .lotcard__media { aspect-ratio: 4 / 3; }
.searchpopular .lotcard__media .tbadge,
.searchpopular .lotcard__photos,
.searchpopular .lotcard__meta,
.searchpopular .lotcard__pricelabel,
.searchpopular .lotcard__bids { display: none; }
.searchpopular .lotcard__body { gap: var(--space-2); }
.searchpopular .lotcard__title { font-size: 15px; }
.searchpopular .lotcard__amount { font-size: 20px; }

/* The tips' links are 44 px targets; the negative margin keeps the list as
   tight as the design draws it. */
.searchnone .searchempty li a { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; }

@media (max-width: 900px) {
    .searchnone { grid-template-columns: minmax(0, 1fr); }
}

/* Phone (PretragaMobile): the count as the heading with "Spremi" beside it;
   the chosen category filled navy; compact cards without the kicker. */
@media (max-width: 700px) {
    .pssearchhead { align-items: center; }
    .pssearchhead .searchhead__title { font-size: 26px; line-height: 32px; }
    .pssearchhead .searchhead__sub { font-size: 14px; }
    .searchsave__btn { min-height: 44px; padding: 0 var(--space-4); }
    body .searchcats .catpill.is-current { background: var(--blue-100) !important; border-color: var(--blue-700) !important; color: var(--blue-700) !important; }
    body .searchcats .catpill.is-current .catpill__n { background: var(--surface) !important; color: var(--blue-700) !important; }
    .searchgrid .lotcard__kicker { display: none; }
    body .searchpopular .railrow.cardgrid--five { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* One row, as on the category page (MOBILE-FIXES B9): the "Filteri"
       button first, then "Poredano … Promijeni". The filters open as the same
       bottom sheet; the sort list drops under the whole row. */
    .pssearchtools { position: relative; display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
    .pssearchtools .searchfilters { order: -1; flex: none; margin-bottom: 0; }
    .pssearchtools .searchsort { flex: 1; min-width: 0; margin-bottom: 0; }
    .pssearchtools .searchsort summary { gap: var(--space-2); }
    .pssearchtools .searchsort summary > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pssearchtools .searchsort__change { flex: none; }
    .pssearchtools .searchsort ul { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; box-shadow: var(--shadow-lift); }
    .pssearchtools .searchfilters > summary { display: inline-flex; align-items: center; min-height: 44px; }
    .pssearchtools .searchfilters > summary .ps-phone { display: inline-flex; align-items: center; gap: var(--space-2); }
    .pssearchtools .searchfilters[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 59; background: rgba(11,37,64,.45); cursor: default; }
    .pssearchtools .searchfilters__body {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0;
        max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
        padding: var(--space-6) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
        border: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-sheet);
        animation: catsort-in var(--duration-slow) var(--ease-out);
    }
    .searchfilters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
    .searchfilters__head .catfilters__title { margin: 0; }
    .searchfilters__body .facets { padding: 0; border: 0; box-shadow: none; background: none; }
    html.js .searchfilters__head .catfilters__close { display: flex; }
    .searchnone .searchempty { padding: var(--space-5); }
    .searchpromo { padding: var(--space-5); }
}

/* The ratings filter scrolls sideways on a phone, 16 px from both edges. */
@media (max-width: 700px) {
    .ratings__filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--space-4)) var(--space-3); padding: 0 var(--space-4); }
    .ratings__filter > * { flex: 0 0 auto; }
    .ratings__filter::after { content: ""; flex: 0 0 var(--space-1); }
}
body .searchnone .searchempty ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); list-style: disc; }
body .searchnone .searchempty li { list-style: disc; }
@media (max-width: 700px) {
    body .searchcats { margin-bottom: var(--space-2); }
}

/* ═══════════════════════════════════════════════════════════════════════
   Moj račun → Praćeno → Pretrage i prodavatelji
   ═══════════════════════════════════════════════════════════════════════ */
.pilltabs + .psfollowing, .pilltabs + .psflash { margin-top: var(--space-5); }
.psfollowing .accempty .psfollowing__cta { display: inline-flex; align-items: center; min-height: 44px; }
.psfollowing { margin-bottom: var(--space-8); }
.psfollowing__title { margin: 0 0 var(--space-3); font: 800 18px/1.3 var(--font-sans); color: var(--ink); }
.psrows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.psrow { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.psrow__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; background: var(--blue-100); color: var(--blue-700); }
.psrow__avatar { flex: none; width: 44px; height: 44px; }
.psrow__main { flex: 1; min-width: 0; }
.psrow__title { margin: 0; font: 700 15px/1.35 var(--font-sans); color: var(--ink); overflow-wrap: anywhere; }
.psrow__title a, .psrow__title a:visited { color: var(--ink); }
.psrow__meta { margin: 2px 0 0; font: 500 13px/1.45 var(--font-sans); color: var(--muted); }
.psrow__actions { flex: none; display: flex; align-items: center; gap: var(--space-2); }
.psrow__actions .btn { min-height: 44px; }
.psrow__actions .rowconfirm[open] { flex-basis: 100%; }
@media (max-width: 700px) {
    .psrow { flex-wrap: wrap; padding: var(--space-3); gap: var(--space-3); }
    .psrow__actions { flex: 1 1 100%; flex-wrap: wrap; }
    .psrow__actions > .btn { flex: 1; justify-content: center; }
}
