/* ==========================================================================
   Hunter Bid — "warm gallery" design system
   ========================================================================== */

:root {
    --cream: #FBF6EE;
    --cream-deep: #F3EADB;
    --ink: #3D2B23;
    --ink-soft: #6E5A4E;
    --maroon: #8B1A0A;
    --maroon-dark: #6E1408;
    --orange: #F5A623;
    --orange-deep: #E8890B;
    --line: #E5D9C6;
    --white: #FFFFFF;
    --danger: #B3261E;
    --ok: #2E6B34;

    --font-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius: 10px;
    --shadow: 0 2px 12px rgba(61, 43, 35, 0.08);
}

* { box-sizing: border-box; }

html {
    font-size: 16px;
    /* Kill double-tap-to-zoom on touch devices (it caused accidental page zoom
       and sideways scroll) while keeping pinch-zoom available. */
    touch-action: manipulation;
    /* Guard against any stray horizontal overflow (iOS sub-pixel rounding on
       grids/gutters). `clip` — not `hidden` — so position:sticky and the photo
       swipe scrollers keep working. */
    overflow-x: clip;
}

body { overflow-x: clip; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    /* Sticky footer: main stretches so short pages (contact, sign-in) still
       push the footer to the bottom of the viewport. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--maroon);
    line-height: 1.15;
    font-weight: 600;
}

h1 { font-size: 2rem; margin: 0.5em 0; }
h2 { font-size: 1.4rem; }

a { color: var(--maroon); }
a:hover { color: var(--orange-deep); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

main.container { flex: 1 0 auto; padding-bottom: 3rem; }

.site-footer { margin-top: auto; }

.muted { color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-weight: normal; font-size: 0.85em; }

/* Header ------------------------------------------------------------------ */

.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--maroon);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.brand-mark { width: 42px; height: 42px; }

.brand-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--maroon);
    letter-spacing: 0.02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.site-nav a {
    text-decoration: none;
    font-weight: 600;
    color: var(--ink);
}

.site-nav a:hover { color: var(--maroon); }

/* Footer ------------------------------------------------------------------ */

.site-footer {
    background: var(--maroon-dark);
    color: var(--cream);
    margin-top: 3rem;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    text-align: center;
}

/* Buttons & forms --------------------------------------------------------- */

.btn {
    display: inline-block;
    border: 1px solid var(--maroon);
    background: var(--white);
    color: var(--maroon);
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
}

/* a.btn selectors must outweigh the global a:hover color rule, or link-buttons
   like "Sign in to bid" end up orange-on-orange and unreadable. */
.btn:hover, a.btn:hover { background: var(--cream-deep); color: var(--maroon); }

.btn-primary, a.btn-primary {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--maroon-dark);
}

.btn-primary:hover, a.btn-primary:hover {
    background: var(--orange-deep);
    border-color: var(--orange-deep);
    color: var(--maroon-dark);
}

.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #FBEAE9; }

.btn-small { font-size: 0.85rem; padding: 0.25rem 0.7rem; }

.inline-form { display: inline; }

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--maroon);
    cursor: pointer;
    text-decoration: underline;
}

.link-button:hover { color: var(--orange-deep); }
.link-button.danger { color: var(--danger); }

label { display: block; font-weight: 600; margin-bottom: 0.9rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input:not([type]), select, textarea {
    display: block;
    width: 100%;
    max-width: 100%; /* a select's longest option must never widen the page */
    margin-top: 0.3rem;
    padding: 0.5rem 0.65rem;
    font: inherit;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--orange);
    outline-offset: 0;
    border-color: var(--orange);
}

label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; }
label.check input { width: auto; margin: 0; }

.form-error { color: var(--danger); }
.form-error ul { margin: 0.25rem 0; padding-left: 1.2rem; }

.notice {
    background: var(--cream-deep);
    border-left: 4px solid var(--orange);
    padding: 0.6rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Auth cards -------------------------------------------------------------- */

.auth-card {
    max-width: 420px;
    margin: 3rem auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--maroon);
    padding: 2rem;
}

.auth-card h1 { margin-top: 0; }
.auth-card .btn { width: 100%; margin-top: 0.5rem; }
.auth-alt { margin-top: 1.25rem; font-size: 0.9rem; }

