/*
 * Shonza stylesheet.
 *
 * One file for the whole site. Built as a classifieds marketplace: dense
 * two-column card grid, horizontal rails, a search-led header, and a fixed tab
 * bar on small screens.
 *
 * Breakpoints:
 *   1024px and up   — four card columns
 *   640px  to 1023px — three card columns
 *   below 640px     — two card columns, tab bar, tighter type
 */

:root {
    /* Brand */
    --blue: #1a5fd0;
    --blue-dark: #14509a;
    --blue-soft: #e8f0fd;
    --green: #0f9d58;
    --green-soft: #e7f6ee;
    --red: #d92d20;
    --amber: #f79009;

    /* Neutrals */
    --ink: #101828;
    --ink-2: #344054;
    --muted: #667085;
    --muted-2: #98a2b3;
    --line: #e4e7ec;
    --line-2: #f2f4f7;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --bg: #ffffff;

    /* Shape */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08);
    --shadow-md: 0 4px 10px -2px rgba(16, 24, 40, .1);
    --shadow-lg: 0 12px 28px -6px rgba(16, 24, 40, .16);

    --shell: 1240px;
    --topbar-h: 64px;
    --strip-h: 44px;
    --tabbar-h: 60px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Room for the fixed tab bar on phones. */
    padding-bottom: 0;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.02em; }
button { font-family: inherit; }

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--ink); color: #fff; padding: .7rem 1.1rem;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ================================================== Top bar =============== */

.site-header {
    position: sticky; top: 0; z-index: 40;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar {
    max-width: var(--shell);
    margin: 0 auto;
    height: var(--topbar-h);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.035em;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
    flex: 0 0 auto;
}

/* Search sits in the middle and takes the slack. */
.topbar-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: .5rem;
    height: 40px;
    padding: 0 .9rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.topbar-search:focus-within { border-color: var(--blue); background: #fff; }

.topbar-search .icon-search {
    width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto;
}

.topbar-search input {
    flex: 1 1 auto; min-width: 0;
    border: 0; background: none; font: inherit; font-size: .9rem; color: var(--ink);
}
.topbar-search input:focus { outline: none; }
.topbar-search input::placeholder { color: var(--muted-2); }

.topbar-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; flex: 0 0 auto; }

.icon-btn {
    position: relative;
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border: 0; border-radius: 50%;
    background: none; color: var(--ink-2);
    cursor: pointer; text-decoration: none;
    font-size: 20px;
}
.icon-btn:hover { background: var(--surface-2); }

/* The red dot on the bell. */
.icon-dot {
    position: absolute; top: 8px; right: 9px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--red);
    border: 1.5px solid #fff;
}

.account-menu { position: relative; }

.account-toggle {
    display: grid; place-items: center;
    width: 38px; height: 38px; padding: 0;
    background: none; border: 0; border-radius: 50%; cursor: pointer;
}

.account-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover; background: var(--blue-soft);
}

.account-dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + .5rem);
    min-width: 210px; padding: .4rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 50;
}
.account-menu.is-open .account-dropdown { display: block; }
.account-dropdown a {
    display: block; padding: .55rem .7rem; font-size: .9rem;
    text-decoration: none; color: var(--ink-2); border-radius: var(--radius-sm);
}
.account-dropdown a:hover { background: var(--surface-2); color: var(--ink); }
.account-name {
    display: block; padding: .5rem .7rem; margin-bottom: .3rem;
    font-size: .78rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--line-2);
}

/* ============================================ Category strip ============== */
/* Plain text labels on white, one scrollable row. No pills. */

.category-strip { border-top: 1px solid var(--line-2); background: var(--surface); }

.category-strip-inner {
    max-width: var(--shell);
    margin: 0 auto;
    height: var(--strip-h);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 20px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 20px), transparent 100%);
}
.category-strip-inner::-webkit-scrollbar { display: none; }

.category-link {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: .875rem;
    color: var(--muted);
    text-decoration: none;
    padding: .35rem 0;
    border-bottom: 2px solid transparent;
}
.category-link:hover { color: var(--ink); }
.category-link.is-active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }

/* ================================================== Layout ================ */

.site-main {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
}

.section { margin-bottom: 2rem; }
.section:last-child { margin-bottom: 0; }

