:root {
    /* Bootstrap: Overrides Bootstrap variables; Additional: Custom theme variables */
    --theme-accent: #8a2b1c;
    --brand-accent-light: #f4c771;
    --bs-primary: var(--theme-accent);
    --bs-success: #6b8e23 !important;
    --bs-secondary: #6c584c;
    --bs-body-color: #2a2a2a;
    --bs-danger: var(--theme-accent) !important;
    --bs-danger-rgb: 138, 43, 28;
    --nav-bg: #3a3a3a;
    --surface-dark: #2a2a2a;
    --footer-bg: #e7dfd2;
    accent-color: var(--theme-accent);
    --bs-primary: #8a2b1c;
    --bs-primary-rgb: 138, 43, 28;
}




/* -------------------------------- */
/* LAYOUT WRAPPER                   */
/* -------------------------------- */

/* Additional: Custom layout wrapper */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; }

main.wrapper {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0;
    width: 100%;
    flex: 1 0 auto;
    /* Grow to fill available space */     }


/* -------------------------------- */
/* NAVBAR                           */
/* -------------------------------- */

/* Bootstrap: Customises Bootstrap's navbar */
.navbar {
    background-color: var(--nav-bg);
    min-height: 100px;
}

/* Bootstrap: Customises Bootstrap's navbar container */
.navbar .container-fluid.wrapper {
    align-items: flex-end;
    padding: 0;
}

/* Bootstrap: Customises Bootstrap's nav */
.navbar .nav {
    align-items: flex-end;
    padding-bottom: 0.75rem;
    transform: translateY(4px);
}

/* Additional: Custom navbar menu trigger styling */
.navbar [data-bs-target="#accountMenu"] {
    padding-bottom: 0.4rem;
    position: relative;
}

/* Additional: Custom navbar menu trigger tooltip, excluding burger menu */
.navbar [data-bs-target="#accountMenu"]:not(.navbar-toggler):hover::after {
    content: "Manage listings and account";
    position: absolute;
    background-color: #333;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    top: -25px;
    right: 0;
    white-space: nowrap;
    z-index: 1000;
}

/* Move mobile nav alert badge left to avoid space on right of layout */
.navbar-toggler .badge {
    left: 80% !important;
    /* Move badge left */
    transform: translate(-50%, -50%) !important;
    /* Center vertically, adjust horizontally */
    right: auto !important;
    /* Prevent right overflow */
}

/* Additional: Custom navbar menu trigger background */
.navbar [data-bs-target="#accountMenu"] .bg-light {
    transition: transform 0.2s;
}

/* Additional: Custom navbar menu trigger hover effect */
.navbar [data-bs-target="#accountMenu"]:hover .bg-light {
    transform: scale(1.1);
    border: 2px solid var(--brand-accent-light);
}

/* Additional: Custom navbar title */
.navbar-title {
    font-family: "DM Serif Display", serif;
    font-size: 2.6rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--bs-light);
}

@media (max-width: 576px) {
    .navbar-title {
        font-size: 1.8rem;
    }

    .navbar-collapse {
        padding-top: 1rem;
    }
}

/* Bootstrap: Customises Bootstrap's nav-link */
.nav-link {
    line-height: 1.2;
    padding-bottom: 0.3rem;
}

/* Additional: Custom tagline */
.tagline {
    font-size: 0.8rem;
    /* Smaller font for mobile */
    line-height: 1.2;
}

@media (min-width: 768px) {
    .tagline {
        font-size: 0.95rem;
        /* Slightly larger for desktop */
    }
}

.navbar-brand .logo {
    max-width: 80px;
    max-height: 80px;
}

@media (max-width: 576px) {
    .navbar-brand .logo {
        max-width: 55px !important;
        max-height: 55px !important;
    }

    .text-container {
        max-width: 170px;
        /* Adjust as needed */
        white-space: normal;
    }
}

/* Slide in meanu nav links */
.offcanvas .nav-link:active,
.offcanvas .nav-link:focus {
  background-color: var(--bs-light); 
  border-radius: 4px; 
  box-shadow: 0 0 0 1rem var(--bs-light);
}