/* Placeholder home -------------------------------------------------------- */

.placeholder-hero {
    text-align: center;
    padding: 4rem 1rem;
}

.placeholder-hero img { width: 110px; height: 110px; }
.placeholder-hero h1 { font-size: 2.6rem; margin: 0.4em 0 0.2em; }
.placeholder-hero .lead { font-size: 1.15rem; max-width: 34em; margin: 0.5em auto; }

/* Admin ------------------------------------------------------------------- */

.admin-nav {
    display: flex;
    gap: 1.5rem;
    padding: 0.9rem 0 0.7rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.5rem;
}

.admin-nav a { font-weight: 700; text-decoration: none; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table th {
    background: var(--cream-deep);
    color: var(--maroon-dark);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:last-child td { border-bottom: none; }

.cell-thumb img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.no-photo { color: var(--ink-soft); font-size: 0.8rem; }
.cell-actions { white-space: nowrap; }
.cell-actions form { margin-right: 0.3rem; }

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-draft { background: var(--line); color: var(--ink-soft); }
.badge-available { background: #E3EFE4; color: var(--ok); }
.badge-reserved, .badge-pending, .badge-invoiced { background: #FDEECB; color: #8A5A00; }
.badge-sold, .badge-paid, .badge-shipped { background: #EAD9D6; color: var(--maroon-dark); }
.badge-cancelled { background: var(--line); color: var(--ink-soft); }
.badge-admin { background: var(--maroon); color: var(--cream); margin-left: 0.4rem; }

/* Listing editor ---------------------------------------------------------- */

.form-grid { max-width: 640px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.photo-admin { margin-top: 2.5rem; }

.photo-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0;
}

.photo-list li {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.5rem;
}

.photo-list img {
    width: 150px;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.photo-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

.upload-form { max-width: 640px; margin-top: 1rem; }

/* Hero (homepage) --------------------------------------------------------- */

.hero {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 2.5rem;
    align-items: center;
    padding: 2.5rem 0 3rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--orange-deep);
    margin: 0 0 0.25rem;
}

.hero h1 { font-size: 2.5rem; margin: 0.1em 0 0.3em; }

.hero-photo img {
    width: 100%;
    /* Tall legacy composite photos would otherwise stretch the hero to several
       screens; crop to a sane banner height instead. */
    max-height: 520px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: block;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
    margin: 1.25rem 0;
}

.hero-stats dt {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
}

.hero-stats dd {
    margin: 0.15rem 0 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--maroon-dark);
    font-variant-numeric: tabular-nums;
}

.hero-result { font-size: 1.2rem; font-weight: 600; }

.btn-large { font-size: 1.1rem; padding: 0.75rem 1.8rem; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

/* Heading + button grouped and centered in the page (rather than pushed apart). */
.section-head--center {
    justify-content: center;
    flex-wrap: wrap;
}

/* Item cards -------------------------------------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

/* Homepage per-category rows: 3 blanks + a "see all" card, dropping blanks as it narrows */
.cat-row { margin-bottom: 2.25rem; }

.cat-heading { font-size: 1.15rem; margin: 0 0 0.75rem; }
.cat-heading a { color: var(--maroon); text-decoration: none; }
.cat-heading a:hover { color: var(--orange-deep); }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    align-items: stretch;
}

.cat-cell { display: flex; }
.cat-cell > .card { width: 100%; }

/* Structurally mirrors a listing card: tinted "photo" area with the count, white body with the CTA.
   Compound selector (.card.see-all-card) so display:flex beats .card's display:block. */
.card.see-all-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.see-all-photo {
    aspect-ratio: 4 / 3;
    background: var(--cream-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
}

.see-all-count {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1;
    color: var(--maroon);
}

.see-all-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-soft);
}

.see-all-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    text-align: center;
}

.see-all-cta { font-weight: 600; color: var(--ink); line-height: 1.4; }

@media (max-width: 900px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .col-desktop-only { display: none; }
}

@media (max-width: 640px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .col-tablet-up { display: none; }
    .see-all-card { min-height: 0; }

    /* Keep "Shop all" beside the heading instead of dropping to its own line. */
    .section-head--center { flex-wrap: nowrap; align-items: center; gap: 0.5rem; }
    .section-head--center h2 { font-size: 1.05rem; line-height: 1.25; min-width: 0; margin: 0; }
    .section-head--center .btn { flex: none; white-space: nowrap; }
}

.card {
    display: block;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.12s ease;
}

.card:hover { transform: translateY(-2px); color: var(--ink); }

.card-photo { position: relative; aspect-ratio: 4 / 3; background: var(--cream-deep); }

.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-muted .card-photo img { opacity: 0.55; }

.no-photo-card {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.no-photo-large { min-height: 320px; border-radius: var(--radius); background: var(--cream-deep); }

.ribbon {
    position: absolute;
    top: 0.6rem;
    left: 0;
    padding: 0.2rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--white);
    border-radius: 0 4px 4px 0;
}

.ribbon-hold { background: var(--orange-deep); }
.ribbon-sold { background: var(--maroon); }

.card-body { padding: 0.8rem 0.9rem 1rem; }

.card-body h3 {
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0.4rem 0 0.3rem;
    line-height: 1.3;
}

.card-price { font-size: 1.15rem; font-weight: 700; color: var(--maroon-dark); margin: 0; }

.badge-grade { background: var(--cream-deep); color: var(--maroon-dark); }

/* Trust strip ------------------------------------------------------------- */

.trust-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.trust-strip strong { display: block; color: var(--maroon); font-family: var(--font-display); font-size: 1.05rem; }
.trust-strip span { font-size: 0.88rem; color: var(--ink-soft); }

/* Shop filters ------------------------------------------------------------ */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.5rem;
}

.filter-bar label { margin: 0; font-size: 0.85rem; }
.filter-bar select { margin-top: 0.2rem; width: auto; min-width: 9rem; }
.filter-bar .check { padding-bottom: 0.45rem; }
/* Branded search pill — matches the site's badge/pill language.
   Full-basis puts it on its own row above the dropdown filters;
   max-width keeps it pill-proportioned and the placeholder untruncated. */
.search-row { flex: 1 1 100%; }

.search-pill {
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 0.2rem 0.25rem 0.2rem 1rem;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.search-pill:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.22);
}

