/* Page layout for the search page. Components and colors come from the kit (kit/) and the prototype cards (cards.css);
   this file only places them. Base rules as in the prototype (index.html). */
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.9 Vazirmatn,Tahoma,sans-serif}
button,input,textarea,select{font:inherit}
button{cursor:pointer;color:inherit;background:none;border:0}
button:disabled{cursor:default;opacity:.45}
a{color:inherit;text-decoration:none}
button:focus-visible,a:focus-visible{outline:2px solid var(--ds-focus);outline-offset:2px}
img{display:block}
/* The kit gives buttons a display value, which would beat the hidden attribute */
[hidden]{display:none!important}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.top{background:var(--ds-surface);border-bottom:1px solid var(--ds-surface-line)}
.top-row{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1080px;margin:auto;padding:8px 16px}
/* Embedded in buskool.com (?embed=1): the parent site has its own header, so only the saved button stays. */
.embed .brand{display:none}
.embed .top-row{justify-content:flex-end}
.embed .top{border-bottom:0;background:transparent}
.brand{display:flex;align-items:center;gap:9px;min-width:0;font:var(--ds-title-md)}
.saved-btn{display:inline-flex;align-items:center;gap:6px;flex-shrink:0}
.saved-btn svg{width:16px;height:16px}
.saved-count{min-width:18px;padding:0 5px;border-radius:100px;background:var(--violet);color:var(--ds-on-primary);font-size:11px;line-height:18px;text-align:center}
.page{max-width:1080px;margin:auto;padding:16px 16px 48px}

.search{display:flex;gap:8px;align-items:flex-start}
.search-field{flex:1;min-width:0;margin:0}
.search .ds-button{flex-shrink:0}

