/* Seller slice styles (login, onboarding, my-stall dashboard, product editor, admin). Reuse the tokens from style.css. */

/* ---- shared ------------------------------------------------------------------------------------------- */
.seller-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.seller-optional{display:inline-block;font-size:11px;font-weight:400;color:var(--muted);background:var(--pale);border-radius:10px;padding:1px 7px;margin-left:4px;vertical-align:1px}
.seller-link-button,.seller-inline-link{color:var(--green);text-decoration:underline;text-underline-offset:3px;padding:0;font:inherit}
.seller-link-button:hover,.seller-inline-link:hover{color:var(--deep)}
.seller-actions-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.seller-subtitle{font-size:15px;font-weight:600;margin:22px 0 10px}
.seller-pill-muted{background:#eeeeea;color:#5f655b}
.seller-soldout{color:var(--orange);font-weight:600}
.seller-count{display:inline-block;font:13px 'Noto Sans TC',sans-serif;color:var(--muted);letter-spacing:0;margin-left:12px;font-weight:400}
.form-field [aria-invalid="true"]{border-color:var(--orange);background:#fffaf6}
.seller-field-error{color:#a3441f!important;font-weight:500}
.seller-form-status{padding:12px 15px;border-radius:8px;background:#f9efdf;color:#825429;font-size:13px;line-height:1.7;margin-bottom:18px}
.seller-form-status[hidden]{display:none}
.seller-error,.seller-403,.seller-signed-in,.seller-nofarm{max-width:640px}
.seller-error h2,.seller-403 h2{display:flex;align-items:center;gap:10px;font-size:21px;margin:0 0 10px}
.seller-403>svg{width:36px;height:36px;color:var(--leaf);margin-bottom:12px}
.seller-signed-in h2{display:flex;align-items:center;gap:10px}

/* ---- tabs (auth + dashboard) -------------------------------------------------------------------------- */
.seller-tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:22px;overflow-x:auto;scrollbar-width:none}
.seller-tabs::-webkit-scrollbar{display:none}
.seller-tab{display:inline-flex;align-items:center;gap:8px;padding:12px 16px;font-size:14px;color:var(--muted);border-bottom:3px solid transparent;margin-bottom:-1px;white-space:nowrap;border-radius:6px 6px 0 0;transition:color .2s,background .2s}
.seller-tab svg{width:17px;height:17px}
.seller-tab:hover{color:var(--green);background:var(--pale)}
.seller-tab[aria-selected="true"]{color:var(--green);border-bottom-color:var(--green);font-weight:600}
.seller-tab:focus-visible{outline-offset:-3px}
/* Orders waiting to be shipped: a count on the 訂單 tab (its accessible name says 筆待出貨). */
.seller-tab-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;font-size:11px;font-weight:700;line-height:1;background:var(--orange);color:#fff}
.seller-tabpanel:focus{outline:none}

/* ---- login -------------------------------------------------------------------------------------------- */
.seller-auth-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:32px;max-width:1000px;margin:0 auto;align-items:start}
.seller-auth-panel{padding:28px 30px}
.seller-auth-aside{display:flex;flex-direction:column;gap:16px}
.seller-auth-form .btn.full{margin-top:4px}
.seller-auth-switch{text-align:center;margin-top:16px}
.seller-password{position:relative}
.seller-password input{width:100%;padding-right:86px}
.seller-password-toggle{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--green);padding:7px 10px;border-radius:6px}
.seller-password-toggle:hover{background:var(--pale)}
.seller-password-toggle svg{width:16px;height:16px}
.seller-tip-card{display:flex;gap:14px;align-items:flex-start;border:1px solid var(--line);border-radius:12px;background:var(--white);padding:20px 20px 18px}
.seller-tip-card>svg{width:26px;height:26px;color:var(--leaf);margin-top:2px}
.seller-tip-card strong{display:block;font-family:'Noto Serif TC',serif;font-size:16px;letter-spacing:.5px;margin-bottom:6px}
.seller-tip-card p,.seller-tip-card li{font-size:13px;line-height:1.85;color:var(--muted)}
.seller-tip-card ul{margin:0;padding-left:18px}

/* ---- onboarding --------------------------------------------------------------------------------------- */
.seller-stepper{list-style:none}
.seller-demo-product{margin:-10px 0 18px}
.seller-label-row{flex-wrap:wrap;gap:6px 15px}
.seller-preview-status{margin-left:auto;font-size:10px;color:var(--muted);white-space:nowrap}
.seller-success-icon{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;background:var(--green);color:var(--white);margin-bottom:16px}
.seller-success-icon svg{width:28px;height:28px}
.seller-success h2{line-height:1.6;margin-bottom:12px}
.seller-success .notice{margin-top:4px}

/* credentials */
.seller-creds{border:1px solid var(--line);border-radius:10px;padding:16px 18px 6px;margin:4px 0 22px;min-width:0}
.seller-creds legend{font-size:14px;font-weight:500;padding:0 6px}
.seller-creds>p{margin-bottom:14px}
.seller-creds>.btn{margin-bottom:14px}
.seller-cred-row{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.3fr) auto;gap:0 12px;align-items:end;border-bottom:1px dashed var(--line);margin-bottom:14px}
.seller-cred-row .form-field{margin-bottom:14px}
.seller-cred-remove{margin-bottom:17px;color:var(--muted)}
.seller-cred-remove:hover{color:var(--orange)}