.search-pill input,
.search-pill input:focus {
    border: none;
    outline: none;
    background: none;
    box-shadow: none;
    margin: 0;
    padding: 0.35rem 0;
    width: 100%;
    min-width: 0;
    font-size: 0.95rem;
    -webkit-appearance: none;
    appearance: none;
}

.search-pill input::placeholder { color: var(--ink-soft); }

.search-go {
    flex: none;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--orange);
    color: var(--maroon-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s ease;
}

.search-go:hover { background: var(--orange-deep); }

/* Detail pages (item & auction) ------------------------------------------- */

.detail {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
    padding-top: 1.5rem;
}

.gallery-viewport {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--cream-deep);
}

.gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    aspect-ratio: 4 / 3;
}

.gallery-track::-webkit-scrollbar { display: none; }

.gallery-track:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }

.gallery-slide {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.gallery-hint { margin: 0.4rem 0 0; text-align: center; }

/* Lightbox ---------------------------------------------------------------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(24, 14, 9, 0.94);
}

.lightbox-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}

.lightbox-img {
    /* 100% of the overlay, not 100vh: mobile URL bars make 100vh taller than
       the visible screen, which cropped tall photos at the top. */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transform-origin: center center;
}

/* Touch devices: JS owns all gestures inside the lightbox (pinch zooms the
   photo itself instead of triggering browser page-zoom). */
@media (pointer: coarse) {
    .lightbox-scroll { touch-action: none; }
    .lightbox-img { cursor: default; }
}

/* Zoomed: full viewport width, scroll to pan — tall photos become readable. */
.lightbox.zoomed .lightbox-scroll { display: block; }

.lightbox.zoomed .lightbox-img {
    max-width: none;
    max-height: none;
    width: 100vw;
    height: auto;
    margin: 0 auto;
    cursor: zoom-out;
}

.lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 101;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(251, 246, 238, 0.9);
    color: var(--maroon);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover { background: var(--white); }

