/* ============================================================
   Shop module — public/shop/*.php, admin/shop-*.php, and the
   profile page's random-products widget. No padding/margin/
   max-width on .sp-page itself, same reasoning as Events/Pages/
   Courses: the theme's own .page-content wrapper already
   provides that, so a second constraint here would only shrink
   things below what the rest of the site already allows.
   ============================================================ */

.sp-page {
}

/* Base .page-add-btn — every other module's own CSS file (blog, forum,
   downloads, community, music) defines this same rule; shop.css never had
   it, which is exactly why the icon inside the button wasn't centering
   correctly (only the shared page-head-card override for the flat/subtle
   variant existed, with nothing establishing the button's own internal
   flex-centering for its plus icon). Copied verbatim from blog-v2.css. */
.page-add-btn {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--indigo); text-decoration: none; font-size: .82rem;
    box-shadow: 0 3px 10px -3px rgba(0,0,0,.3);
    transition: background .12s ease, transform .1s ease;
}
.page-add-btn:hover { background: var(--indigo-deep); }
.page-add-btn:active { transform: scale(.94); }

/* The shared .page-head-group rule leaves 1.25rem below itself by default
   (used across every module for consistent section separation) — tightened
   specifically here since the search bar sits immediately after it with no
   need for that much breathing room in this particular layout. */
.sp-page .page-head-group {
    margin-bottom: .6rem;
}

/* ---------- BBCode display + editor (shared with blog/forum/events) -----
   Product descriptions render through the same BBCode::render() blog/
   forum/events posts use, and the create/edit forms use the same shared
   toolbar + contenteditable rich editor — copied verbatim so a product
   listing looks and edits identically to a post anywhere else on the
   site, not like an unstyled, broken version of one. */
.bbcode-quote {
    border-left: 3px solid var(--indigo); background: var(--paper);
    padding: .6rem .9rem; margin: .75rem 0; border-radius: 0 6px 6px 0;
    font-style: italic; color: var(--ink-soft); white-space: normal;
}
.bbcode-quote cite {
    display: block; font-style: normal; font-weight: 700; font-size: .8rem;
    color: var(--indigo); margin-bottom: .3rem;
}
.bbcode-list { margin: .5rem 0; padding-left: 1.4rem; white-space: normal; }
.bbcode-list li { margin-bottom: .3rem; }
.bbcode-img { max-width: 100%; border-radius: 8px; margin: .5rem 0; display: block; }
.bbcode-table-wrap { overflow-x: auto; margin: .75rem 0; border: 1px solid var(--border); border-radius: 8px; }
.bbcode-table { width: 100%; border-collapse: collapse; font-size: .88rem; white-space: normal; }
.bbcode-table td { padding: .5rem .75rem; border: 1px solid var(--border); }
.bbcode-table tr:first-child td { background: var(--paper); font-weight: 700; }
.bbcode-code {
    margin: .75rem 0; padding: 1rem; border-radius: 8px; white-space: pre;
    background: #1e1e2e !important; overflow-x: auto; font-size: .85rem; line-height: 1.6;
}
.bbcode-code code {
    font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace !important;
    background: none !important; white-space: pre !important;
}

.bbcode-help { margin: .5rem 0 1rem; border: 1px solid var(--border); border-radius: 6px; padding: .5rem .75rem; }
.bbcode-help summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--ink-soft); list-style: none; }
.bbcode-help summary::-webkit-details-marker { display: none; }
.bbcode-help[open] summary { margin-bottom: .5rem; }
.bbcode-help-grid { display: grid; gap: .35rem; font-size: .78rem; color: var(--ink-soft); }
.bbcode-help-grid code { background: var(--paper); padding: .1rem .35rem; border-radius: 4px; font-size: .76rem; }

.bbcode-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .15rem;
    padding: .25rem; border: 1px solid var(--border); border-bottom: none;
    border-radius: 6px 6px 0 0; background: var(--paper);
}
.bbcode-toolbar button {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    border: none; background: none; border-radius: 4px; color: var(--ink-soft);
    cursor: pointer; font-size: .74rem; transition: background .12s ease, color .12s ease;
}
.bbcode-toolbar button:hover { background: var(--surface); color: var(--indigo); }
.bbcode-toolbar-sep { width: 1px; height: 15px; background: var(--border); margin: 0 .1rem; }
.bbcode-toolbar-code { display: flex; align-items: center; gap: .15rem; }
.bbcode-lang-select {
    font-size: .68rem; padding: .15rem .25rem; border-radius: 4px; height: 24px;
    border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
}