/* photo upload */
.seller-photo{margin-bottom:22px}
.seller-photo .upload-zone{margin-bottom:10px}
.seller-photo-status:empty{display:none}
.seller-photo-status .notice{margin-top:4px}
.seller-upload-progress{height:6px;border-radius:3px;background:var(--pale);overflow:hidden;margin:6px 0 8px}
.seller-upload-progress span{display:block;width:40%;height:100%;border-radius:3px;background:var(--leaf);animation:seller-progress 1.2s ease-in-out infinite}
@keyframes seller-progress{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
.seller-upload-ok{display:flex;gap:9px;align-items:flex-start;font-size:13px;line-height:1.7;color:var(--green)}
.seller-upload-ok svg{width:18px;height:18px;margin-top:3px}
.seller-upload-ok strong{margin-right:8px}
.seller-photo-actions:empty{display:none}
.seller-photo-remove{margin-top:10px;color:var(--muted)}
.seller-photo-remove:hover{color:var(--orange)}

/* price hint */
.seller-hint-slot{margin:-6px 0 20px}
.seller-hint-slot:empty{margin:0}
.seller-hint{border:1px solid #dfe6d3;background:#f6f8f1;border-radius:10px;padding:15px 18px}
.seller-hint-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.seller-hint-title{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:600;color:var(--green)}
.seller-hint-title svg{width:18px;height:18px}
.seller-hint-main{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;margin:10px 0 4px}
.seller-hint-main strong{font:600 28px Arial,sans-serif;color:var(--deep);letter-spacing:.3px}
.seller-hint-main span{font-size:13px;color:var(--ink)}
.seller-hint-main small{font-size:12px;color:var(--muted)}
.seller-hint-meta{font-size:12px;color:var(--muted);line-height:1.7}
.seller-hint-convert{display:inline-block;margin-top:8px;font-size:12px;color:var(--green);background:var(--white);border:1px solid #dfe6d3;border-radius:6px;padding:4px 9px}
.seller-hint-note{font-size:11.5px;line-height:1.75;color:var(--muted);margin-top:8px}
.seller-hint-unavailable .seller-hint-meta{margin-top:10px}
.seller-hint-retry{margin-top:12px}
.seller-hint-loading{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
.seller-spinner{width:14px;height:14px;border-radius:50%;border:2px solid #d9e0cf;border-top-color:var(--green);animation:seller-spin .8s linear infinite;flex:none}
@keyframes seller-spin{to{transform:rotate(360deg)}}

/* evidence records */
.seller-records{list-style:none;padding:0;margin:18px 0;display:grid;gap:12px}
.seller-record{border:1px solid var(--line);border-radius:10px;padding:14px 16px;background:#fbfbf8;min-width:0}
.seller-record-head{display:flex;align-items:center;gap:9px}
.seller-record-head strong{font-size:14px;font-weight:600}
.seller-record-head .pill{margin-left:auto;white-space:nowrap}
.seller-record-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--pale);color:var(--green);flex:none}
.seller-record-icon svg{width:16px;height:16px}
.seller-record-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;margin:12px 0 8px}
.seller-record-meta dt{font-size:11px;color:var(--muted)}
.seller-record-meta dd{margin:2px 0 0;font-size:13px;overflow-wrap:anywhere}
.seller-record-meta code{font:12px monospace}
.seller-record .text-link{margin-top:6px}
.seller-records.compact .seller-record{padding:12px 14px}
.seller-records.compact .seller-record-meta{margin:10px 0 4px}

/* ---- dashboard ---------------------------------------------------------------------------------------- */
.seller-flash{display:flex;gap:14px;align-items:flex-start;margin-bottom:20px;border-color:#cfdcc6;background:#f4f8ef;padding:18px 20px}
.seller-flash>svg{width:24px;height:24px;color:var(--green);margin-top:2px}
.seller-flash strong{display:block;font-size:15px;margin-bottom:4px}
.seller-flash>div{min-width:0;flex:1}
.seller-flash .seller-records{margin:10px 0 0}
.seller-stall-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) auto;gap:24px;align-items:center;border:1px solid var(--line);background:var(--white);border-radius:13px;padding:22px 24px;margin-bottom:16px}
.seller-stall-id{display:flex;gap:14px;align-items:center;min-width:0}
.seller-stall-id h2{font-size:24px;letter-spacing:1px;overflow-wrap:anywhere}
.seller-stall-id p{display:flex;align-items:center;gap:5px;font-size:13px;color:var(--muted);margin-top:5px}
.seller-stall-id p svg{width:15px;height:15px}
.seller-verify-box{border-left:1px solid var(--line);padding-left:22px;min-width:0}
.seller-verify-line{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.seller-verify-box p{color:var(--ink)}
.seller-verify-box p.muted{color:var(--muted)}
.seller-stall-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;max-width:260px}
.seller-fraud-note{margin-bottom:26px}
.seller-fraud-note strong{font-weight:600}
.seller-dash-tabs{margin-bottom:26px}

/* products */
.seller-product-list{list-style:none;padding:0;margin:0;border:1px solid var(--line);border-radius:12px;background:var(--white);overflow:hidden}
.seller-product-row{display:grid;grid-template-columns:88px minmax(0,1fr) auto;gap:18px;align-items:center;padding:16px 18px;border-bottom:1px solid var(--line)}
.seller-product-row:last-child{border-bottom:0}
.seller-thumb{width:88px;height:88px;border-radius:9px;object-fit:cover;background:var(--pale)}
.seller-product-main h3{font-size:16px;font-weight:500;margin-bottom:4px;overflow-wrap:anywhere}
.seller-product-main h3 a:hover{text-decoration:underline;text-underline-offset:3px}
.seller-pills{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.seller-product-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;align-items:center}
.seller-product-actions .btn.tertiary{padding:8px 6px}

/* orders */
.seller-order-list{display:grid;gap:16px}
.seller-order{border:1px solid var(--line);background:var(--white);border-radius:12px;padding:20px 22px;min-width:0}
.seller-order-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.seller-order-head h3{font-size:16px;font-weight:600;letter-spacing:.4px;overflow-wrap:anywhere}
.seller-order-head .pill{white-space:nowrap}
.seller-order-items{list-style:none;padding:0;margin:14px 0 8px;border-top:1px solid var(--line)}
.seller-order-items li{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:14px;align-items:baseline;padding:10px 0;border-bottom:1px dashed var(--line);font-size:14px}
.seller-order-items li>span:first-child{overflow-wrap:anywhere}
.seller-order-items small{margin-left:6px;font-size:12px}
.seller-order-sum{font-size:12px;color:var(--muted);text-align:right}
.seller-order-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}
.seller-order-grid>section{background:#f7f8f3;border-radius:9px;padding:14px 16px;min-width:0}
.seller-order-grid h4{display:flex;align-items:center;gap:6px;font-size:13px;margin:0 0 8px}
.seller-order-grid h4 svg{width:16px;height:16px}
.seller-order-dl{margin:0}
.seller-order-dl>div{display:flex;gap:10px;font-size:13px;line-height:1.7;padding:2px 0}
.seller-order-dl dt{color:var(--muted);flex:none;width:4.5em}
.seller-order-dl dd{margin:0;min-width:0;overflow-wrap:anywhere}

/* stats (records tab + admin) */
.seller-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-bottom:22px}
.seller-stats>div{border:1px solid var(--line);background:var(--white);border-radius:10px;padding:16px 18px;min-width:0}
.seller-stats span{font-size:12px;color:var(--muted)}
.seller-stats strong{display:block;font:500 30px Arial,sans-serif;margin-top:8px}
.seller-stats strong small{font:12px 'Noto Sans TC',sans-serif;margin-left:5px}
.seller-stats .seller-stat-date{font:500 15px 'Noto Sans TC',sans-serif;margin-top:14px}

/* ---- product editor ----------------------------------------------------------------------------------- */
.seller-editor-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;max-width:1040px;margin:0 auto 20px}
.seller-editor-title{font-size:30px;letter-spacing:1.5px;margin-top:6px}
.seller-editor-title:focus{outline:none}
.seller-editor-layout{margin-bottom:0}
.page-content>.seller-flash,.page-content>.notice.mb20{max-width:1040px;margin-left:auto;margin-right:auto}
.seller-editor-actions{flex-wrap:wrap}
.seller-editor-actions .seller-actions-row{margin-left:auto;justify-content:flex-end}
.seller-editor-layout aside>.text-link{display:inline-flex}
.seller-history{max-width:1040px;margin-left:auto;margin-right:auto}
#seller-step-title:focus{outline:none}