.section{margin-top:20px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.section-head h2{margin:0;font:var(--ds-title-small);color:var(--ds-text-strong)}
.section-head small{font:var(--ds-caption);color:var(--muted)}
.view-head{display:flex;align-items:center;gap:8px;margin-top:16px}
.view-head h2{margin:0;font:var(--ds-title-md);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.kind-tabs{margin-top:16px}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.summary{margin-top:14px;font:var(--ds-body-sm);color:var(--ds-text-body)}

/* Supplier cards in one row that scrolls sideways */
.sup-row{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(260px,300px);gap:10px;overflow-x:auto;padding-bottom:6px;scroll-snap-type:x proximity}
.sup-row>.rq{scroll-snap-align:start}
.rq{background:var(--ds-surface);border:1px solid var(--ds-surface-line);border-radius:12px;min-width:0}
.rq-tags .t{display:inline-flex;align-items:center;gap:4px}
.rq-tags .t svg{width:14px;height:14px}

/* More columns on wider screens (the prototype is a phone: two) */
@media(min-width:720px){.pc-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.rq-list.wide{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1000px){.pc-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.rq-list.wide{grid-template-columns:repeat(3,minmax(0,1fr))}}

.pc-img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.skel-card{height:250px;border-radius:12px;margin-bottom:10px}

/* Seller trust on cards: verified mark and rating next to the name; trust tags wrap */
.pc-seller{display:inline-flex;align-items:center;gap:4px;min-width:0}
.pc-seller .rq-ver svg{width:13px;height:13px}
.rate{display:inline-flex;align-items:center;gap:2px;color:var(--ds-text-body)}
.rate svg{width:13px;height:13px;color:var(--ds-warning)}
.rate small{color:var(--muted)}
.rq-tags{flex-wrap:wrap}
/* «فروشنده ویژه» (paying seller): violet, the kit's accent */
.rq-tags .t.special{background:var(--violet-50);color:var(--violet);font-weight:500}
.pc-special{font-size:10px;line-height:1.6;padding:0 6px;border-radius:100px;background:var(--violet-50);color:var(--violet);font-weight:500}

/* Save (favorite) button: the kit's pin icon on a soft icon button, top-left corner of each card; violet when saved */
.pc{position:relative}
.fav{position:absolute;top:6px;left:6px;z-index:3}
.rq .fav{top:10px;left:10px}
.fav[aria-pressed=true]{color:var(--violet)}
.rq.gone{opacity:.7}
.rq.gone .rq-main{display:block;padding:12px 12px 12px 52px}
/* «نردبان» (active paid elevator): violet pill in the photo's bottom corner */
.pc-elev{position:absolute;bottom:7px;right:7px;z-index:2;padding:0 8px;border-radius:100px;background:var(--violet);color:var(--ds-on-primary);font-size:11px;font-weight:500;line-height:1.9}

/* Header actions: saved, then the account (sign-in button, or the avatar with its menu) */
.top-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.account-btn{display:inline-flex;align-items:center;gap:6px}
.account-btn svg{width:16px;height:16px}
.account-me{display:inline-flex;align-items:center;gap:6px;padding:2px 4px 2px 8px;border-radius:100px}
.account-me:hover{background:var(--n-100)}
.account-me>svg{width:14px;height:14px;color:var(--muted)}
.account-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--ds-label-md)}
.account-menu{min-width:240px}
.account-menu__who{display:flex;flex-direction:column;padding:4px 12px 8px;line-height:1.7}
.account-menu__who b{font:var(--ds-label-lg);color:var(--ink)}
.account-menu__who bdi{font:var(--ds-caption);color:var(--muted);text-align:end}
@media(max-width:480px){.account-name{display:none}.saved-btn>span:not(.saved-count){display:none}}

/* Sign-in dialog: the kit's modal, a little wider, laid out as the Buskool sign-in design */
.ds-modal.modal-wide{max-width:380px}
.signin{display:flex;flex-direction:column;gap:12px}
.signin .ds-modal__title{text-align:center}
.signin-hero{display:grid;place-items:center;margin:4px auto 0}
.signin-hero img{width:44px;height:44px}
.signin p.signin-lead{margin:0;text-align:center}
.signin .ds-field{margin:0}
.signin-actions{display:flex;flex-direction:column;gap:4px;margin-top:4px}
.signin-code{align-items:center}
.signin-code .ds-otp{justify-content:center}
.signin-code .ds-help{text-align:center}
.signin-resend{display:flex;justify-content:center;min-height:36px;align-items:center;color:var(--muted)}
.signin-row{display:flex;justify-content:space-between;gap:8px}
.ds-modal__icon.soft{background:var(--violet-50);color:var(--violet)}

/* Daily limit, history and notes */
.limit .ds-button{margin-top:8px}
.history-bar{display:flex;align-items:center;justify-content:space-between;margin-top:16px;color:var(--muted)}
.history-bar .ds-button{display:inline-flex;align-items:center;gap:4px}
.history-bar svg{width:16px;height:16px}
.history{margin-top:8px;background:var(--ds-surface);border:1px solid var(--ds-surface-line);border-radius:12px;overflow:hidden}
.history-row{padding:4px 8px 4px 4px;gap:4px}
.history-q{display:flex;align-items:center;gap:10px;flex:1;min-width:0;padding:8px;border-radius:8px;text-align:start}
.history-q:hover{background:var(--n-50)}
.history-icon{display:grid;place-items:center;flex:0 0 32px;height:32px;border-radius:10px;background:var(--n-100);color:var(--muted)}
.history-icon svg{width:16px;height:16px}
.history-text{display:flex;flex-direction:column;min-width:0;line-height:1.7}
.history-text b{font:var(--ds-label-lg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.history-text small{font:var(--ds-caption);color:var(--muted)}
.history-note{margin:14px 0 0;font:var(--ds-caption);color:var(--muted);text-align:center}
.link{padding:0;color:var(--violet);font:inherit;text-decoration:underline}
.skel-row{display:block;height:56px;border-radius:10px;margin-bottom:8px}
.kind-tabs .ds-badge{margin-inline-start:4px}

/* Toast at the bottom of the screen */
.page-toast{position:fixed;inset-inline:16px;bottom:16px;z-index:50;display:flex;justify-content:center;pointer-events:none}
.page-toast .ds-toast{max-width:420px;pointer-events:auto}

/* The sections page: a section per detected subcategory, a divider, then related products */
.cat-section .section-head h2{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.cat-parent{font:var(--ds-caption);color:var(--muted)}
.section-head .ds-button{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}
.section-head .ds-button svg{width:14px;height:14px}
/* «همه در این دسته»: a soft violet button with the count */
.cat-all{gap:4px!important;color:var(--violet)!important;background:var(--violet-50)!important}
.cat-all b{font-weight:700}
/* «محصولات مرتبط»: a violet band that starts the second part of the page */
.related{margin-top:32px}
.related-head{display:flex;align-items:center;gap:12px;margin-bottom:14px;padding:12px 14px;border-radius:12px;background:var(--violet-50);border-inline-start:4px solid var(--violet)}
.related-icon{display:grid;place-items:center;flex:0 0 36px;height:36px;border-radius:10px;background:var(--violet);color:var(--ds-on-primary)}
.related-icon svg{width:20px;height:20px}
.related-title{display:flex;flex-direction:column;min-width:0;line-height:1.7}
.related-title h2{margin:0;font:var(--ds-title-md);color:var(--violet)}
.related-title small{font:var(--ds-caption);color:var(--ds-text-body)}

/* Buy requests with no match for the words: a quiet note above the first category's requests */
.no-match{display:flex;align-items:center;gap:8px;margin-top:14px;background:var(--n-50);color:var(--ds-text-body)}
.no-match svg{width:18px;height:18px;flex:0 0 18px;color:var(--muted)}
