:root {
    --ink: #15151f;
    --ink-soft: #2a2a35;
    --paper: #faf8f5;
    --surface: #ffffff;
    --border: #ebe8e2;
    --muted: #8a8a93;
    --accent: #e94560;
    --accent-dark: #c73652;
    --accent-tint: #fdeef1;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--paper);
    color: var(--ink-soft);
    line-height: 1.5;
    /* Flex column so the footer sits at the bottom even on short pages (login etc.) */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
}

button, input, select, textarea {
    font-family: var(--font-body);
}

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

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--ink);
    letter-spacing: -0.01em;
}

/* ---------- Nav ---------- */

nav {
    background: var(--ink);
    border-bottom: 1px solid #2a2a3c;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-links a {
    color: #b7b7c4;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.07);
}

.nav-links a.active {
    color: white;
    background: rgba(233,69,96,0.2);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid #2a2a3c;
}

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-username {
    color: #e4e4ef;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-logout {
    color: #82828d !important;
    font-size: 13px !important;
    padding: 6px 10px !important;
}

.nav-logout:hover {
    color: var(--accent) !important;
    background: none !important;
}

/* ---------- Language toggle (ქარ | ENG) ---------- */

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-toggle {
    display: flex;
    border: 1px solid #33334a;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.lang-btn {
    background: none;
    border: none;
    color: #82828d;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
    color: white;
}

.lang-btn.active {
    background: var(--accent);
    color: white;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #e4e4ef;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.07);
}

/* Below this width the Georgian logged-in nav no longer fits on one line,
   so links collapse into a dropdown behind the hamburger. */
@media (max-width: 1024px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--ink);
        border-bottom: 1px solid #2a2a3c;
        padding: 8px 16px 16px;
        gap: 2px;
        box-shadow: 0 12px 24px rgba(10,10,16,0.35);
    }

    nav.nav-open .nav-links {
        display: flex;
    }

    .nav-links a {
        padding: 13px 14px;
        font-size: 15px;
    }

    .nav-user {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #2a2a3c;
        margin-top: 8px;
        padding-top: 12px;
    }
}

/* ---------- Hero ---------- */

.hero {
    background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 30px 28px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.hero-eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.hero p {
    color: var(--muted);
    font-size: 14.5px;
    max-width: 520px;
}

/* ---------- Layout ---------- */

.container {
    /* width: 100% is required because body is a flex column — without it,
       auto side margins make flex items shrink-wrap to their content. */
    width: 100%;
    max-width: 1280px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ---------- Search panel ---------- */

.search-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 2px 14px rgba(20,20,30,0.05);
    padding: 18px 22px 16px;
    margin-bottom: 28px;
}

.search-row {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.search-icon {
    color: #b3b3bb;
    flex-shrink: 0;
    margin-right: 10px;
}

.search-row input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 17px;
    color: var(--ink);
    background: transparent;
}

.search-row input::placeholder {
    color: #bbb;
}

.search-row .search-submit {
    margin-left: 12px;
    flex-shrink: 0;
}

.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a3a3ab;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--ink-soft);
    background: var(--paper);
    min-width: 140px;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--paper);
    padding: 0 10px;
}

.price-range input {
    width: 60px;
    border: none;
    background: transparent;
    outline: none;
    padding: 8px 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.price-sep {
    color: #bbb;
    font-size: 13px;
}

.price-currency {
    color: var(--muted);
    font-size: 13px;
}

.clear-filters {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    padding: 9px 4px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.clear-filters:hover {
    color: var(--accent);
}

.search-submit {
    padding: 10px 28px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}

.search-submit:hover {
    background: var(--accent-dark);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.active-filters:empty {
    margin-top: 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-tint);
    color: var(--accent-dark);
    border: 1px solid #f6d5da;
    border-radius: 20px;
    padding: 5px 8px 5px 12px;
    font-size: 13px;
}

.filter-chip button {
    background: none;
    border: none;
    color: var(--accent-dark);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.filter-chip button:hover {
    color: #8e2538;
}

.results-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-state p {
    margin-bottom: 14px;
    font-size: 15px;
}

.empty-state button {
    background: white;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
}

.empty-state button:hover {
    background: var(--accent-tint);
}

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 34px;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: var(--surface);
    color: var(--ink-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--accent);
    color: var(--accent-dark);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 700;
    cursor: default;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #b3b3bb;
    padding: 0 2px;
    user-select: none;
}

/* ---------- Listing cards ---------- */

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 20px;
}

.listing-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(20,20,30,0.04);
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
    /* Grid stretches every card in a row to the same height; flex passes that
       height down so the footer can pin to the bottom. */
    display: flex;
    flex-direction: column;
}

/* My Listings wraps the clickable part in an extra div — keep the chain. */
.card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(20,20,30,0.08);
}

.listing-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #eee;
}

