/* NOTS MARKET STYLESHEET */

:root {
    --cream: #f6f0e4;
    --paper: #eee3cf;
    --olive: #414831;
    --olive-dark: #292f22;
    --brown: #6e4f30;
    --ink: #24251f;
    --muted: #777064;
    --border: #d9cbb5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: "DM Sans", Arial, sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.5;
}

h1, h2, h3, .logo {
    font-family: "Playfair Display", Georgia, serif;
}

a {
    color: inherit;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

/* HEADER */

.site-header {
    min-height: 100px;
    padding: 15px 6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    background: #faf6ed;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand, .footer-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1;
}

.logo {
    font-size: 54px;
    font-weight: 700;
    letter-spacing: -3px;
}

.tagline {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 17px;
    margin-top: 4px;
}

.site-header nav,
.site-footer nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

.site-header nav a,
.site-footer nav a {
    text-decoration: none;
    font-size: 14px;
    padding: 10px 0;
}

.site-header nav a:hover,
.site-header nav a.active {
    color: var(--brown);
    border-bottom: 1px solid var(--brown);
}

/* HOMEPAGE HERO */

.hero {
    min-height: 350px;
    display: flex;
    align-items: center;
    padding: 45px 7%;
    color: #fff9ed;
    background:
        linear-gradient(90deg, rgba(27,29,21,.94), rgba(27,29,21,.58) 48%, rgba(27,29,21,.08)),
        url("images/hero.jpg") center 55% / cover,
        #393a2d;
}

.hero-content {
    max-width: 520px;
}

.eyebrow,
.sell-eyebrow {
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 600;
}

.hero h1 {
    font-size: clamp(42px, 5vw, 64px);
    line-height: 1.05;
    margin: 18px 0;
}

.hero p {
    font-family: Georgia, serif;
    font-size: 20px;
    margin-bottom: 24px;
}

/* BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--olive);
    color: white;
    padding: 13px 24px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: .2s;
    cursor: pointer;
    font: inherit;
}

.btn:hover {
    background: var(--olive-dark);
    transform: translateY(-2px);
}

.btn:disabled,
button:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* MAIN CONTENT */

main {
    max-width: 1450px;
    margin: auto;
    padding: 0 5%;
}

/* SEARCH */

.search-wrap {
    max-width: 850px;
    margin: 28px auto 20px;
    display: flex;
    gap: 10px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fbf7ef;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 16px;
}

.search-box span {
    font-size: 28px;
    color: var(--brown);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 15px 0;
    font: inherit;
}

.search-button {
    background: var(--olive);
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 0 28px;
}

/* CATEGORIES */

.categories {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    margin: 32px auto;
}

.category {
    position: relative;
    min-width: 0;
    height: 90px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #414831 !important;
    border-radius: 3px;
    background: #eee3cf;
    color: #493b29;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
    cursor: pointer;
    transition: border-color .25s ease, transform .25s ease;
}

.category-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: .72;
    filter: brightness(.68) saturate(.58) sepia(.2);
    transition: transform .35s ease, filter .35s ease;
}

.category::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(35, 39, 28, .18);
}

.category-label {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #414831 !important;
    border-radius: 3px;
    color: #fff9ed !important;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .9);
    white-space: nowrap;
    -webkit-text-stroke: 0;
}

.category:hover {
    transform: translateY(-2px);
    border-color: #414831 !important;
    box-shadow: none;
}

.category:hover .category-image {
    transform: scale(1.025);
    filter: brightness(.78) saturate(.68) sepia(.14);
}

.category:active {
    transform: translateY(1px);
}

.category.active {
    border: 2px solid #414831 !important;
    box-shadow: none;
}

.category.active::after {
    background: rgba(35, 39, 28, .22);
}

.category.active .category-label {
    background: transparent;
    border: 1px solid #414831 !important;
    color: #fff9ed !important;
}

.category:focus-visible {
    outline: 2px solid #8b7047;
    outline-offset: 3px;
}

/* LISTING HEADINGS AND SORT */

.listing-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 10px 0 20px;
}