/* -------------------------------- */
/* HERO + OVERLAY PANELS            */
/* -------------------------------- */

/* Hero box */
.hero-box.overlay-card {
    position: relative;
    min-height: 60vh;
    /* Flexible height */
    max-height: 440px;
    /* Cap for larger screens */
    border-radius: 1.5rem;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.08);
}

/* Overlay panel */
.overlay-panel {
    position: absolute;
    top: 50%;
    left: 1rem;
    /* Reduced for mobile */
    right: 1rem;
    /* Ensure it spans on small screens */
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem;
    /* Reduced for mobile */
    border-radius: 1rem;
    max-width: 90%;
    /* Responsive width */
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

/* Overlay panel variant */
.overlay-panel.overlay-right {
    left: auto;
    right: 1rem;
}

/* Overlay search panel */
.overlay-panel.overlay-search {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    max-width: 90% !important;
    width: 100%;
}

/* Overlay search panel child */
.overlay-panel.overlay-search>div {
    width: 100%;
}

/* Hero box paragraph */
.hero-box p {
    font-weight: 500;
    font-size: 1.5rem;
    /* Smaller base size */
    line-height: 2rem;
}

/* Heading styling */
.small-heading {
    font-size: 0.9rem;
    /* Slightly smaller for mobile */
    letter-spacing: 0.015em;
    color: var(--bs-secondary);
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.4rem;
}

/* Responsive adjustments for home page hero */
@media (min-width: 576px) {
    .hero-box.overlay-card {
        min-height: 50vh;
    }

    .overlay-panel {
        left: 2rem;
        padding: 2rem;
        max-width: 500px;
    }

    .overlay-panel.overlay-right {
        right: 2rem;
    }

    .hero-box p {
        font-size: 2rem;
        line-height: 2.5rem;
    }

    .small-heading {
        font-size: 1rem;
        line-height: 1.6rem;
    }
}

@media (min-width: 768px) {
    .hero-box.overlay-card {
        min-height: 440px;
        /* Restore original height for desktop */
    }

    .overlay-panel {
        left: 3rem;
        padding: 2.5rem;
    }

    .overlay-panel.overlay-right {
        right: 3rem;
    }

    .hero-box p {
        font-size: 2.4rem;
        line-height: 3rem;
    }
}

/* Search page hero section */
.search-hero {
    padding-bottom: 1.5rem;
    /* Mobile */
}

@media (min-width: 768px) {
    .search-hero {
        padding-bottom: 3rem;
        /* Desktop, matches original pb-5 */
    }
}

/* Form elements for search page */
.overlay-panel.overlay-search {
    padding: 1rem;
    /* Mobile */
}

@media (min-width: 576px) {
    .overlay-panel.overlay-search {
        padding: 1.5rem;
    }
}

@media (min-width: 768px) {
    .overlay-panel.overlay-search {
        padding: 2rem;
        max-width: 700px !important;
    }
}

/* Sign-up section */
.display-5 {
    font-size: 2rem;
    /* Mobile */
}

.fs-5 {
    font-size: 1.1rem;
    /* Mobile */
}

@media (min-width: 768px) {
    .display-5 {
        font-size: 3.5rem;
        /* Matches display-4 for desktop */
    }

    .fs-5 {
        font-size: 1.25rem;
        /* Matches fs-4 for desktop */
    }
}

/* -------------------------------- */
/* CARDS                            */
/* -------------------------------- */

/* Bootstrap: Customises Bootstrap's card */
.card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Bootstrap: Customises Bootstrap's card body */
.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

/* Bootstrap: Customises Bootstrap's card lists */
.card-body ul,
.card-footer ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* Bootstrap: Customises Bootstrap's card image */
.card-img-top {
    object-fit: cover;
    height: 200px;
}

/* Bootstrap: Customises Bootstrap's card footer */
.card-footer {
    background: transparent;
    border-top: 0;
    flex-shrink: 0;
}

/* Additional: Custom card corner element */
.corner-heart-box {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    background-color: white;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
    border: 1px solid rgba(0, 0, 0, 0.175);
    margin: 0;
    padding: 0.15rem;
}

/* Additional: Custom button styling */
.corner-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    line-height: 1.3;
    font-size: 1.4rem;
}