.bbcode-rich-editor {
    min-height: 220px; max-height: 480px; overflow-y: auto;
    padding: .75rem .9rem; border: 1px solid var(--border); border-radius: 0 0 6px 6px;
    background: var(--surface); font-size: .92rem; line-height: 1.6;
}
.bbcode-rich-editor:focus { outline: 2px solid var(--indigo); outline-offset: -1px; }
.bbcode-rich-editor img { max-width: 100%; border-radius: 8px; margin: .35rem 0; display: block; }
.bbcode-upload-placeholder { color: var(--ink-soft); font-style: italic; }
editor-youtube-embed {
    display: block; padding: .5rem .75rem; margin: .5rem 0; border-radius: 6px;
    background: var(--paper); border: 1px dashed var(--border); color: var(--ink-soft); font-size: .85rem;
    user-select: none;
}

/* On a phone-width screen, the toolbar's dozen-plus icons can't fit in one
   row without shrinking to illegible size — keeps them at full size in a
   single horizontally-swipeable strip instead of wrapping to a second row,
   matching Forum/Blog/Events' identical touch-theme treatment. */
body.touch-theme .bbcode-toolbar {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
body.touch-theme .bbcode-toolbar::-webkit-scrollbar { display: none; }
body.touch-theme .bbcode-toolbar button,
body.touch-theme .bbcode-toolbar-sep,
body.touch-theme .bbcode-toolbar-code { flex-shrink: 0; }


/* ---- Subnav (Browse/My Listings/Orders/Sales) ---- */
.sp-subnav {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius, 5px);
    overflow-x: auto;
    scrollbar-width: none;
}
.sp-subnav::-webkit-scrollbar { display: none; }
.sp-subnav a {
    flex-shrink: 0;
    padding: .45rem .65rem;
    text-decoration: none;
    color: var(--ink-soft);
    font-weight: 600;
    font-size: .76rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.sp-subnav a.is-active { color: var(--indigo); border-bottom-color: var(--indigo); background: var(--indigo-soft, var(--paper)); }
.page-head-group .sp-subnav { margin-bottom: 0; border: none; border-radius: 0; }

/* ---- Search + type filter — one unified bar instead of three separate
   plain elements floating next to each other. ---- */
.sp-search {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .3rem .3rem .3rem .85rem;
    margin: 0 0 .85rem;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.sp-search:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft, rgba(90, 130, 187, .15)); }
.sp-search-icon { color: var(--ink-soft); font-size: .82rem; flex-shrink: 0; margin-right: .55rem; }
.sp-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: none;
    font-size: .86rem;
    padding: .5rem 0;
    color: var(--ink);
}
.sp-search-sep { width: 1px; height: 22px; background: var(--border); margin: 0 .5rem; flex-shrink: 0; }
.sp-search select {
    flex-shrink: 0;
    border: none;
    outline: none;
    background: none;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink-soft);
    max-width: 100px;
    padding: .4rem .2rem;
}
.sp-search-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: var(--indigo);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .8rem;
    transition: background .12s ease;
    margin-left: .4rem;
}
.sp-search-btn:hover { background: var(--indigo-deep, var(--indigo)); }

/* ---- Filter chip — shown only when a category filter is actually active
   (e.g. arriving from the Categories page), replacing what used to be a
   permanent row of category pills on every visit to the browse page. ---- */
.sp-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .4rem .35rem .7rem;
    background: var(--indigo-soft, var(--paper));
    color: var(--indigo);
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: .85rem;
}
.sp-filter-chip a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: inherit;
    opacity: .6;
    font-size: .72rem;
}
.sp-filter-chip a:hover { opacity: 1; background: rgba(255, 255, 255, .5); }

/* ---- Categories page (shop/categories.php) ---- */
.sp-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem;
}
.sp-cat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.sp-cat-card-head {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .8rem .85rem;
    text-decoration: none;
    color: inherit;
    transition: background .12s ease;
}
.sp-cat-card-head:hover { background: var(--paper); }
.sp-cat-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--indigo-soft, var(--paper));
    color: var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.sp-cat-card-info { display: flex; flex-direction: column; gap: .1rem; }