.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; margin-bottom: .9rem;
}
.section-title { font-size: 1.3rem; font-weight: 700; margin: 0; }
.section-more { font-size: .9rem; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.section-more:hover { text-decoration: underline; }
.section-count { font-size: .85rem; color: var(--muted); }

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-sub { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.link-button { font-size: .9rem; color: var(--blue); text-decoration: none; font-weight: 600; }

.empty-state {
    color: var(--muted); padding: 2.5rem 1rem; text-align: center;
    background: var(--surface-2); border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
}
.empty-state a { color: var(--blue); }

.flash-list { margin-bottom: 1rem; }
.flash {
    background: #fffaeb; border: 1px solid #fedf89; color: #b54708;
    padding: .7rem 1rem; border-radius: var(--radius);
    margin: 0 0 .5rem; font-size: .9rem;
}
.notice {
    background: #f0f9ff; border: 1px solid #b9e6fe; color: #026aa2;
    padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem;
}

/* ==================================================== Hero ================ */

.hero {
    position: relative;
    overflow: hidden;
    margin: 0 -1rem 1.75rem;
    padding: 2.5rem 1rem 1.5rem;
    /* A photograph under a dark wash, so the type stays readable whatever
       image is configured. Override --hero-image to use a real photo. */
    background-color: #24303f;
    background-image: var(--hero-image, linear-gradient(135deg, #2b3a4d 0%, #1e293b 45%, #16202e 100%));
    background-size: cover;
    background-position: center;
    /* A dark wash over any photo, so the type stays readable whatever image
       is configured. */
    position: relative;
}

.hero-inner { max-width: 560px; margin: 0 auto; text-align: center; color: #fff; }

.hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin: 0 0 .35rem; }
.hero-sub { font-size: clamp(.9rem, 1.6vw, 1.05rem); margin: 0 0 1.5rem; color: rgba(255, 255, 255, .88); }

/* The white search card. */
.hero-search {
    display: grid; gap: .6rem;
    background: #fff; padding: .7rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: left;
}

.hero-field {
    display: flex; align-items: center; gap: .7rem;
    height: 52px; padding: 0 .9rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--muted-2);
}
.hero-field:focus-within { border-color: var(--blue); background: #fff; }

.hero-field input {
    flex: 1 1 auto; min-width: 0;
    border: 0; background: none; font: inherit; font-size: .98rem; color: var(--ink);
}
.hero-field input:focus { outline: none; }
.hero-field input::placeholder { color: var(--muted-2); }

.hero-filter {
    display: grid; place-items: center;
    width: 38px; height: 38px; margin-left: -4px;
    border: 0; border-right: 1px solid var(--line);
    background: none; color: var(--ink-2); cursor: pointer; font-size: 19px;
}

.hero-field--button { width: 100%; cursor: pointer; text-align: left; font: inherit; }
.hero-loc { width: 20px; height: 20px; color: var(--blue); flex: 0 0 auto; }
.hero-loc-text { flex: 1 1 auto; font-size: .98rem; }
.hero-chev { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }

.hero-submit {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    height: 52px; width: 100%;
    background: var(--blue); color: #fff;
    border: 0; border-radius: var(--radius-lg);
    font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
.hero-submit:hover { background: var(--blue-dark); }
.hero-submit svg { width: 20px; height: 20px; }

.hero-dots { display: flex; justify-content: center; gap: .45rem; margin-top: 1.25rem; }
.hero-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .45); }
.hero-dot.is-active { width: 26px; background: #fff; }

/* ==================================================== Cards =============== */

.grid {
    display: grid; gap: .85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .18s, border-color .18s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #d0d5dd; }

.card-media {
    position: relative; display: block;
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
    overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
img.is-placeholder { object-fit: contain; padding: 14%; }

.card-badges { position: absolute; top: .5rem; left: .5rem; display: flex; gap: .3rem; }

.badge {
    display: inline-block; padding: .22rem .5rem;
    border-radius: var(--radius-sm);
    font-size: .72rem; font-weight: 600; color: #fff;
    background: rgba(16, 24, 40, .72);
    backdrop-filter: blur(4px);
}
.badge-featured { background: rgba(16, 24, 40, .72); }
.badge-offer    { background: var(--red); }
.badge-sold     { background: var(--ink); }
.badge-lg       { font-size: .8rem; padding: .3rem .7rem; margin-bottom: .6rem; display: inline-block; }

/* Heart, top right, white circle. */
.card-fav {
    position: absolute; top: .5rem; right: .5rem;
    display: grid; place-items: center;
    width: 32px; height: 32px;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--muted);
    cursor: pointer; font-size: 18px;
    box-shadow: var(--shadow-xs);
    transition: color .15s, transform .12s;
}
.card-fav:hover { transform: scale(1.08); }
.card-fav.is-saved { color: var(--red); }
.card-fav.is-saved svg { fill: currentColor; }

.card-fav--static {
    position: static; width: auto; height: auto;
    display: inline-flex; gap: .45rem; align-items: center;
    padding: .7rem 1rem; border-radius: var(--radius-pill);
    border: 1px solid var(--line); background: var(--surface);
    font-size: .9rem; font-weight: 600; box-shadow: none;
}
.card-fav--static.is-saved { border-color: #fecdca; background: #fef3f2; }
.card-fav--static svg { width: 18px; height: 18px; }

.card-body { padding: .65rem .75rem .8rem; display: flex; flex-direction: column; gap: .2rem; flex: 1 1 auto; }

.card-price { margin: 0; display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.price-now { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.price-was { font-size: .82rem; color: var(--muted); text-decoration: line-through; font-weight: 400; }

.card-title {
    font-size: .88rem; font-weight: 400; color: var(--muted); margin: 0;
}
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--ink); }

.card-meta {
    margin: .35rem 0 0; padding-top: .45rem;
    border-top: 1px solid var(--line-2);
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem; font-size: .76rem; color: var(--muted-2);
}
.card-loc { display: inline-flex; align-items: center; gap: .25rem; min-width: 0; }
.card-loc svg { width: 13px; height: 13px; flex: 0 0 auto; }
.card-age { flex: 0 0 auto; }

.card--sold { opacity: .7; }
.card--sold .card-media img { filter: grayscale(.6); }

/* ======================================================= Rail ============= */
/* A single horizontal row of cards that scrolls sideways. */

.rail {
    display: flex; gap: .85rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Let the cards bleed to the screen edge so the row reads as scrollable. */
    margin: 0 -1rem;
    padding: 0 1rem .35rem;
}
.rail::-webkit-scrollbar { display: none; }

.rail .card {
    flex: 0 0 auto;
    width: 168px;
    scroll-snap-align: start;
}
@media (min-width: 640px)  { .rail .card { width: 210px; } }
@media (min-width: 1024px) { .rail .card { width: 240px; } }

/* ================================================= Load more ============= */

.load-more {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%; max-width: 480px;
    margin: 1.5rem auto 0;
    padding: .85rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.load-more:hover { border-color: var(--ink); background: var(--surface-2); }
.load-more[disabled] { opacity: .55; cursor: default; }
.load-more svg { width: 18px; height: 18px; }
.load-more.is-busy svg { animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================== Product page ============= */

.crumbs { display: flex; gap: .45rem; font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }

.product-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .product-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem; } }

.product-media {
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    overflow: hidden; background: var(--surface-2);
}
.product-media img {
    width: 100%;
    /* Needed so the width/height attributes do not fix the box at its
       intrinsic size; aspect-ratio then gives the square. */
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-title { font-size: clamp(1.25rem, 2.6vw, 1.7rem); font-weight: 700; margin: 0 0 .4rem; }
.product-price { margin: 0 0 .6rem; display: flex; align-items: baseline; gap: .5rem; }
.product-price .price-now { font-size: 1.8rem; }

.product-meta {
    display: flex; flex-wrap: wrap; gap: 1rem;
    margin: 0 0 1rem; font-size: .85rem; color: var(--muted);
}
.product-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.product-meta svg { width: 15px; height: 15px; }

.product-desc { color: var(--ink-2); line-height: 1.65; margin: 0 0 1.25rem; }

.seller {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1rem; margin-bottom: 1.25rem;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--radius);
}
.seller-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--blue-soft); }
.seller-name { margin: 0; font-weight: 600; font-size: .92rem; }
.seller-since { margin: 0; font-size: .78rem; color: var(--muted); }

.product-actions { display: grid; gap: .6rem; }
.product-actions form { margin: 0; }
.action-note {
    margin: 0; padding: .8rem 1rem; font-size: .9rem; color: var(--muted);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}

/* =================================================== Buttons ============== */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .6rem 1.1rem;
    border: 1px solid transparent; border-radius: var(--radius-pill);
    font: inherit; font-size: .9rem; font-weight: 600;
    cursor: pointer; text-decoration: none; text-align: center;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); background: var(--surface-2); }
.btn-soft { background: var(--blue-soft); color: var(--blue-dark); }
.btn-soft:hover { background: #d8e6fb; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b42318; }
.btn-danger-ghost { background: var(--surface); border-color: #fecdca; color: var(--red); }
.btn-danger-ghost:hover { background: #fef3f2; }
.btn-sm { padding: .4rem .8rem; font-size: .84rem; }
.btn-block { width: 100%; }

/* ==================================================== Tables ============== */

.table-scroll {
    overflow-x: auto; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: .7rem .85rem; border-bottom: 1px solid var(--line-2);
    text-align: left; font-size: .88rem; white-space: nowrap;
}
.data-table thead th {
    background: var(--surface-2); font-weight: 600; color: var(--ink-2);
    font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.badge-active { background: var(--green-soft); color: var(--green); }
.data-table tr.is-s td { color: var(--muted); }
.listing-sold-at { font-size: .78rem; color: var(--muted); }
.row-actions { display: flex; gap: .35rem; }
.row-actions form { display: flex; gap: .35rem; margin: 0; }

.cart-summary {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    margin-top: 1rem; padding: 1rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.cart-total { font-size: 1.05rem; margin: 0 auto 0 0; }

/* ==================================================== Forms =============== */

.auth-card, .form-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-xl); padding: 1.5rem;
    max-width: 520px; margin: 1.5rem auto; box-shadow: var(--shadow-sm);
}
.form-card--wide { max-width: 680px; }

.stacked-form { display: flex; flex-direction: column; gap: .3rem; }
.stacked-form label { font-weight: 600; font-size: .86rem; margin-top: .6rem; color: var(--ink-2); }
.stacked-form input, .stacked-form select, .stacked-form textarea {
    padding: .6rem .8rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font: inherit; font-size: .93rem;
    width: 100%; background: var(--surface); color: var(--ink);
}
.stacked-form input:focus, .stacked-form select:focus, .stacked-form textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.stacked-form small { color: var(--muted); font-size: .8rem; }
.stacked-form button { margin-top: 1.1rem; }
.stacked-form h2 { margin: 1.4rem 0 0; font-size: 1rem; }
.stacked-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin-top: 1.1rem; padding: 1rem; }
.stacked-form legend { font-weight: 600; font-size: .86rem; padding: 0 .4rem; }
.field-row { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.auth-alt { text-align: center; margin-top: 1.1rem; font-size: .9rem; color: var(--muted); }
.auth-alt a { color: var(--blue); font-weight: 600; }
.avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; background: var(--blue-soft); }

.checkout-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-form, .order-summary, .confirmation {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 1.25rem;
}
.order-summary ul, .summary-items { list-style: none; padding: 0; margin: 0 0 1rem; }
.order-summary li, .summary-items li {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .45rem 0; border-bottom: 1px solid var(--line-2); font-size: .88rem;
}
.summary-list { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.25rem; font-size: .9rem; }
.summary-list dt { font-weight: 600; color: var(--muted); }
.summary-list dd { margin: 0; }

.stat-row { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1.75rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-value { display: block; font-size: 1.7rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .82rem; }

.faq-list details {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: .6rem;
}
.faq-list summary { cursor: pointer; font-weight: 600; }

.thread-list { list-style: none; padding: 0; display: grid; gap: .7rem; }
.thread-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.thread-meta { margin: 0 0 .3rem; font-size: .85rem; color: var(--muted); }
.thread-body { margin: 0; font-size: .92rem; }
.thread-date { margin: .35rem 0 0; color: var(--muted); font-size: .78rem; }

.dialog {
    border: 0; border-radius: var(--radius-xl); padding: 1.5rem;
    width: min(520px, 92vw); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(16, 24, 40, .5); }
.dialog-close-form { display: flex; justify-content: flex-end; }
.dialog-close { background: none; border: 0; font-size: 1.6rem; cursor: pointer; line-height: 1; color: var(--muted); }
.message-thread { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.message { padding: .55rem .8rem; border-radius: var(--radius); max-width: 80%; font-size: .9rem; word-break: break-word; }
.message-mine { background: var(--blue-soft); align-self: flex-end; }
.message-theirs { background: var(--surface-2); align-self: flex-start; border: 1px solid var(--line); }
.message-form { display: flex; flex-direction: column; gap: .6rem; }
.message-form textarea {
    padding: .6rem .75rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font: inherit; min-height: 84px; resize: vertical;
}

/* =================================================== Footer =============== */
/* Deliberately minimal: two columns of links, a rule, then the mark. */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 1rem 1.5rem;
    background: var(--surface);
}

.footer-links {
    max-width: var(--shell); margin: 0 auto 1.5rem;
    display: grid; gap: 1.25rem;
    grid-template-columns: 1fr 1fr;
}
.footer-links ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.footer-links a { text-decoration: none; color: var(--muted); font-size: .95rem; }
.footer-links a:hover { color: var(--blue); }

.footer-base {
    max-width: var(--shell); margin: 0 auto;
    padding-top: 1.25rem; border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
}
.footer-logo { font-size: 1.2rem; font-weight: 800; color: var(--blue); letter-spacing: -.03em; }
.footer-copy { color: var(--muted); font-size: .875rem; }

/* =================================================== Tab bar ============== */
/* Fixed to the bottom of a phone. Hidden on desktop, where the top bar serves. */

.tabbar {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
}

.tab {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .15rem;
    text-decoration: none; color: var(--muted);
    font-size: .68rem; font-weight: 500;
}
.tab svg { width: 21px; height: 21px; }
.tab.is-active { color: var(--blue); }
.tab.is-active svg { stroke-width: 2.1; }

.tab--sell { color: var(--ink-2); }
.tab-sell-icon {
    display: grid; place-items: center;
    width: 26px; height: 26px; border-radius: 7px;
    border: 1.6px solid var(--muted); color: var(--muted);
}
.tab--sell .tab-sell-icon svg { width: 16px; height: 16px; }

/* ================================================ Responsive ============== */

@media (max-width: 1023px) {
    .order-summary { position: static; }
}

@media (max-width: 639px) {
    :root { --topbar-h: 56px; --strip-h: 40px; }

    /* Room for the fixed tab bar. */
    body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }

    .tabbar { display: flex; }

    .topbar { padding: 0 .75rem; gap: .5rem; }
    .logo { font-size: 1.25rem; }
    .topbar-search { height: 38px; max-width: none; }
    .topbar-actions { gap: 0; }
    .icon-btn { width: 34px; height: 34px; font-size: 19px; }
    .account-toggle { width: 34px; height: 34px; }

    .site-main { padding: 1rem .75rem 1.5rem; }
    .category-strip-inner { padding: 0 .75rem; gap: 1.15rem; }

    .hero { margin: 0 -.75rem 1.5rem; padding: 1.75rem .75rem 1.1rem; }
    .hero-search { padding: .6rem; border-radius: var(--radius-lg); }
    .hero-field { height: 46px; }
    .hero-submit { height: 46px; font-size: .95rem; }

    .section-title { font-size: 1.15rem; }
    .grid { gap: .7rem; }
    .card-body { padding: .5rem .6rem .65rem; }
    .price-now { font-size: 1.05rem; }
    .card-title { font-size: .8rem; }
    .card-meta { font-size: .7rem; }
    .card-fav { width: 30px; height: 30px; font-size: 17px; }
    .badge { font-size: .68rem; }

    .rail { gap: .7rem; margin: 0 -.75rem; padding: 0 .75rem .35rem; }
    .rail .card { width: 152px; }

    .product-price .price-now { font-size: 1.5rem; }
    .footer-links { grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
    .footer-links a { font-size: .88rem; }
    .footer-base { padding-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =================================================== Toasts ============== */

.toast-host {
    position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 1rem);
    transform: translateX(-50%);
    z-index: 60; display: grid; gap: .4rem; width: min(360px, calc(100vw - 2rem));
}

.toast {
    background: var(--ink); color: #fff;
    padding: .7rem 1rem; border-radius: var(--radius);
    font-size: .875rem; box-shadow: var(--shadow-lg);
    animation: toast-in .2s ease;
}
.toast--warn { background: #b54708; }
.toast--error { background: var(--red); }
.toast.is-out { opacity: 0; transition: opacity .25s; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (min-width: 640px) {
    .toast-host { bottom: 1.5rem; }
}

/* =============================================== Hero slides ============== */

.hero-slides {
    position: relative;
    display: grid;
    min-height: 2.6em;
    margin-bottom: 1.1rem;
}
.hero-slide { grid-area: 1 / 1; opacity: 0; transform: translateY(6px); transition: opacity .5s ease, transform .5s ease; }
.hero-slide.is-active { opacity: 1; transform: none; }

.hero-dots { display: flex; justify-content: center; gap: .45rem; margin-top: 1.1rem; }
.hero-dot {
    width: 8px; height: 8px; padding: 0; border: 0; border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .45); cursor: pointer;
    transition: width .3s, background .3s;
}
.hero-dot.is-active { width: 26px; background: #fff; }

/* ================================================== Filters ============== */

.filters { margin-bottom: 1.25rem; }
.filters-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.filters-search {
    display: flex; align-items: center; gap: .5rem;
    flex: 1 1 220px; min-width: 0;
    height: 38px; padding: 0 .8rem;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}
.filters-search:focus-within { border-color: var(--blue); background: #fff; }
.filters-search svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.filters-search input { flex: 1 1 auto; min-width: 0; border: 0; background: none; font: inherit; font-size: .88rem; }
.filters-search input:focus { outline: none; }

.filters-row > select {
    height: 38px; padding: 0 .7rem;
    border: 1px solid var(--line); border-radius: var(--radius-pill);
    background: var(--surface); font: inherit; font-size: .85rem; color: var(--ink-2);
    max-width: 160px;
}

.filters-price { position: relative; }
.filters-price summary {
    list-style: none; cursor: pointer;
    height: 38px; display: flex; align-items: center; padding: 0 .9rem;
    border: 1px solid var(--line); border-radius: var(--radius-pill);
    font-size: .85rem; font-weight: 600; color: var(--ink-2); background: var(--surface);
    white-space: nowrap;
}
.filters-price summary::-webkit-details-marker { display: none; }
.filters-price[open] summary { border-color: var(--blue); color: var(--blue); }
.filters-price-fields {
    position: absolute; top: calc(100% + .4rem); left: 0; z-index: 30;
    display: flex; align-items: center; gap: .4rem;
    padding: .6rem; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); white-space: nowrap;
}
.filters-price-fields input {
    width: 100px; padding: .45rem .6rem; font: inherit; font-size: .85rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.filters-clear { font-size: .85rem; color: var(--muted); text-decoration: none; }
.filters-clear:hover { color: var(--red); }

.badge-condition { background: rgba(255, 255, 255, .9); color: var(--ink-2); backdrop-filter: blur(4px); }
.product-page .badge-condition { background: var(--surface-2); }

/* ================================================ Dashboard ============== */

.dash-head {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.dash-avatar {
    width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
    background: var(--blue-soft); border: 1px solid var(--line);
}
.dash-head > div:nth-child(2) { flex: 1 1 200px; }
.dash-actions { display: flex; gap: .5rem; }

.dash-tabs {
    display: flex; gap: 1.2rem; overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--line); margin-bottom: 1.5rem;
}
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tab {
    flex: 0 0 auto; white-space: nowrap;
    padding: .6rem 0; font-size: .9rem; color: var(--muted); text-decoration: none;
    border-bottom: 2px solid transparent;
}
.dash-tab:hover { color: var(--ink); }
.dash-tab.is-active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }

.dash-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1.4fr 1fr; } }

.dash-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.dash-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius);
}
.dash-thumb { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); flex: 0 0 auto; }
.dash-row-main { flex: 1 1 auto; min-width: 0; }
.dash-row-title {
    font-size: .88rem; font-weight: 600; text-decoration: none; color: var(--ink);
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-row-title:hover { color: var(--blue); }
.dash-row-meta { margin: .1rem 0 0; font-size: .74rem; color: var(--muted); }
.dash-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex: 0 0 auto; }
.dash-price { font-weight: 700; font-size: .9rem; white-space: nowrap; }

/* =============================================== Header actions ========== */

.topbar-sell { flex: 0 0 auto; }
.topbar-actions .icon-btn svg { width: 20px; height: 20px; }

/* ================================================== Gallery ============== */

.gallery-thumbs {
    display: flex; gap: .5rem; margin-top: .6rem;
    overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
    flex: 0 0 auto; width: 68px; height: 68px; padding: 0;
    border: 2px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); cursor: pointer; overflow: hidden;
}
.gallery-thumb.is-active { border-color: var(--blue); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================ Image picker preview ======= */

.image-preview {
    display: flex; gap: .5rem; flex-wrap: wrap;
    margin-top: .6rem;
}
.image-preview-item { position: relative; margin: 0; width: 64px; }
.image-preview-item img {
    width: 64px; height: 64px; object-fit: cover;
    border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.image-preview-item figcaption {
    position: absolute; bottom: -6px; left: 0; right: 0;
    text-align: center; font-size: .6rem; color: var(--muted);
    background: var(--surface); border-radius: 3px;
}

/* ================================================== Comments ============= */

.comments { margin-top: 2rem; }

.comment-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }

.comment { display: flex; gap: .75rem; }
.comment--reply { margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--line-2); }
.comment.is-replying { background: var(--blue-soft); border-radius: var(--radius); padding: .6rem; }

.comment-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
    background: var(--blue-soft); flex: 0 0 auto;
}
.comment-main { flex: 1 1 auto; min-width: 0; }
.comment-head { margin: 0 0 .2rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: .88rem; }
.comment-time { color: var(--muted); font-size: .74rem; }
.comment-body { margin: 0; font-size: .9rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

.tag {
    padding: .1rem .4rem; border-radius: var(--radius-sm);
    font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.tag-seller { background: var(--green-soft); color: var(--green); }
.tag-admin  { background: #fef0c7; color: #b54708; }

.comment-reply-toggle {
    margin-top: .35rem; padding: 0; border: 0; background: none;
    font: inherit; font-size: .8rem; font-weight: 600; color: var(--blue); cursor: pointer;
}
.comment-reply-toggle:hover { text-decoration: underline; }

.comment-replies { list-style: none; padding: 0; margin: 0; }

/* Sticky composer, in the space the tab bar would otherwise take. */
.composer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: .5rem .75rem;
    padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
}
.composer-form {
    max-width: 760px; margin: 0 auto;
    display: flex; align-items: flex-end; gap: .5rem;
}
.composer-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--blue-soft); flex: 0 0 auto; }
.composer-form textarea {
    flex: 1 1 auto; min-width: 0;
    padding: .55rem .8rem; font: inherit; font-size: .9rem;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    resize: none; overflow-y: auto; max-height: 160px;
}
.composer-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.composer-guest { max-width: 760px; margin: 0 auto; text-align: center; font-size: .9rem; color: var(--muted); }
.composer-guest a { color: var(--blue); font-weight: 600; }

/* On a product page the composer replaces the tab bar. */
body.has-composer { padding-bottom: 0 !important; }
body.has-composer .tabbar { display: none !important; }

@media (min-width: 640px) {
    .composer { padding: .65rem 1rem; }
}

/* ============================================ Admin + settings =========== */

.admin-nav {
    display: flex; gap: 1.2rem; overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--line); margin-bottom: 1.5rem;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav-link {
    flex: 0 0 auto; white-space: nowrap; padding: .55rem 0;
    font-size: .9rem; color: var(--muted); text-decoration: none;
    border-bottom: 2px solid transparent;
}
.admin-nav-link:hover { color: var(--ink); }
.admin-nav-link.is-active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }

.settings-form { display: grid; gap: 1.25rem; max-width: 760px; }
.settings-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 1.25rem;
}
.settings-card h2 { margin: 0 0 .25rem; font-size: 1.05rem; }
.settings-note { margin: 0 0 1rem; font-size: .85rem; color: var(--muted); }
.settings-card label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-2); margin: .9rem 0 .3rem; }
.settings-card input[type="text"], .settings-card input[type="email"], .settings-card textarea {
    width: 100%; padding: .55rem .75rem; font: inherit; font-size: .9rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.settings-card input[type="color"] {
    width: 56px; height: 34px; padding: 2px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: var(--surface);
}
.hero-fieldset {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .9rem 1rem; margin: 0 0 .9rem;
}
.hero-fieldset legend { font-weight: 600; font-size: .85rem; padding: 0 .35rem; }

/* A switch row: label on the left, track on the right. */
.switch-row {
    display: flex !important; align-items: center; justify-content: space-between; gap: 1rem;
    margin: 0 !important; padding: .6rem 0; cursor: pointer;
    border-top: 1px solid var(--line-2);
}
.switch-row:first-of-type { border-top: 0; }
.switch-text { display: flex; flex-direction: column; }
.switch-label { font-size: .9rem; font-weight: 500; color: var(--ink); }
.switch-help { font-size: .78rem; color: var(--muted); }
.switch-row input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
    position: relative; flex: 0 0 auto;
    width: 42px; height: 24px; border-radius: var(--radius-pill);
    background: var(--line); transition: background .18s;
}
.switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow-xs); transition: transform .18s;
}
.switch-row input:checked + .switch-track { background: var(--green); }
.switch-row input:checked + .switch-track::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* The hero takes its background from the per-slide colour in settings. */
/* The colour comes from --hero-1..3 (theme.css.php); app.js sets data-active
   to pick the current slide's colour, and the background cross-fades. */