.lightbox .gallery-arrow { z-index: 101; }
.lightbox-count { z-index: 101; }

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(251, 246, 238, 0.9);
    color: var(--maroon);
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.gallery-arrow:hover { background: var(--white); }
.gallery-prev { left: 0.6rem; }
.gallery-next { right: 0.6rem; }

.gallery-count {
    position: absolute;
    bottom: 0.6rem;
    right: 0.75rem;
    background: rgba(61, 43, 35, 0.65);
    color: var(--cream);
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }

.thumbs img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbs img.active, .thumbs img:hover { border-color: var(--orange); }

.detail-info h1 { margin: 0.2em 0; }

.detail-price { font-size: 1.9rem; font-weight: 700; color: var(--maroon-dark); margin: 0.3rem 0 0.8rem; }

.buy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 0.25rem 0 0.5rem;
}

/* Admin-only quick-edit link on public listing pages */
.admin-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--maroon);
    color: var(--cream);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    text-decoration: none;
    margin-bottom: 0.9rem;
}

.admin-edit-link:hover { background: var(--maroon-dark); color: var(--cream); }

.spec-table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; }

.spec-table th, .spec-table td {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 0.95rem;
}

.spec-table th { color: var(--ink-soft); font-weight: 600; white-space: nowrap; width: 1%; padding-right: 1.2rem; }

.desc { white-space: pre-line; margin-top: 1rem; }

/* Auction ------------------------------------------------------------------ */

.bid-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--orange);
    padding: 1.25rem 1.4rem;
    margin: 1rem 0 1.5rem;
}

.bid-box .hero-stats { margin: 0.5rem 0; }

.bid-form { display: flex; gap: 0.6rem; margin: 0.75rem 0 0.25rem; }
.bid-form input { flex: 1; margin: 0; font-size: 1.1rem; }

.bid-history th { font-variant-numeric: tabular-nums; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

/* Checkout / prose -------------------------------------------------------- */

.checkout { max-width: 560px; margin: 2rem auto; }

.checkout-summary {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.checkout-summary img { width: 110px; height: 82px; object-fit: cover; border-radius: 6px; }
.checkout-summary p { margin: 0.2rem 0; }
.checkout-summary .detail-price { font-size: 1.3rem; }

.prose { max-width: 70ch; }
.species-intro { margin-bottom: 1.5rem; }
.prose h1 { margin-bottom: 0.4em; }
.prose h2 { margin-top: 1.6em; }

.grade-table th { white-space: nowrap; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 1rem 0; }
.input-narrow { display: inline-block; width: 5.5rem; margin: 0; }

/* Searchable blank-picker (schedule an auction) */
.pick { margin-bottom: 0.25rem; }
.pick-label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
#pick-search { width: 100%; margin-bottom: 0.6rem; }
.pick-list {
    max-height: 22rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem;
    border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem; background: var(--white);
}
.pick-card {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0.55rem;
    border: 1px solid var(--line); border-radius: 8px; cursor: pointer; margin: 0;
    transition: border-color 0.12s, background 0.12s;
}
.pick-card:hover { border-color: var(--orange); }
.pick-card:has(input:checked) { border-color: var(--orange-deep); background: var(--cream); }
.pick-card input { margin: 0; flex: none; }
.pick-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; }
.pick-thumb-empty {
    display: flex; align-items: center; justify-content: center;
    background: var(--cream-deep); color: var(--ink-soft);
}
.pick-body { display: flex; flex-direction: column; min-width: 0; }
.pick-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-meta { font-size: 0.85rem; color: var(--ink-soft); }
.listing-tools { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.5rem; }
.counter-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.address-details summary { cursor: pointer; color: var(--maroon); font-size: 0.85rem; }
.address-details p { margin: 0.3rem 0 0; font-size: 0.85rem; white-space: pre-line; }

/* Pager -------------------------------------------------------------------- */

.results-line { margin: 0 0 0.9rem; font-size: 0.9rem; }

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2rem;
}

.pager a, .pager .current, .pager .gap {
    min-width: 38px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.pager a {
    background: var(--white);
    border: 1px solid var(--line);
    color: var(--maroon);
}

.pager a:hover { border-color: var(--orange); background: var(--cream-deep); }

.pager .current { background: var(--maroon); color: var(--cream); }

.pager .gap { color: var(--ink-soft); padding-left: 0.2rem; padding-right: 0.2rem; }

/* Footer links ------------------------------------------------------------- */

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.75rem;
    margin-bottom: 0.75rem;
}