.sp-cat-card-info strong { font-size: .92rem; }
.sp-cat-card-info .muted { font-size: .74rem; }
.sp-cat-card-children {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    background: var(--paper);
}
.sp-cat-card-children a {
    padding: .5rem .85rem .5rem 2.1rem;
    font-size: .82rem;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.sp-cat-card-children a:last-child { border-bottom: none; }
.sp-cat-card-children a:hover { color: var(--indigo); }

/* ---- Product grid + card (browse page) ---- */
.sp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
}
/* Touch theme gets a genuinely smaller, denser grid — not just narrower
   columns via a viewport media query, but an explicit theme-based rule,
   since touch theme can still be viewed on a wider tablet where a plain
   max-width query wouldn't otherwise kick in. */
body.touch-theme .sp-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: .5rem;
}
body.touch-theme .sp-card-body { padding: .4rem .45rem; gap: .1rem; }
body.touch-theme .sp-card-title { font-size: .74rem; }
body.touch-theme .sp-card-price { font-size: .76rem; }
body.touch-theme .sp-card-seller { font-size: .64rem; }
.sp-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.sp-card:hover { border-color: var(--indigo); transform: translateY(-2px); }
.sp-card-image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    font-size: 1.8rem;
}
.sp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1.15);
}
.sp-card-type {
    position: absolute;
    bottom: .35rem;
    left: .35rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
}
.sp-card-type-digital { background: rgba(52, 85, 128, .85); }
.sp-card-type-physical { background: rgba(29, 111, 77, .85); }
.sp-card-badge {
    position: absolute;
    top: .4rem;
    right: .4rem;
    background: #d6455a;
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .2rem .45rem;
    border-radius: 4px;
}
.sp-card-body { padding: .55rem .6rem; display: flex; flex-direction: column; gap: .2rem; }
.sp-card-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.sp-card-price { font-size: .84rem; display: flex; align-items: baseline; gap: .35rem; }
.sp-card-price s { font-size: .72rem; }
.sp-card-seller { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Detail page ---- */
.sp-detail { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.sp-detail-gallery-wrap { position: relative; background: var(--paper); }
.sp-detail-gallery { display: flex; flex-direction: column; }
.sp-detail-main-image { width: 100%; max-height: 340px; object-fit: contain; background: var(--paper); display: block; }
.sp-detail-no-image {
    width: 100%; height: 220px; display: flex; align-items: center; justify-content: center;
    background: var(--paper); color: var(--ink-soft); font-size: 2.5rem;
}
.sp-detail-thumbs { display: flex; gap: .4rem; padding: .5rem; overflow-x: auto; }
.sp-detail-thumbs img {
    width: 50px; height: 50px; object-fit: cover; border-radius: 6px; cursor: pointer;
    border: 2px solid transparent; opacity: .6; flex-shrink: 0;
}
.sp-detail-thumbs img.is-active { border-color: var(--indigo); opacity: 1; }

.sp-detail-menu { position: absolute; top: .6rem; right: .6rem; z-index: 10; }
.sp-detail-menu-btn {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: rgba(0, 0, 0, .45); color: #fff; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background .12s ease;
}
.sp-detail-menu-btn:hover, .sp-detail-menu.is-open .sp-detail-menu-btn { background: rgba(0, 0, 0, .65); }
.sp-detail-menu-dropdown {
    position: absolute; top: calc(100% + 4px); right: 0; z-index: 30;
    min-width: 140px; padding: .35rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 10px 28px -12px rgba(0, 0, 0, .3);
}
.sp-detail-menu-dropdown a, .sp-detail-menu-dropdown button, .sp-detail-menu-dropdown form { display: block; width: 100%; }
.sp-detail-menu-dropdown a, .sp-detail-menu-dropdown button {
    padding: .5rem .6rem; border-radius: 5px; border: none; background: none;
    font-family: inherit; font-size: .84rem; font-weight: 600; text-align: left;
    color: var(--ink); text-decoration: none; cursor: pointer;
}
.sp-detail-menu-dropdown a:hover, .sp-detail-menu-dropdown button:hover { background: var(--paper); }
.sp-detail-menu-danger { color: var(--danger, #d6455a) !important; }
.sp-detail-menu-danger:hover { background: rgba(214, 69, 90, .1) !important; }

.sp-detail-body { padding: .85rem .9rem 1rem; }
.sp-detail-category {
    display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--indigo); text-decoration: none; margin-bottom: .3rem;
}
.sp-detail-body h1 { font-size: 1.15rem; margin: 0 0 .5rem; line-height: 1.3; }
.sp-detail-price { display: flex; align-items: baseline; gap: .55rem; font-size: 1.3rem; margin-bottom: .6rem; }
.sp-detail-price s { font-size: .9rem; color: var(--ink-soft); }
.sp-detail-discount-badge {
    font-size: .68rem; font-weight: 800; background: rgba(214, 69, 90, .12); color: #9c2436;
    padding: .15rem .45rem; border-radius: 4px;
}
.sp-detail-meta-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; font-size: .82rem; }
.sp-type-badge {
    display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700;
    padding: .25rem .55rem; border-radius: 20px;
}
.sp-type-badge-digital { background: rgba(90, 130, 187, .14); color: #345580; }
.sp-type-badge-physical { background: rgba(42, 157, 111, .14); color: #1d6f4d; }

.sp-detail-seller {
    display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink);
    padding: .5rem 0; margin-bottom: .75rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.sp-detail-seller img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.sp-detail-seller strong { color: var(--indigo); }
.sp-detail-own-notice { font-size: .82rem; padding: .6rem; background: var(--paper); border-radius: 6px; text-align: center; }

.sp-detail-reactions { display: flex; gap: .5rem; margin: .75rem 0; }
.sp-react-btn {
    display: flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 20px;
    border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
    font-weight: 600; font-size: .8rem; cursor: pointer;
}
.sp-react-btn.is-active-like { background: rgba(42, 157, 111, .12); border-color: #2a9d6f; color: #1d6f4d; }
.sp-react-btn.is-active-dislike { background: rgba(214, 69, 90, .1); border-color: #d6455a; color: #9c2436; }

.sp-detail-description { font-size: .86rem; line-height: 1.55; margin-top: .5rem; }

/* ---- Specifications (category-specific attribute values) ---- */
.sp-detail-specs {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    margin: .75rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.sp-detail-spec-row {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .75rem;
    font-size: .82rem;
    border-bottom: 1px solid var(--border);
}
.sp-detail-spec-row:last-child { border-bottom: none; }
.sp-detail-spec-row:nth-child(odd) { background: var(--paper); }
.sp-detail-spec-row span:last-child { font-weight: 600; text-align: right; }

/* ---- Forms (create/edit) ---- */
.sp-form { display: flex; flex-direction: column; }
.sp-form-section { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.sp-form-section:first-child { padding-top: 0; }
.sp-form-section:last-of-type { border-bottom: none; padding-bottom: .2rem; }
.sp-form-section-label {
    margin: 0 0 .6rem; font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--indigo);
}
.sp-form label { display: block; margin-top: .65rem; font-weight: 600; font-size: .82rem; }
.sp-form-section > label:first-of-type,
.sp-form-section > .sp-form-row:first-child label,
.sp-form-section > .sp-type-toggle { margin-top: 0; }
.sp-form input[type="text"], .sp-form input[type="number"], .sp-form input[type="tel"],
.sp-form select, .sp-form textarea {
    display: block; width: 100%; margin-top: .3rem; padding: .5rem .6rem; font-size: .86rem;
    font-family: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; transition: border-color .12s ease, box-shadow .12s ease;
}
.sp-form input:focus, .sp-form select:focus, .sp-form textarea:focus {
    outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft, rgba(90, 130, 187, .2));
}
.sp-form textarea[hidden] { display: none; }
.sp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.sp-form-hint { font-size: .74rem; margin: .3rem 0 0; }
.sp-form button[type="submit"] { margin-top: 1.1rem; align-self: flex-start; }

.sp-type-toggle { display: flex; gap: .6rem; margin-top: .4rem; }
.sp-attr-block {
    margin-top: .75rem;
    padding: .75rem 0 0 .85rem;
    border-left: 2px solid var(--border);
}
.sp-attr-block label:first-child { margin-top: 0; }
.sp-type-option {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
    font-size: .84rem; font-weight: 600; color: var(--ink-soft); transition: all .12s ease;
}
.sp-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.sp-type-option:has(input:checked) { border-color: var(--indigo); background: var(--indigo-soft, var(--paper)); color: var(--indigo); }

.sp-edit-photos { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.sp-edit-photo { position: relative; width: 64px; height: 64px; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); }
.sp-edit-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-edit-photo-remove {
    position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
    border: none; background: rgba(0, 0, 0, .6); color: #fff; font-size: .85rem; line-height: 1;
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.sp-edit-photo-remove:hover { background: rgba(220, 38, 38, .85); }

/* ---- Checkout ---- */
.sp-checkout-summary { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; margin-bottom: .75rem; }
.sp-checkout-summary-image {
    flex-shrink: 0; width: 52px; height: 52px; border-radius: 8px; overflow: hidden;
    background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
}
.sp-checkout-summary-image img { width: 100%; height: 100%; object-fit: cover; }
.sp-checkout-summary-info { display: flex; flex-direction: column; gap: .15rem; }
.sp-checkout-totals { margin: .75rem 0; padding: .75rem; background: var(--paper); border-radius: 8px; }
.sp-checkout-totals-row { display: flex; justify-content: space-between; padding: .25rem 0; font-size: .84rem; }
.sp-checkout-totals-total { font-weight: 800; font-size: .95rem; border-top: 1px solid var(--border); margin-top: .25rem; padding-top: .5rem; }

/* ---- My Listings ---- */
.sp-list-rows { display: flex; flex-direction: column; gap: .5rem; }
.sp-list-row {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    text-decoration: none; color: inherit;
}
.sp-list-row:hover { border-color: var(--indigo); }
.sp-list-row-image {
    flex-shrink: 0; width: 42px; height: 42px; border-radius: 7px; overflow: hidden;
    background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
}
.sp-list-row-image img { width: 100%; height: 100%; object-fit: cover; }
.sp-list-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.sp-list-row-body strong { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sp-status-badge {
    flex-shrink: 0; font-size: .66rem; font-weight: 700; padding: .22rem .5rem; border-radius: 20px;
    text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
.sp-status-pending, .sp-order-status-pending { background: rgba(217, 119, 6, .14); color: #b45309; }
.sp-status-approved, .sp-order-status-delivered { background: rgba(42, 157, 111, .14); color: #1d6f4d; }
.sp-status-rejected, .sp-order-status-cancelled { background: rgba(214, 69, 90, .1); color: #9c2436; }
.sp-order-status-processing { background: rgba(90, 130, 187, .14); color: #345580; }
.sp-order-status-shipped { background: rgba(124, 58, 237, .12); color: #6d28d9; }

/* ---- Orders / Sales ---- */
.sp-order-list { display: flex; flex-direction: column; gap: .5rem; }
.sp-order-row {
    display: flex; align-items: center; gap: .65rem; padding: .65rem .75rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.sp-order-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.sp-order-row-info a { font-size: .86rem; text-decoration: none; color: var(--ink); }
.sp-order-row-info .muted { font-size: .74rem; }
.sp-sales-address { display: block; margin-top: .15rem; }
.sp-order-row select { font-size: .78rem; padding: .3rem .4rem; }

/* ---- Admin review queue ---- */
.sp-admin-review-list { display: flex; flex-direction: column; gap: .75rem; }
.sp-admin-review-card {
    display: flex; gap: .85rem; padding: .85rem; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface);
}
.sp-admin-review-image {
    flex-shrink: 0; width: 72px; height: 72px; border-radius: 8px; overflow: hidden;
    background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 1.4rem;
}
.sp-admin-review-image img { width: 100%; height: 100%; object-fit: cover; }
.sp-admin-review-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.sp-admin-review-body strong { font-size: .92rem; }
.sp-admin-review-desc { font-size: .8rem; margin: .2rem 0; }
.sp-admin-review-actions { display: flex; flex-direction: column; gap: .4rem; flex-shrink: 0; justify-content: center; }
.sp-admin-reject-form { display: flex; gap: .35rem; }
.sp-admin-reject-form input { font-size: .78rem; padding: .3rem .5rem; width: 150px; }

/* ---- Profile widget ---- */
.sp-profile-strip { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .2rem; }
.sp-profile-strip-item {
    flex-shrink: 0; width: 90px; text-decoration: none; color: inherit;
    display: flex; flex-direction: column; gap: .25rem;
}
.sp-profile-strip-image {
    width: 90px; height: 90px; border-radius: 8px; overflow: hidden; background: var(--paper);
    display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 1.4rem;
}
.sp-profile-strip-image img { width: 100%; height: 100%; object-fit: cover; }
.sp-profile-strip-title { font-size: .74rem; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sp-profile-strip-price { font-size: .74rem; font-weight: 700; color: var(--indigo); }

@media (max-width: 560px) {
    .sp-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .sp-form-row { grid-template-columns: 1fr; }
    .sp-detail-body h1 { font-size: 1.05rem; }
    .sp-admin-review-card { flex-wrap: wrap; }
    .sp-admin-review-actions { flex-direction: row; width: 100%; }
}