.hero {
    --slide-color: var(--hero-1, #1a5fd0);
    background-color: var(--slide-color);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .08) 0%, rgba(0, 0, 0, .38) 100%);
    transition: background-color .6s ease;
}
.hero[data-active="1"] { --slide-color: var(--hero-2, #0f9d58); }
.hero[data-active="2"] { --slide-color: var(--hero-3, #7c3aed); }
@media (prefers-reduced-motion: reduce) { .hero { transition: none; } }
.hero-slide { grid-area: 1 / 1; }
.no-tabbar .tabbar { display: none !important; }
body.no-tabbar { padding-bottom: 0 !important; }

/* ====================================== Desktop vs mobile visibility ==== */
/* The header carries two action sets: Sell/Saved/shield on desktop, chat on
   mobile. Both are in the markup so neither needs a second template. */

.only-mobile { display: none !important; }

@media (max-width: 639px) {
    .only-desktop { display: none !important; }
    .only-mobile  { display: inline-flex !important; }

    /* Bottom bar: one icon size for every item, including the Sell tile. */
    .tab svg { width: 22px; height: 22px; }
    .tab-sell-icon { width: 24px; height: 24px; }
    .tab-sell-icon svg { width: 15px; height: 15px; }
    .tab { font-size: .66rem; }
}

/* ================================================== Logo ================= */

.logo-img { height: 32px; width: auto; display: block; }
@media (max-width: 639px) { .logo-img { height: 26px; } }

.logo-current {
    display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
    margin-top: .5rem; padding: .6rem .75rem;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.logo-current img { max-width: 140px; height: 32px; width: auto; object-fit: contain; }
.inline-check { display: inline-flex !important; align-items: center; gap: .4rem; margin: 0 !important; font-weight: 400 !important; font-size: .8rem !important; color: var(--muted) !important; }

.dash-actions .icon-btn { width: 38px; height: 38px; }

/* ================================================ Comment replies ======= */
/* A reply is indented and joined to its parent by a rule, so the link is
   visible without relying on indentation alone. */

.comment-replies {
    list-style: none; padding: 0 0 0 1.1rem;
    margin: .85rem 0 0 .55rem;
    border-left: 2px solid var(--line);
    position: relative;
}
.comment-replies > .comment { position: relative; padding-left: .5rem; }

/* A small elbow joining each reply back to the rule. */
.comment-replies > .comment::before {
    content: "";
    position: absolute; left: -1.1rem; top: 1.05rem;
    width: .75rem; height: 2px;
    background: var(--line);
}
.comment--reply .comment-avatar { width: 30px; height: 30px; }
.comment--reply .comment-author { font-size: .84rem; }
.comment--reply .comment-body { font-size: .87rem; }

/* ============================================== Bottom bar icons ======== */
/* One optical size across the five items: the outline icons and the filled
   Sell tile are all set to the same bounding box. */

.tabbar .tab { justify-content: center; gap: 3px; }
.tabbar .tab > svg {
    width: 22px; height: 22px;
    flex: 0 0 22px;
    stroke-width: 1.7;
}
.tabbar .tab.is-active > svg { stroke-width: 2.1; }
.tabbar .tab-sell-icon {
    width: 24px; height: 24px; flex: 0 0 24px;
    display: grid; place-items: center;
}
.tabbar .tab-sell-icon > svg { width: 15px; height: 15px; stroke-width: 1.9; }
.tabbar .tab span { line-height: 1.2; }

/* Header icons share one optical size too. */
.topbar-actions .icon-btn > svg { width: 20px; height: 20px; stroke-width: 1.7; }
.topbar-actions .js-admin > svg { stroke-width: 1.7; }

/* ============================================ Default archive =========== */

.archive-hero {
    margin: -.25rem -1rem 1.25rem;
    padding: 1.5rem 1rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.archive-hero-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.archive-hero-title { font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 700; margin: 0 0 .15rem; }
.archive-hero-sub { margin: 0 0 1rem; color: var(--muted); font-size: .875rem; }
.archive-hero .search-form { display: flex; gap: .5rem; max-width: 560px; margin: 0 auto; }
.archive-hero .hero-field { flex: 1 1 auto; min-width: 0; background: var(--surface); }
.archive-hero .search-form .btn { flex: 0 0 auto; height: 52px; padding-inline: 1.5rem; border-radius: var(--radius-lg); }

@media (max-width: 639px) {
    .archive-hero { margin: -.5rem -.75rem 1rem; padding: 1.15rem .75rem; }
    .archive-hero .search-form { flex-direction: column; }
    .archive-hero .search-form .btn { width: 100%; }
}

/* Six columns on a wide screen, as asked for. */
@media (min-width: 1440px) {
    .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .rail .card { width: 210px; }
}

/* A shorter home hero: the statement stays, the height does not. */
.hero { padding: 1.75rem 1rem 1.25rem; margin-bottom: 1.75rem; }
.hero-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.hero-sub { margin-bottom: 1.1rem; }
.hero-field, .hero-submit { height: 46px; }
.hero-dots { margin-top: .85rem; }

@media (max-width: 639px) {
    .hero { padding: 1.25rem .75rem 1rem; margin-bottom: 1.25rem; }
    .hero-field, .hero-submit { height: 44px; }
}

/* Composer starts as one line and only grows with content. */
.composer-form textarea { min-height: 22px; height: 22px; }

/* ====================================== Product page two columns ======== */
/* Mobile stacks: breadcrumbs, gallery, details, CTAs, seller, comments,
   related. From 860px the gallery and the detail column sit side by side, and
   the comments and related sections run full width beneath. */

.product-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) {
    .product-layout {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: 2rem;
        align-items: start;
    }
    .product-gallery { position: sticky; top: calc(var(--topbar-h) + var(--strip-h) + 1rem); }
}

/* Composer stays compact until it is used. */
.composer { padding: .4rem .75rem; padding-bottom: calc(.4rem + env(safe-area-inset-bottom, 0px)); }
.composer-form { align-items: flex-end; }
.composer-form textarea { padding: .2rem .8rem; line-height: 1.5; }
.composer-avatar { margin-bottom: 1px; }

/* ============================================ Price never breaks ========== */
/* A large amount was wrapping mid-number ("Ksh 18,50" / "0.00") in a
   two-column card. The struck-through original may wrap onto its own line, but
   the number itself must stay whole. */

.card-price { row-gap: 0; }
.price-now { white-space: nowrap; }
.price-was { white-space: nowrap; }

/* Long amounts get a slightly smaller face rather than wrapping. */
@supports (font-size: clamp(1px, 1vw, 1px)) {
    .price-now { font-size: clamp(.92rem, 1.05vw, 1.15rem); }
}
@media (max-width: 639px) {
    .price-now { font-size: clamp(.86rem, 3.1vw, 1.05rem); }
}

/* Utility classes that replace inline style="" attributes (blocked by CSP). */
.section-title--sm { font-size: 1.05rem; }
.section-sub--tight { margin: -.75rem 0 1.25rem; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: .25rem 0 .5rem; }
.check-row { display: inline-flex !important; align-items: center; gap: .5rem; margin: 0 !important; font-weight: 500; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.auth-hint { font-size: .78rem; color: var(--muted); }

/* ============================ Product page (v1.0.0, sectioned) =========== */
.pp .crumbs { margin-bottom: 1rem; }
.pp .crumb-current { color: var(--muted); }
.pp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: 1.1rem; }
.pp-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.pp-top .product-media { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.pp-top .product-media img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; }
.pp-ribbon { position: absolute; top: 14px; left: 14px; background: var(--ink); color: #fff; font-weight: 700; padding: .25rem .8rem; border-radius: var(--radius-pill); font-size: .8rem; }
.pp-buybox { position: sticky; top: calc(var(--topbar-h) + var(--strip-h) + 12px); display: grid; gap: .9rem; }
.pp-badges { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pp-cat { font-size: .82rem; font-weight: 600; color: var(--blue); }
.pp-buybox .product-title { margin: 0; font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.25; }
.pp-buybox .product-price { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .6rem; }
.pp-buybox .price-now { font-size: 1.9rem; font-weight: 800; color: var(--ink); }
.pp-buybox .price-was { text-decoration: line-through; color: var(--muted-2); }
.pp-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pp-chips li { display: inline-flex; align-items: center; gap: .35rem; background: var(--line-2); color: var(--ink-2); font-size: .82rem; padding: .3rem .7rem; border-radius: var(--radius-pill); }
.pp-chips svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.pp-buybox .product-actions { display: grid; gap: .6rem; }
.pp-seller-mini { display: flex; align-items: center; gap: .75rem; padding-top: .9rem; border-top: 1px solid var(--line-2); }
.pp-jump { display: flex; gap: .4rem; overflow-x: auto; margin: 1.25rem 0 1rem; padding-bottom: .25rem; scrollbar-width: none; }
.pp-jump a { flex: 0 0 auto; padding: .4rem .95rem; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: .86rem; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.pp-jump a:hover { border-color: var(--blue); color: var(--blue); }
.pp-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.pp-main, .pp-side { display: grid; gap: 1rem; min-width: 0; }
.pp-section { scroll-margin-top: 130px; }
.pp-h { margin: 0 0 .75rem; font-size: 1.05rem; }
.pp .product-desc { margin: 0; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.pp-specs { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .1rem 1.5rem; }
.pp-specs div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line-2); }
.pp-specs dt { color: var(--muted); font-size: .9rem; }
.pp-specs dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.pp-seller { display: flex; align-items: center; gap: 1rem; }
.pp-seller-avatar { width: 64px; height: 64px; }
.pp-tips { margin: 0; padding-left: 1.1rem; color: var(--ink-2); display: grid; gap: .4rem; font-size: .92rem; }
.pp-report summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: .92rem; }
.pp-report form { margin-top: .75rem; }
.pp .comments { margin-top: 1.25rem; }
@media (max-width: 900px) {
    .pp-top, .pp-body { grid-template-columns: 1fr; }
    .pp-buybox { position: static; }
}
@media (max-width: 520px) { .pp-specs { grid-template-columns: 1fr; } .pp-card { padding: .9rem; } }