/* Additional: Custom text clamping utility */
.clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25rem;
    min-height: calc(1.25rem * 3);
}

.clamp-5 {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25rem;
    min-height: calc(1.25rem * 5);
}

/* Additional: Custom product list styling */
.product-list {
    min-height: calc(1.25rem * 4);
    line-height: 1.25rem;
}

/* Additional: Custom product list item styling */
.product-list li {
    margin-bottom: 0;
}

/* -------------------------------- */
/* UTILITY CLASSES                  */
/* -------------------------------- */

/* Additional: Custom utility class */
.text-accent-light {
    color: var(--brand-accent-light) !important;
}

/* Additional: Custom link styling */
.link-accent {
    color: var(--theme-accent);
    text-decoration: none;
    font-weight: 500;
}

/* Additional: Custom link hover styling */
.link-accent:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}



.link-secondary {
    color: var(--bs-secondary);
    text-decoration: none;
    font-weight: 500;
}

.link-secondary:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* -------------------------------- */
/* BUTTONS                          */
/* -------------------------------- */

/* Bootstrap: Customises Bootstrap's primary button */
.btn-primary,
.btn-primary:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: var(--bs-light);
}

/* Bootstrap: Customises Bootstrap's primary button hover */
.btn-primary:hover {
    filter: brightness(85%);
}

/* Bootstrap: Customises Bootstrap's secondary button */
.btn-secondary,
.btn-secondary:hover {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

/* Bootstrap: Customises Bootstrap's secondary button hover */
.btn-secondary:hover {
    filter: brightness(85%);
}

/* Bootstrap: Customises Bootstrap's success button */
.btn-success,
.btn-success:hover {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

/* Bootstrap: Customises Bootstrap's success button hover */
.btn-success:hover {
    filter: brightness(85%);
}

/* Bootstrap: Customises Bootstrap's checked button state */
.btn-check:checked+.btn {
    color: var(--bs-light);
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

/* Bootstrap: Customises Bootstrap's outline danger button */
.btn-outline-primary {
    color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
}

/* Bootstrap: Customises Bootstrap's outline success button */
.btn-outline-success {
    color: var(--bs-success) !important;
    border-color: var(--bs-success) !important;
}

/* Bootstrap: Customises Bootstrap's outline danger button states */
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
    color: #fff !important;
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
}

/* Bootstrap: Customises Bootstrap's outline success button states */
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active,
.btn-outline-success.active {
    color: #fff !important;
    background-color: var(--bs-success) !important;
    border-color: var(--bs-success) !important;
}

/* -------------------------------- */
/* TABS / ACCORDIONS                */
/* -------------------------------- */

/* Bootstrap: Customises Bootstrap's nav-tabs link */
.nav-tabs .nav-link {
    color: var(--bs-secondary);
    text-decoration: none;
    border: none;
    background-color: transparent;
}

/* Bootstrap: Customises Bootstrap's nav-tabs link hover */
.nav-tabs .nav-link:hover {
    color: var(--theme-accent);
}

/* Bootstrap: Customises Bootstrap's active nav-tab */
.nav-tabs .nav-link.active {
    color: var(--bs-body-color);
    font-weight: 600;
    border-bottom: 2px solid var(--theme-accent);
}

/* Bootstrap: Customises Bootstrap's accordion button */
.accordion-button {
    background-color: var(--footer-bg);
    color: var(--bs-body-color);
}

/* Bootstrap: Customises Bootstrap's accordion button active state */
.accordion-button:not(.collapsed) {
    background-color: var(--brand-accent-light);
    color: var(--bs-body-color);
}

/* Bootstrap: Customises Bootstrap's accordion button focus state */
.accordion-button:focus {
    box-shadow: none;
    border-color: var(--theme-accent);
}

/* -------------------------------- */
/* FORM + TEXT + IMAGES             */
/* -------------------------------- */

/* Additional: Custom form error styling */
.form-error {
    color: #ee6f57;
}

/* Your accent color */
input[type="checkbox"],
input[type="radio"],
input[type="range"] {
    accent-color: var(--theme-accent);
}

/* Form labels and buttons */
.form-label,
.form-check-label {
    font-size: 0.9rem;
    /* Mobile */
}

@media (min-width: 768px) {

    .form-label,
    .form-check-label {
        font-size: 1rem;
    }
}

/* Range slider */
.form-range {
    width: 100%;
    max-width: 300px;
    /* Prevent stretching on mobile */
    margin: 0 auto;
}

/* Custom range slider styling */
.form-range::-webkit-slider-thumb {
    background: var(--bs-secondary);
    /* Thumb matches theme */
    border: 2px solid var(--brand-accent-light);
    /* Border for contrast */
}

.form-range::-moz-range-thumb {
    background: var(--bs-secondary);
    border: 2px solid var(--brand-accent-light);
}

.form-range::-webkit-slider-runnable-track {
    background: rgba(var(--bs-secondary-rgb), 0.3);
    /* Track in muted secondary */
}

.form-range::-moz-range-track {
    background: rgba(var(--bs-secondary-rgb), 0.3);
}

.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(var(--bs-secondary-rgb), 0.2);
    /* Focus ring */
}

.form-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(var(--bs-secondary-rgb), 0.2);
}