/* Links wrap as 2–3 link units, never as a lone orphan. */
.footer-group {
    display: inline-flex;
    gap: 1.75rem;
    white-space: nowrap;
}

/* On phones, dissolve the nowrap groups so links wrap individually and never
   overflow narrow screens (the nowrap grouping only prevents orphans on desktop). */
@media (max-width: 640px) {
    .footer-group { display: contents; }
    .footer-links { gap: 0.6rem 1.2rem; }
}

.footer-links a { color: var(--cream); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.footer-links a:hover { color: var(--orange); }

/* Sticky mobile action bar -------------------------------------------------*/

.sticky-bar { display: none; }

/* Mobile ------------------------------------------------------------------ */

@media (max-width: 640px) {
    h1 { font-size: 1.6rem; }

    .header-inner { justify-content: center; }

    /* Keep the signed-in nav (Shop/Auction/Guide/Account/Sign out) to tidy rows. */
    .site-nav { gap: 0.4rem 0.9rem; font-size: 0.95rem; justify-content: center; }
    .brand-mark { width: 34px; height: 34px; }
    .brand-name { font-size: 1.3rem; }

    .form-row { grid-template-columns: 1fr; gap: 0; }

    /* Stack each admin table row into a labeled card instead of a wide, overflowing table. */
    .data-table { display: block; background: none; box-shadow: none; }
    .data-table thead {
        position: absolute; width: 1px; height: 1px;
        margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0;
    }
    .data-table tbody { display: block; }
    .data-table tr {
        display: block;
        margin-bottom: 0.85rem;
        padding: 0.35rem 0.9rem;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--white);
        box-shadow: var(--shadow);
    }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        border: none;
        padding: 0.32rem 0;
        text-align: right;
        white-space: normal;
    }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--ink-soft);
        text-align: left;
        flex: 0 0 auto;
    }
    /* Cells with no label (multi-line content, action buttons, thumbnails): left-aligned, no prefix. */
    .data-table td:not([data-label]) { justify-content: flex-start; text-align: left; }
    .data-table td:not([data-label])::before { content: none; }
    .data-table td.cell-thumb { justify-content: center; padding-top: 0.4rem; }
    .data-table td.cell-actions { flex-wrap: wrap; gap: 0.4rem; }

    .auth-card { margin: 1.5rem auto; padding: 1.5rem; }

    .page-head { flex-direction: column; align-items: flex-start; }

    .hero {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem 0 1.5rem;
    }

    .hero-photo { order: -1; }
    .hero-photo img { max-height: 45vh; }
    .hero h1 { font-size: 1.9rem; }
    .hero-stats { gap: 1.5rem; }
    .hero-stats dd { font-size: 1.3rem; }

    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .card-body { padding: 0.6rem 0.7rem 0.8rem; }

    .detail { grid-template-columns: 1fr; gap: 1.25rem; }

    /* Phones swipe the track directly; thumbnails just eat space. */
    .thumbs { display: none; }
    .gallery-arrow { width: 34px; height: 34px; }

    /* Filters must never widen the page: labels flex-wrap and selects shrink. */
    .filter-bar { gap: 0.6rem; }
    .filter-bar label { flex: 1 1 140px; min-width: 0; }
    .filter-bar select { width: 100%; min-width: 0; }

    .bid-form { flex-direction: column; }

    /* Sticky (not fixed): floats at the bottom while scrolling, then settles
       into the flow at the end of the page so it never covers the footer. */
    .sticky-bar {
        display: flex;
        position: sticky;
        bottom: calc(0.75rem + env(safe-area-inset-bottom));
        z-index: 50;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding: 0.6rem 0.9rem;
        background: var(--white);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: 0 4px 18px rgba(61, 43, 35, 0.2);
    }

    .sticky-price { font-size: 1.25rem; font-weight: 700; color: var(--maroon-dark); font-variant-numeric: tabular-nums; }

    .sticky-bar .btn { white-space: nowrap; }
}