.listing-heading h2 {
    font-size: 30px;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.sort-control select {
    width: auto;
    padding: 9px 12px;
    background: #fbf7ef;
    border: 1px solid var(--border);
    border-radius: 20px;
}

/* HOMEPAGE LATEST LISTINGS */

.listings {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    padding-bottom: 35px;
    align-items: stretch;
}

.listing-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fbf7ef;
    border: 1px solid #e0d4c1;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(45, 35, 20, .05);
    transition: transform .2s ease, box-shadow .2s ease;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(45, 35, 20, .10);
}

/* HOMEPAGE LISTING PHOTO */

.listings .listing-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1eadf;
    border-bottom: 1px solid #e0d4c1;
}

.listings .listing-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 6px;
    box-sizing: border-box;
    transition: transform .3s ease;
}

.listing-card:hover .listing-image img {
    transform: scale(1.025);
}

.listings .listing-image-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #777b50;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 22px;
}

/* HOMEPAGE LISTING DETAILS */

.listing-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 11px;
}

.listing-category {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.listing-info h3 {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    margin: 5px 0;
    overflow-wrap: anywhere;
}

.listing-info h3 a {
    text-decoration: none;
}

.listing-info h3 a:hover {
    color: var(--brown);
}

.listing-price {
    font-size: 15px;
    font-weight: 700;
    margin: 5px 0 8px;
}

.listing-link {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 4px;
    color: var(--olive);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.listing-link:hover {
    color: var(--brown);
}

/* EMPTY LISTINGS */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
}

/* LEGACY LISTING CARDS FOR OTHER PAGES */

.card {
    position: relative;
    overflow: hidden;
    background: #fbf7ef;
    border: 1px solid #e0d4c1;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(45,35,20,.05);
    transition: .2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(45,35,20,.12);
}

.card img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
}

.card-content {
    padding: 13px;
}

.card-content h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.card-category {
    color: var(--muted);
    font-size: 12px;
}

.price {
    font-size: 18px;
    font-weight: 600;
    margin-top: 8px;
}

.seller {
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
    cursor: pointer;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.card-actions button {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
}

.card-actions .view-btn {
    flex: 1;
    background: var(--olive);
    color: white;
    border-color: var(--olive);
}

.card-actions .fav-btn {
    font-size: 17px;
}

/* SOLD LABEL AND CONDITION */

.sold-label {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 20px;
    background: #8b4035;
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sold-label[hidden] {
    display: none !important;
}

.item-condition {
    display: inline-block;
    margin: 12px 0;
    padding: 7px 12px;
    border-radius: 20px;
    background: #eeeadf;
    color: #55583b;
    font-size: 13px;
    font-weight: 600;
}

/* SELL BANNER */

.sell-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 28px 35px;
    margin: 5px 0 30px;
    background: #e8e2d2;
    border-radius: 5px;
}

.sell-banner h2 {
    font-size: 25px;
    margin: 5px 0;
}

.sell-banner p {
    font-size: 14px;
}

/* FOOTER */

.site-footer {
    background: var(--olive-dark);
    color: #f7f0e3;
    padding: 30px 6% 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 25px;
}

.footer-brand .logo {
    font-size: 38px;
}

.footer-brand .tagline {
    font-size: 13px;
}

.site-footer nav a:hover {
    color: #d8c29c;
}

.site-footer p {
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,.15);
    padding-top: 15px;
    font-size: 12px;
    color: #d0c8b8;
}

/* GENERAL PAGE LAYOUT */

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

form,
.profile-card,
.item-details,
.preview {
    background: #fbf7ef;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

label {
    display: block;
    font-weight: 600;
    margin: 18px 0 8px;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.item-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    padding-top: 35px;
    padding-bottom: 45px;
}

/* AUTHENTICATION */

.auth-container {
    max-width: 500px;
    margin: 80px auto;
    padding: 40px;
    background: #fbf7ef;
    border-radius: 12px;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 30px;
}

.auth-container input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
}

.auth-container button {
    width: 100%;
    padding: 15px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

footer:not(.site-footer) {
    text-align: center;
    padding: 30px;
    color: var(--muted);
}

/* ITEM PAGE */

.item-page {
    padding-top: 30px;
    padding-bottom: 50px;
}

.item-gallery {
    width: 100%;
    min-width: 0;
}

.main-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #eee9df;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.listing-image-placeholder {
    color: var(--olive);
    font-family: "Playfair Display", Georgia, serif;
    font-size: 38px;
}