/* Custom toggle switch styling */
.form-check-input[type="checkbox"] {
    background-color: #e0e0e0;
    /* Unchecked background */
    border-color: var(--bs-secondary);
    /* Border */
}

.form-check-input[type="checkbox"]:checked {
    background-color: var(--bs-secondary);
    /* Checked background */
    border-color: var(--bs-secondary);
}

.form-check-input[type="checkbox"]:focus {
    box-shadow: 0 0 0 4px rgba(var(--bs-secondary-rgb), 0.2);
    /* Focus ring */
}

/* Additional: Custom padding for form submit buttons */
button[type="submit"]:not(.corner-btn) {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

/* -------------------------------- */
/* LISTINGS IMAGES / GALLERY        */
/* -------------------------------- */

/* Additional: Custom image wrapper */
.main-image-wrapper {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin: 0 auto;
}

/* Additional: Custom main image styling */
.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 1px solid #ccc;
    background: #f8f8f8;
    object-fit: cover;
}

/* Additional: Custom thumbnail wrapper */
.thumb-wrapper {
    width: 100%;
    padding-top: 100%;
    position: relative;
}

/* Additional: Custom thumbnail image */
.thumb-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    border-radius: 0.25rem;
    border: 1px solid #ccc;
    max-height: 80px;
}

/* -------------------------------- */
/* MESSAGES                         */
/* -------------------------------- */

.messages-page {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

#message-thread-container {
    padding-left: 1rem;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.messages-page .list-group-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.messages-page .list-group-item:hover {
    background-color: var(--bs-light);
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: var(--bs-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    gap: 2px;
    flex-shrink: 0;
    margin-right: 1rem;
}

.avatar i.bi-person-fill {
    font-size: 0.85rem;
    line-height: 1.1;
}

/* Avatar color palette */
.avatar-color-1 {
    background-color: var(--bs-primary);
}

.avatar-color-2 {
    background-color: var(--bs-secondary);
}

.avatar-color-3 {
    background-color: var(--bs-success);
}

.avatar-color-4 {
    background-color: #A68A64;
    /* Muted tan, complements --footer-bg */
}

.avatar-color-5 {
    background-color: #D4A017;
    /* Warm gold, echoes --brand-accent-light */
}

.avatar-color-6 {
    background-color: #4A7043;
    /* Deep forest green, pairs with --bs-success */
}

.unread {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.messages-page .bg-selected {
    background-color: #fafafa;
    border-left: 3px solid var(--bs-primary) !important;
}

.clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge.bg-primary {
    background-color: var(--theme-accent) !important;
}

.loading-spinner .spinner-border {
    color: var(--theme-accent);
}

.messages-page .list-group-item .text-muted {
    color: var(--bs-body-color) !important;
}

.thread-item {
    cursor: pointer;
}

.thread-item {
    display: flex;
    /* Match original list-group-item flex layout */
    align-items: center;
    /* Ensure vertical alignment */
    width: 100%;
    /* Maintain full width */
}

.thread-item.d-none {
    display: none;
    /* Hide without !important to avoid overrides */
}

/* Additional: Custom message bubble styling */
.message-bubble {
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    position: relative;
    font-size: 0.9rem;
    word-break: break-word;
}

.messaging-component .message-bubble.bg-primary {
    background-color: rgba(var(--bs-primary-rgb), 0.15) !important;
}

.inbox.wrapper {
    padding: 1rem;
}

.inbox-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    height: auto;
}

.inbox-container .row.justify-content-center.py-2.gx-3 {
    flex: 1 1 auto;
}

.inbox-container #conversation-list {
    /* height: auto; */
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* min-height: calc(100dvh - 150px); */
    max-height: calc(100vh - 150px);
    /* Limit height for scrollbar */
}

.inbox-container .search-container {
    flex: 0 0 auto;
    /* Fixed search field */
    padding-bottom: 10px;
}

.inbox-container .conversation-list-scrollable {
    flex: 1 1 auto;
    /* Fill available space */
    overflow-y: auto;
    /* Restore scrollbar */
    max-height: calc(100vh - 300px);
    /* Ensure scrollbar kicks in */
}

.inbox-container .list-group {
    margin-bottom: 0;
    /* Prevent extra spacing */
}

.inbox-container #message-thread-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inbox-container #message-thread {
    flex: 1 0 auto;
    overflow-y: auto;
    padding-bottom: 10px;
    min-height: 0;
}