.card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.card-body h3 {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    font-family: var(--font-body);
    overflow-wrap: anywhere;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-category {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    box-shadow: 0 1px 4px rgba(20,20,30,0.12);
}

.category-pill {
    flex-shrink: 0;
    background: #f1f1f1;
    color: #777;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.category-pill[data-category="textbooks"]  { background: #eaf1fb; color: #3b6fb0; }
.category-pill[data-category="notes"]      { background: #f3eefc; color: #7a4fc9; }
.category-pill[data-category="electronics"]{ background: #e8f8f4; color: #1f9c82; }
.category-pill[data-category="clothes"]    { background: #fdf1e7; color: #c97a2b; }
.category-pill[data-category="other"]      { background: #f1f1f1; color: #79797f; }

.card-description {
    font-size: 13px;
    color: var(--muted);
    overflow-wrap: anywhere;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: auto;
}

.card-body .price {
    display: inline-flex;
    align-items: baseline;
    font-family: var(--font-display);
    color: var(--accent-dark);
    background: var(--accent-tint);
    font-weight: 700;
    font-size: 14.5px;
    padding: 4px 10px;
    border-radius: 9px 9px 9px 3px;
}

.card-meta {
    font-size: 12px;
    color: #a3a3ab;
}

/* Owner actions on My Listings cards. The long "mark as sold" label gets a
   full-width row of its own so no language can overflow the card. */
.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 15px 15px;
}

.card-action-btn {
    padding: 9px 6px;
    background: white;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    min-width: 0;
}

.card-action-btn:hover {
    background: var(--accent-tint);
}

.card-action-btn.full {
    grid-column: 1 / -1;
}

.card-action-btn:disabled {
    background: #f0f0f0;
    color: #aaa;
    border-color: #f0f0f0;
    cursor: not-allowed;
}

.meta-dot {
    margin: 0 4px;
    color: #d4d4d8;
}

/* ---------- Photo carousels (listing cards + detail page gallery) ---------- */

.card-photo-wrap {
    position: relative;
}

.card-photo {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #eee;
    display: block;
}

.card-photo-nav,
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(21,21,31,0.5);
    color: white;
    border: none;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.card-photo-nav {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 16px;
}

.card-photo-nav:hover,
.gallery-nav:hover {
    background: rgba(21,21,31,0.8);
}

.card-photo-prev, .gallery-prev { left: 8px; }
.card-photo-next, .gallery-next { right: 8px; }

.card-photo-dots,
.gallery-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
}

.card-photo-dots .dot,
.gallery-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
}

.card-photo-dots .dot.active,
.gallery-dots .dot.active {
    background: white;
}

.gallery-wrap {
    position: relative;
}

.gallery-nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
}

.gallery-dots .dot {
    width: 7px;
    height: 7px;
}

.gallery-wrap img {
    cursor: zoom-in;
}

/* ---------- Photo thumbnail strip (detail page) ---------- */

.photo-thumbs {
    display: flex;
    gap: 8px;
    padding: 14px 32px 0;
    flex-wrap: wrap;
}

.photo-thumbs:empty {
    padding: 0;
}

.photo-thumb {
    position: relative;
    display: inline-block;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    background: #eee;
    flex-shrink: 0;
}

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

.photo-thumb.active {
    border-color: var(--accent);
}

.photo-thumb .photo-thumb-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(21,21,31,0.72);
    color: white;
    border: none;
    font-size: 10px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-thumb .photo-thumb-remove:hover {
    background: var(--accent-dark);
}

/* ---------- Lightbox (click-to-zoom) ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10,10,14,0.92);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: white;
    border: none;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.22);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.sold-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--ink);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.no-image {
    width: 100%;
    height: 180px;
    background: #f0eee9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b3b3ad;
    font-size: 14px;
}

/* ---------- Auth pages ---------- */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 40px 20px;
}

.auth-box {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(20,20,30,0.06);
    width: 100%;
    max-width: 400px;
}

.auth-box h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.auth-subtitle {
    color: var(--muted);
    margin-bottom: 25px;
    font-size: 14px;
}

.auth-box input,
.auth-box textarea,
.auth-box select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--paper);
}

.form-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background 0.15s;
}

.form-btn:hover {
    background: var(--accent-dark);
}