/* ---- admin -------------------------------------------------------------------------------------------- */
.seller-admin-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.seller-admin-card{display:flex;flex-direction:column;border:1px solid var(--line);background:var(--white);border-radius:13px;padding:22px 24px;min-width:0}
.seller-admin-card.is-pending{border-color:#e3c49f;box-shadow:inset 4px 0 0 #cc8248}
.seller-admin-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.seller-admin-head h2{font-size:20px;overflow-wrap:anywhere}
.seller-admin-head .pill{white-space:nowrap}
.seller-admin-meta{margin-top:8px}
.seller-admin-meta>div{padding:10px 0;font-size:13px}
.seller-table-wrap{overflow-x:auto}
.seller-admin-creds{width:100%;border-collapse:collapse;font-size:13px}
.seller-admin-creds th{text-align:left;font-weight:500;font-size:12px;color:var(--muted);padding:8px 6px;border-bottom:1px solid var(--line)}
.seller-admin-creds td{padding:9px 6px;border-bottom:1px dashed var(--line);vertical-align:middle}
.seller-admin-creds code{font:12px monospace;word-break:break-all}
.seller-admin-note{background:#f7f8f3;border-radius:7px;padding:10px 12px;margin-top:12px}
.seller-admin-actions{margin-top:auto;padding-top:18px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}

/* The buyer's-eye preview follows the form on wide screens. */
@media(min-width:621px){.onboard-layout>aside{position:sticky;top:20px;align-self:start}}

/* ---- responsive --------------------------------------------------------------------------------------- */
@media(max-width:1120px){
  .seller-stall-head{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr)}
  .seller-stall-actions{grid-column:1/-1;justify-content:flex-start;max-width:none}
}
@media(max-width:900px){
  .seller-auth-layout{grid-template-columns:1fr}
  .seller-admin-list{grid-template-columns:1fr}
  .seller-product-row{grid-template-columns:72px minmax(0,1fr)}
  .seller-thumb{width:72px;height:72px}
  .seller-product-actions{grid-column:1/-1;justify-content:flex-start}
}
@media(max-width:620px){
  .seller-auth-panel{padding:20px}
  .seller-tab{padding:11px 12px;font-size:13px}
  .seller-dash-tabs .seller-tab svg{display:none}
  .seller-stall-head{grid-template-columns:1fr;padding:18px;gap:16px}
  .seller-verify-box{border-left:0;padding-left:0;border-top:1px solid var(--line);padding-top:14px}
  .seller-stall-id h2{font-size:21px}
  .seller-cred-row{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"type rm" "no no"}
  .seller-cred-row .form-field:first-child{grid-area:type}
  .seller-cred-row .form-field:nth-child(2){grid-area:no}
  .seller-cred-remove{grid-area:rm}
  .seller-creds{padding:14px 14px 4px}
  .seller-hint{padding:13px 14px}
  .seller-hint-main strong{font-size:24px}
  .seller-record-meta{grid-template-columns:1fr}
  .seller-product-row{padding:14px;gap:12px 14px;grid-template-columns:64px minmax(0,1fr)}
  .seller-thumb{width:64px;height:64px}
  .seller-order{padding:16px}
  .seller-order-grid{grid-template-columns:1fr}
  .seller-order-items li{grid-template-columns:minmax(0,1fr) auto}
  .seller-order-items li>strong{grid-column:2}
  .seller-editor-head{flex-wrap:wrap}
  .seller-editor-title{font-size:25px}
  .seller-editor-actions{flex-wrap:wrap}
  .seller-editor-actions .seller-actions-row{width:100%}
  .seller-editor-actions .seller-actions-row .btn{flex:1}
  .seller-admin-card{padding:18px}
  .seller-count{display:block;margin:6px 0 0}
  .seller-flash{padding:15px}
}
@media(prefers-reduced-motion:reduce){
  .seller-upload-progress span{animation:none;width:100%;opacity:.5}
  .seller-spinner{animation:none}
}

/* ---- two-step onboarding ------------------------------------------------------------------------------ */
/* Screen 1 creates the account inside the same form as 稱呼 / 產地 (fieldset look shared with 資格證明). */
.seller-account{margin-top:6px;padding-bottom:4px}
.seller-account>p{margin-bottom:14px}
/* Screen 2 folds the optional fields (數量、標籤、介紹) away so photo + name + price is all a first listing asks. */
.seller-more{margin:0 0 20px;border-top:1px dashed var(--line);padding-top:12px}
.seller-more summary{cursor:pointer;font-size:13px;font-weight:500;color:var(--green);padding:4px 0;list-style:none;display:flex;align-items:center;gap:8px}
.seller-more summary::-webkit-details-marker{display:none}
.seller-more summary::before{content:'';width:8px;height:8px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);transition:transform .2s;flex:none}
.seller-more[open] summary::before{transform:rotate(45deg)}
.seller-more[open] summary{margin-bottom:14px}
.seller-more summary:focus-visible{outline:3px solid #bc6c36;outline-offset:2px;border-radius:4px}