.inbox-container .message-form-container {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
    flex: 0 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.inbox-container #message_content {
    max-height: 150px;
    resize: vertical;
}

.inbox-container .conversation-list-scrollable::-webkit-scrollbar,
.messaging-component .card-body::-webkit-scrollbar,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar {
    width: 8px;
}

.inbox-container .conversation-list-scrollable::-webkit-scrollbar-thumb,
.messaging-component .card-body::-webkit-scrollbar-thumb,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.inbox-container .conversation-list-scrollable::-webkit-scrollbar-thumb:hover,
.messaging-component .card-body::-webkit-scrollbar-thumb:hover,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width: 767px) {

    .inbox-container .conversation-list-scrollable {
        height: auto;
        /* Allow natural height on mobile */
        overflow-y: auto;
        /* Ensure scrollbar */
        max-height: 50vh;
        /* Limit height on mobile */
    }

    .messages-page .list-group-item {
        padding-right: 0.5rem;
        padding-left: 0.5rem; /* Reduce padding on mobile  */
    }}

/* Bootstrap Overrides */
.messaging-component {
    width: 100%;
    height: 100%;
    /* Ensure it takes full parent height */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-bottom: 0 !important;
}

.messaging-component .card {
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: 0.375rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
}

.messaging-component .card-body {
    overflow-y: auto;
    flex: 1 0 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.messaging-component form {
    background-color: #f8f9fa;
    padding: 0.5rem !important;
    border-top: none;
}

.messaging-component .input-group .form-control {
    background-color: #fff;
}

.messaging-component .input-group .form-control:focus {
    box-shadow: none;
    background-color: #fff;
}

.messaging-component .input-group .btn-link {
    padding: 0 0.75rem;
}

.messaging-component .bi-check {
    vertical-align: middle;
}

.messaging-component .bi-send-fill {
    transition: color 0.2s;
    color: #ffffff;
}

.messaging-component .bi-send-fill:hover {
    color: #ffffff;
}

.messaging-component .btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: var(--bs-body-light) !important;
}