.photo-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.photo-thumbnail {
    width: 76px;
    height: 76px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: #eee9df;
    cursor: pointer;
}

.photo-thumbnail.active {
    border-color: #777b50;
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    min-width: 0;
}

.item-details h1 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.2;
    margin: 12px 0;
}

.item-details p {
    margin-top: 12px;
}

.item-details .price {
    font-size: 26px;
    color: var(--brown);
    margin: 12px 0;
}

.seller-profile-link {
    color: var(--olive);
    font-weight: 600;
    text-decoration: underline;
}

.seller-profile-link:hover {
    color: var(--brown);
}

.item-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 22px;
}

.item-details button:not(.favorite-button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--olive);
    color: white;
    padding: 13px 24px;
    border-radius: 4px;
    border: 1px solid transparent;
    font: inherit;
    cursor: pointer;
    transition: .2s;
}

.item-details button:not(.favorite-button):hover:not(:disabled) {
    background: var(--olive-dark);
    transform: translateY(-2px);
}

.item-details button:not(.favorite-button):disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* FAVOURITES */

.favorite-button {
    padding: 13px 18px;
    border: 1px solid var(--olive);
    border-radius: 5px;
    background: transparent;
    color: var(--olive);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.favorite-button:hover {
    background: #eeeadf;
}

.favorite-button.saved {
    background: #777b50;
    border-color: #777b50;
    color: white;
}

.favorite-button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.favorite-status {
    width: 100%;
    font-size: 13px;
    margin: 4px 0 0;
}

/* MESSAGES */

.message-panel {
    margin-top: 25px;
    padding: 24px;
    background: #f5f1e8;
    border-radius: 8px;
    max-width: 550px;
}

.message-panel h2 {
    margin-bottom: 8px;
}

.message-panel textarea {
    width: 100%;
    min-height: 130px;
    padding: 12px;
    margin: 12px 0;
    border: 1px solid #c9c2b3;
    border-radius: 5px;
    font: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.message-panel button {
    margin-right: 8px;
}

.message-panel button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.message-status {
    margin-top: 12px;
    font-size: 14px;
}

.message-panel[hidden] {
    display: none !important;
}

/* SELL PAGE */

.sell-page-hero {
    text-align: center;
    padding: 55px 20px 35px;
    background: #eee3cf;
    border-bottom: 1px solid var(--border);
}

.sell-page-hero .eyebrow {
    color: var(--brown);
}

.sell-page-hero h1 {
    font-size: clamp(34px, 5vw, 48px);
    margin: 12px 0;
}

.sell-page-hero p {
    color: var(--muted);
    font-family: Georgia, serif;
    font-size: 17px;
}

.sell-page {
    max-width: 900px;
    margin: 35px auto 60px;
    padding: 0 20px;
}

.sell-intro {
    margin-bottom: 25px;
}

.sell-intro h2 {
    font-size: 28px;
    margin-bottom: 5px;
}

.sell-intro p,
.field-hint {
    color: var(--muted);
    font-size: 14px;
}

.listing-form {
    padding: 35px;
    background: #fbf7ef;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(45,35,20,.06);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-field {
    margin-bottom: 22px;
}

.form-field label:not(.upload-box) {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-field label span,
.form-footer p span {
    color: #9b563b;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 13px 14px;
    font: inherit;
    color: var(--ink);
    background: #fffdf8;
    border: 1px solid var(--border);
    border-radius: 5px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: 2px solid #9b9b79;
    outline-offset: 1px;
}

.field-hint {
    margin-bottom: 12px;
}

.condition-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

/* IMAGE UPLOAD */

.file-input {
    position: absolute;
    width: 1px !important;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 150px;
    padding: 25px;
    border: 2px dashed #c9b89c;
    border-radius: 6px;
    background: #f5eddf;
    cursor: pointer;
    text-align: center;
}

.upload-box:hover {
    background: #eee2cd;
}

.upload-icon {
    font-size: 30px;
    color: var(--olive);
}

.upload-title {
    font-weight: 600;
}

.upload-hint {
    font-size: 12px;
    color: var(--muted);
}

.photo-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #eee9df;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-preview-item span {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 4px 7px;
    border-radius: 5px;
    background: rgba(0,0,0,.65);
    color: white;
    font-size: 11px;
}

.photo-count {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

.image-preview {
    display: none;
    max-width: 100%;
    max-height: 320px;
    margin-top: 18px;
    border-radius: 6px;
    border: 1px solid var(--border);
    object-fit: contain;
}

/* SELL FORM FOOTER */

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-footer p {
    font-size: 13px;
    color: var(--muted);
}

.submit-listing {
    font: inherit;
    cursor: pointer;
}

.submit-listing:disabled {
    opacity: .6;
    cursor: wait;
}

/* PROFILE LISTING IMAGES AND DELETE BUTTON */

.listing-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: block;
    background: #f3efe6;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.delete-listing-button {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 16px;
    border: 1px solid #8b4b3e;
    border-radius: 4px;
    background: transparent;
    color: #8b4b3e;
    font: inherit;
    cursor: pointer;
}

.delete-listing-button:hover {
    background: #8b4b3e;
    color: #fff;
}

.delete-listing-button:disabled {
    opacity: .6;
    cursor: wait;
}

/* TABLET */

@media (max-width: 1000px) {
    .listings {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* MOBILE */

@media (max-width: 700px) {
    .site-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .logo {
        font-size: 42px;
    }

    .site-header nav {
        gap: 22px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        min-height: 330px;
        padding: 35px 7%;
        background-position: center;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero p {
        font-size: 17px;
    }

    main {
        padding: 0 4%;
    }

    .search-wrap {
        gap: 6px;
    }

    .search-button {
        padding: 0 14px;
    }

    .categories {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .category {
        height: 95px;
        min-width: 0;
        padding: 5px;
        font-size: 14px;
    }

    .category-label {
        font-size: 14px;
        padding: 6px 9px;
    }

    .listing-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .listing-heading h2 {
        font-size: 25px;
    }

    .listings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .listing-info {
        padding: 9px;
    }

    .listing-info h3 {
        font-size: 14px;
    }

    .listing-price {
        font-size: 14px;
    }

    .sell-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }

    .item-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .item-details {
        padding: 20px;
    }

    .main-photo-wrap {
        aspect-ratio: 4 / 3;
    }

    .item-actions {
        align-items: stretch;
    }

    .item-actions > * {
        max-width: 100%;
    }

    .site-footer {
        flex-direction: column;
        text-align: center;
    }

    .site-footer nav {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .sell-page-hero {
        padding: 40px 20px 30px;
    }

    .listing-form {
        padding: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .submit-listing {
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .listings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .listing-info {
        padding: 7px;
    }

    .listing-info h3 {
        font-size: 13px;
    }

    .listing-price {
        font-size: 13px;
    }

    .item-actions {
        flex-direction: column;
    }

    .item-actions .btn,
    .item-actions button {
        width: 100%;
    }

    .categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-label {
        font-size: 14px;
        padding: 5px 8px;
    }
}

/* MOBILE BUTTON AND LAYOUT FIXES */
@media (max-width: 700px) {
    /* Stack search field and button */
    .search-wrap {
        flex-direction: column;
        width: 100%;
    }

    .search-box {
        width: 100%;
        min-width: 0;
    }

    .search-button {
        width: 100%;
        min-height: 46px;
    }

    /* Keep navigation links evenly spaced */
    .site-header nav {
        width: 100%;
        gap: 10px 20px;
    }

    .site-header nav a {
        text-align: center;
    }

    /* Stack buttons in item action areas */
    .item-actions {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .item-actions > *,
    .item-actions .btn,
    .item-actions button {
        width: 100%;
        max-width: 100%;
        min-height: 46px;
        margin: 0;
    }

    /* Stack action buttons inside listing cards */
    .card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .card-actions button,
    .card-actions .view-btn {
        width: 100%;
        min-height: 42px;
    }

    /* Full-width buttons in the sell banner */
    .sell-banner .btn {
        width: 100%;
    }

    /* Keep form buttons consistent */
    .form-footer .btn,
    .form-footer button {
        width: 100%;
        min-height: 46px;
    }

    /* Avoid long button text pushing beyond the screen */
    .btn,
    button {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}