.form-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-link {
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.error-msg {
    color: var(--accent);
    font-size: 13.5px;
    margin-bottom: 15px;
    min-height: 20px;
}

.success-msg {
    color: #1f9c5a;
    font-size: 13.5px;
    margin-bottom: 15px;
    min-height: 20px;
}

/* Empty message slots shouldn't reserve blank space above the form. */
.error-msg:empty,
.success-msg:empty {
    min-height: 0;
    margin: 0;
}

/* ---------- Listing detail ---------- */

.listing-detail {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.listing-detail-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(20,20,30,0.06);
    overflow: hidden;
}

.listing-detail-card img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

.listing-detail-card .no-image {
    height: 300px;
    font-size: 18px;
}

.listing-detail-body {
    padding: 32px;
}

.listing-detail-body h1 {
    font-size: 25px;
    font-weight: 700;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.listing-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.listing-meta .price {
    font-family: var(--font-display);
    color: var(--accent-dark);
    background: var(--accent-tint);
    font-size: 22px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 10px 10px 10px 3px;
}

.listing-meta .category-badge {
    background: #f1f1f1;
    color: #777;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

.listing-meta .category-badge[data-category="textbooks"]  { background: #eaf1fb; color: #3b6fb0; }
.listing-meta .category-badge[data-category="notes"]      { background: #f3eefc; color: #7a4fc9; }
.listing-meta .category-badge[data-category="electronics"]{ background: #e8f8f4; color: #1f9c82; }
.listing-meta .category-badge[data-category="clothes"]    { background: #fdf1e7; color: #c97a2b; }
.listing-meta .category-badge[data-category="other"]      { background: #f1f1f1; color: #79797f; }

.views-meta {
    color: var(--muted);
    font-size: 13.5px;
}

.views-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.listing-description {
    color: var(--ink-soft);
    line-height: 1.7;
    overflow-wrap: anywhere;
    font-size: 15px;
    margin-bottom: 25px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.seller-info {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--ink-soft);
}

.seller-info span {
    font-weight: 700;
    color: var(--ink);
}

.listing-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.listing-actions .btn-contact,
.listing-actions .btn-delete {
    flex: 1 1 170px;
    margin: 0;
    padding: 11px 14px;
}

/* Same 2px border on the filled button so all buttons are the same height. */
.listing-actions .btn-contact {
    border: 2px solid var(--accent);
}

.btn-contact {
    padding: 12px 30px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 8px;
    transition: background 0.15s;
}

.btn-contact:hover {
    background: var(--accent-dark);
}

.btn-delete {
    padding: 12px 30px;
    background: white;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}

.btn-delete:hover {
    background: var(--accent-tint);
}

.contact-box {
    margin-top: 20px;
    background: var(--accent-tint);
    border-radius: var(--radius-sm);
    padding: 15px 20px;
    font-size: 14px;
    display: none;
}

.contact-box p {
    margin-bottom: 6px;
    color: var(--ink-soft);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    color: var(--accent);
}

#error-msg {
    margin-top: 15px;
}
/* ---------- Footer ---------- */

.site-footer {
    margin-top: auto; /* pushes footer to the bottom of the flex-column body */
    background: var(--ink);
    color: #b7b7c4;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 44px 30px 32px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 30px;
}

.footer-brand .logo {
    font-size: 17px;
}

.footer-brand p {
    font-size: 13.5px;
    color: #82828d;
    margin-top: 12px;
    max-width: 320px;
    line-height: 1.6;
}

.footer-col h4 {
    font-family: var(--font-display);
    color: white;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 12px;
}

.footer-col a {
    display: block;
    color: #b7b7c4;
    text-decoration: none;
    font-size: 14px;
    padding: 4px 0;
    transition: color 0.15s;
}

.footer-col a:hover {
    color: white;
}

.footer-col p {
    font-size: 13.5px;
    color: #82828d;
    line-height: 1.6;
    max-width: 300px;
}

.footer-bottom {
    border-top: 1px solid #2a2a3c;
}

.footer-bottom-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12.5px;
    color: #6d6d78;
}

@media (max-width: 720px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 26px;
        padding: 34px 24px 26px;
    }
}


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

@media (max-width: 640px) {
    /* iOS Safari zooms the page when focusing inputs with font-size < 16px.
       Forcing 16px here (overriding inline styles too) prevents that jump. */
    input, select, textarea {
        font-size: 16px !important;
    }

    .hero-inner {
        padding: 24px 20px 20px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .container {
        margin: 20px auto;
        padding: 0 14px;
    }

    /* Search panel: category + sort side by side, price full width, big search button */
    .search-panel {
        padding: 14px 16px 14px;
    }

    .filter-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        align-items: end;
    }

    .filter-group select {
        width: 100%;
        min-width: 0;
    }

    .filter-row .filter-group:nth-child(3) {
        grid-column: 1 / -1;
    }

    .price-range {
        width: 100%;
    }

    .price-range input {
        width: 100%;
    }

    .clear-filters {
        grid-column: 1 / -1;
        justify-self: start;
        padding-left: 0;
    }

    .search-row .search-submit {
        padding: 10px 16px;
        margin-left: 8px;
    }

    /* Listing detail: comfortable padding, full-width action buttons */
    .listing-detail {
        margin: 18px auto;
        padding: 0 14px;
    }

    .listing-detail-body {
        padding: 20px 18px;
    }

    .listing-detail-body h1 {
        font-size: 21px;
    }

    .btn-contact, .btn-delete {
        display: block;
        width: 100%;
        margin-right: 0;
    }

    .photo-thumbs {
        padding: 12px 18px 0;
    }

    .lightbox {
        padding: 14px;
    }

    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    /* Auth pages: tighter card */
    .auth-box {
        padding: 28px 22px;
    }

    /* Slightly larger tap targets for card carousels */
    .card-photo-nav {
        width: 32px;
        height: 32px;
    }
}