/* Mobile view */
@media (max-width: 576px) {

    .inbox-container .messaging-component {
        display: none !important;
    }

    body:has(.inbox-container .messaging-component.active)>*:not(.wrapper) {
        display: none !important; /* Hide nav and footer on thread view */
    }

    body:has(.inbox-container .messaging-component.active) {
        position: fixed;
        width: 100%;
        overflow: hidden;
    }
    
    .mobile-full-height {
        height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow-y: hidden;
        margin-top: -2rem;
        
    }

    .inbox-container .messaging-component.active {
        display: flex !important;
        flex: 0 0 100% !important;
    } 

    .inbox-container #message-thread {
        overflow: hidden;
        flex: 0 0 100%;

    }

    #conversation-list.active {
        display: block !important;
    }

    .messaging-component .card {
        flex: 0 0 100%;
        display: flex;
        flex-direction: column;

    }

    .messaging-component .card-body {
        flex: 1;
        overflow-y: hidden;
    }

    .messaging-component form {
        padding: 0.5rem;
        border-radius: 0 0 0.375rem 0.375rem;
        border-top: 1px solid rgba(0, 0, 0, .125);
    }

    .inbox-container #message-thread-inner {
        overflow-y: auto !important;
        display: flex !important;
        flex: 1;
        min-height: 0;
            /* Important to allow shrinking with keypad*/
    }

    .inbox-container .message-form-container {
        position: sticky;
        bottom: 0;
        z-index: 10;     }

    /* .no-conversations+.col-md-8 .messaging-component {
        display: none !important;
    } */
 }

.view-listing .messaging-component {
    height: auto;
    /* Natural height */
    min-height: auto;
    /* No forced viewport height */
    display: block;
    /* Avoid flex stretching */
    padding-bottom: 1rem;
    /* Space above footer */
}

.view-listing .messaging-component .card {
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: 0.375rem;
    overflow: hidden;
    display: block;
    /* Natural height */
    height: auto;
    /* Short card */
    box-sizing: border-box;
}

.view-listing .messaging-component .card-body {
    overflow-y: auto;
    /* Ensure scrolling */
    max-height: 200px;
    /* Short thread height */
    height: auto;
    /* Allow natural height */
    padding-bottom: 0;
    box-sizing: border-box;
    display: flex;
    /* Ensure flex for message alignment */
    flex-direction: column;
    /* Vertical stacking */
}

.view-listing .messaging-component .message-form-container {
    position: relative;
    /* Non-sticky for view_listing */
    background: white;
    z-index: 10;
    padding: 0;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .view-listing .messaging-component .card-body {
        max-height: 200px;
        /* Mobile height */
        overflow-y: auto;
        height: auto;
        display: flex;
        flex-direction: column;
    }
}

/* -------------------------------- */
/* FOOTER + MAIN                    */
/* -------------------------------- */

/* Additional: Custom footer styling */
footer {
    background-color: var(--footer-bg);
    color: var(--bs-body-color);
    margin-top: auto;
    flex-shrink: 0;
}

/* Bootstrap: Customises Bootstrap's footer links */
footer a,
footer .nav-link,
footer .link-body-emphasis {
    color: var(--bs-secondary);
    text-decoration: none;
    font-weight: 500;
}

/* Bootstrap: Customises Bootstrap's footer link hover */
footer a:hover,
footer .nav-link:hover,
footer .link-body-emphasis:hover {
    color: var(--theme-accent);
}

/* Bootstrap: Customises Bootstrap's footer icon */
footer a .bi {
    color: var(--bs-secondary);
}

/* Bootstrap: Customises Bootstrap's footer icon hover */
footer a:hover .bi {
    color: var(--theme-accent);
}

/* -------------------------------- */
/* MISC                             */
/* -------------------------------- */

/* Additional: Custom search summary reset */
#searchSummary {
    all: revert;
}

[id] {
    scroll-margin-top: 120px;
}

.filepond--item {
    width: 45%;
    /* Two items per row on mobile */
    position: relative;
    overflow: hidden;
}

.filepond--file-info {
    display: none !important;
    /* Hide file name */
}

@media (min-width: 50em) {
    .filepond--item {
        width: 32%;
        /* Three items per row on desktop */
    }
}

.filepond--drop-label {
    min-height: 3em !important;
}


/* Fixed-width RHS so buttons are equal width and text wraps earlier */
.saved-search-actions { flex: 0 0 7.5rem; } 


li.product-item {
  display: flex;
  align-items: flex-start;
}

li.product-item svg {
  flex-shrink: 0;
  margin-right: 0.5rem; /* space between icon and text */
}


/* PWA-only: give the thread a little space above the sticky composer */
@media (display-mode: standalone) {
  .inbox-container #message-thread-inner { padding-bottom: 110px; }
}


/* Flyer modal */
.custom-flyer-modal {
  max-width: 650px;   
  margin: auto;       /* center horizontally */
}


