/* ===================================================================
   1. Reset and Root Variables
   =================================================================== */

/* Basic Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root Variables for Theming */
:root {
    /* Colors */
    --primary-color: #1e90ff;        /* Dodger Blue */
    --secondary-color: #ffffff;      /* White */
    --accent-color: #1e90ff;         /* odger Blue  */
    --text-color: #333333;           /* Dark Gray */
    --background-color: #f4f4f4;     /* Light Gray */
    --nav-background-color: #ffffff; /* Navbar Background */
    --footer-background-color: #1e90ff;
    --footer-text-color: #ffffff;
    --sidebar-background-color: #ffffff;
    --border-color: #dddddd;
    --hover-color: #1c86ee;
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-size-base: 16px;
    --font-family-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Sizing */
    --icon-size: 1.2em;

    /* Transitions */
    --transition-speed: 0.3s;

    /* Buttons */
    --button-text-color: #ffffff;
    --button-background-color: var(--primary-color);

    /* Dark Mode */
    --dark-primary-color: #1a73e8;
    --dark-secondary-color: black;
    --dark-text-color: white;
    --dark-background-color: black;
    --dark-nav-background-color: black;
    --dark-footer-background-color: #1a73e8;
    --dark-footer-text-color: #e0e0e0;
    --dark-sidebar-background-color: black;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: var(--dark-primary-color);
    --secondary-color: var(--dark-secondary-color);
    --text-color: var(--dark-text-color);
    --background-color: var(--dark-background-color);
    --nav-background-color: var(--dark-nav-background-color);
    --footer-background-color: var(--dark-footer-background-color);
    --footer-text-color: var(--dark-footer-text-color);
    --sidebar-background-color: var(--dark-sidebar-background-color);
	
	--content-background-color: black;
    --content-text-color: #e0e0e0; /* Light text for dark mode */
}

/* ===================================================================
   2. Global Styles
   =================================================================== */

body {
    font-family: var(--font-family-base);
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: var(--font-size-base);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    padding-top: var(--header-offset, 70px); /* Offset for fixed header (set dynamically) */
}


a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-color);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
}


a.button {
   # font-family: Arial, sans-serif;
    #font-size: 16px;
    #background-color: darkgreen;
    color: white;
    border: none;
    #border-radius: 5px;
   # padding: 10px 20px;
   # cursor: pointer;
    text-decoration: none; /* Removes underline */
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: green; /* Slightly lighter green on hover */
    text-decoration: none; /* Ensures no underline on hover */
}

button,
input[type="submit"] {
    cursor: pointer;
}

/* ===================================================================
   3. Header and Navigation
   =================================================================== */

header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--nav-background-color);
    z-index: 1000;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
    padding: 1px 1px; /* Reduced padding */
}

.navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1px 1px; /* Reduced padding */
}
/* Base styles */
.logo {
    flex: 1 1 auto;
    text-align: left;
    margin-bottom: 0; /* Remove unnecessary margin */
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none; /* No underline */
    color: inherit; /* Inherit text color */
}

.logo a:hover {
    color: inherit; /* Consistent color on hover */
    text-decoration: none; /* No underline on hover */
    outline: none; /* Removes focus outline */
}

.logo h1 {
    font-size: 1.8em; /* Good size for desktop */
    margin: 0;
    font-weight: bold; /* Make the font bold */
    letter-spacing: 0.5px; /* Subtle letter spacing */
    text-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.1); /* Depth effect */
}

.logo .logo-calgary {
    color: var(--text-color);
}

.logo .logo-finder {
    color: green;
    font-style: italic;
    font-weight: bold; /* Stand out */
}

.logo .logo-com {
    color: var(--text-color);
    opacity: 0.85; /* Subtle effect */
}

.logo .logo-com::after {
    content: ""; /* Pseudo-element for flag */
    display: inline-block;
    width: 20px; /* Adjust width for flag */
    height: 14px; /* Maintain aspect ratio */
    #background-image: url("https://upload.wikimedia.org/wikipedia/commons/5/59/Flag_of_Lebanon.svg");
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 5px; /* Space between text and flag */
    vertical-align: middle; /* Align with text */
}

/* Mobile-specific styles */
/* Mobile-specific styles */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2.5em; /* Larger font for mobile */
    }

    .logo {
        padding: 0.5em; /* Add padding for better spacing */
    }

    .logo a {
        padding: 0.8em; /* Increase touch target size */
    }

    .logo .logo-com::after {
        width: 25px; /* Increase flag size for mobile */
        height: 18px; /* Maintain aspect ratio for flag */
    }
}
	
.search-section {
    flex: 2 1 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
}




.search-section form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1px; /* Reduced gap */
}

/* Additional Styles for Search Inputs */
.search-section input[type="text"],
.search-section select {
    background-color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1em;
    padding: 8px 10px;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    width: 35%; /* Added this line to reduce the width to 25% */

}

.search-button {
    flex: 2 1 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
}


.search-section input[type="text"]:focus,
.search-section select:focus {
    border-color: var(--hover-color);
    box-shadow: 0 0 5px var(--hover-color);
    outline: none;
}

/* Style placeholder text */
.search-section input[type="text"]::placeholder {
    color: var(--text-color);
    opacity: 0.7;
}


.nav-links {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0; /* Remove unnecessary margin */
}

.nav-links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
    margin: 0;
}

.nav-links ul li {
    margin: 2px;
    display: flex;
    align-items: center;
}

.nav-region-li {
    display: flex !important;
    align-items: center !important;
    gap: 0;
}
.region-select {
    appearance: auto;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 0.78em;
    background: var(--secondary-color, #f8f8f8);
    color: var(--text-color);
    cursor: pointer;
    vertical-align: middle;
    line-height: 1.3;
}
[data-theme="dark"] .region-select {
    background: #111;
    border-color: #333;
    color: #ddd;
}

.nav-links ul li a,
.nav-links ul li strong {
    padding: 6px 10px; /* Reduced padding */
    background-color: var(--button-background-color);
    color: var(--button-text-color);
    border-radius: 5px;
    font-size: 0.9em; /* Slightly reduced font size */
    font-weight: bold;
    transition: background-color var(--transition-speed);
}

.nav-links ul li a:hover {
    background-color: var(--hover-color);
}

.nav-guest {
    background-color: transparent;
    color: var(--text-color);
}

.nav-guest:hover {
    background-color: transparent;
}

.nav-links select {
    padding: 6px 8px; /* Reduced padding */
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-size: 0.85em; /* Slightly reduced font size */
    cursor: pointer;
    transition: border-color var(--transition-speed);
}

.nav-links select:hover {
    border-color: var(--hover-color);
}

.theme-switch {
    display: flex;
    align-items: center;
    margin-left: 5px; /* Reduced margin */
}

.theme-switch input {
    display: none;
}

.theme-switch label {
    cursor: pointer;
    font-size: 1.2em;
    color: var(--text-color);
    transition: color var(--transition-speed);
}

.theme-switch label:hover {
    color: var(--primary-color);
}

/* ===================================================================
   4. Main Layout
   =================================================================== */


/* Main Content Area */
.content {
    flex: 1;
    max-width: 100%;
    margin-left: 248px;
    padding: 10px;
    padding-top: 64px;
    background-color: var(--content-background-color, white);
    color: var(--content-text-color, black); /* Text color with fallback */
    transition: margin-left 0.3s ease, background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
}

/* Main Wrapper for Flex Layout */
.main-wrapper {
    display: flex;
    flex-direction: row; /* Allows sidebar and content to be side-by-side */
    flex-wrap: nowrap; /* Prevents wrapping of sidebar/content on larger screens */
    width: 100%; /* Full width */
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .content {
        margin-left: 0; /* Removes margin for smaller screens */
        padding-top: 10px; /* Adjusts padding for mobile view */
    }

    .main-wrapper {
        flex-direction: column; /* Stacks sidebar/content vertically on smaller screens */

    }
}

.sidebar {
    position: fixed;
    top: var(--header-offset, 70px);
    left: 0;
    width: 240px;
    max-width: 240px;
    background-color: var(--sidebar-background-color);
    padding: 6px 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow-y: auto;
    max-height: calc(100vh - var(--header-offset, 70px));
}

.sidebar h2 {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu li a {
    font-size: 0.95em;
    color: var(--text-color);
    transition: color var(--transition-speed);
}

.sidebar-menu li a:hover {
    color: var(--primary-color);
}

/* ===================================================================
   5. Forms
   =================================================================== */

form {
    width: 100%;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-size: 1em;
    transition: border-color var(--transition-speed);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
}

button,
input[type="submit"] {
    padding: 10px 20px;
    background-color: var(--button-background-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

button:hover,
input[type="submit"]:hover {
    background-color: var(--hover-color);
}

/* ===================================================================
   6. Buttons
   =================================================================== */

.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--button-background-color);
    color: var(--button-text-color);
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.button:hover {
   # background-color: var(--hover-color);
}

/* Specific Button Styles */
.btn-edit {
   # background-color: #28a745; /* Green for Edit */
}

.btn-edit:hover {
    #background-color: #218838;
}

.btn-delete {
  #  background-color: #dc3545; /* Red for Delete */
}

.btn-delete:hover {
   # background-color: #c82333;
}

.btn-back {
    #background-color: #6c757d; /* Gray for Back */
}

.btn-back:hover {
   # background-color: #5a6268;
}

.btn-flier {
   # background-color: #17a2b8; /* Teal for Print Flier */
}

.btn-flier:hover {
    background-color: #138496;
}

.btn-save {
    #background-color: white; /* Yellow for Save Ad */
    #color: #212529; /* Dark text for contrast */
}

.btn-save:hover {
   # background-color: #e0a800;
}

.btn-reply,
.btn-email {
    background-color: var(--accent-color);
}

.btn-reply:hover,
.btn-email:hover {
   # background-color: darkgreen;
}

/* ===================================================================
   7. Feature Buttons and Icons
   =================================================================== */

/* Feature Buttons Container */
.featured-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.featured-buttons .button {
    flex: 1 1 200px;
    max-width: 250px;
}

/* Feature Icons */
.featured-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.featured-icons .icon {
    font-size: 2em;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

.featured-icons .icon:hover {
    color: var(--hover-color);
}

/* ===================================================================
   8. Breadcrumb Navigation
   =================================================================== */

.breadcrumb {
    display: flex;
    list-style: none;
    padding: 10px 15px;
    background-color: var(--background-color);
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--shadow-color);
    margin-bottom: 20px;
}

.breadcrumb li {
    margin-right: 5px;
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: 5px;
    color: var(--text-color);
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ===================================================================
   9. Featured Listings
   =================================================================== */

.featured-listings {
    padding: 40px 20px;
    background-color: var(--background-color);
}

.featured-listings h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

/* Listing Grid Container */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive columns */
    gap: 20px; /* Space between items */
}

/* Individual Listing Item */
.listing-item {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    padding: 15px; /* Optional: add padding for content inside */
}

.listing-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.listing-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.listing-item h3 {
    padding: 15px;
    font-size: 1.5em;
    color: var(--text-color);
    text-align: center;
}

.listing-item p {
    padding: 0 15px 15px;
    color: #6c757d;
    text-align: center;
}
[data-theme="dark"] .listing-item p { color: #bbb; }

/* ===================================================================
   10. Testimonials
   =================================================================== */

.testimonials {
    padding: 40px 20px;
    background-color: var(--background-color);
}

.testimonials h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.testimonial-item {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: box-shadow var(--transition-speed);
}

.testimonial-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.testimonial-item p {
    font-style: italic;
    margin-bottom: 15px;
    color: #555555;
}

.testimonial-item h4 {
    text-align: right;
    color: var(--primary-color);
}

/* ===================================================================
   11. Latest News
   =================================================================== */

.latest-news {
    padding: 40px 20px;
    background-color: var(--background-color);
}

.latest-news h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.news-item {
    background-color: var(--secondary-color);
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: box-shadow var(--transition-speed);
}

.news-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.news-item h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.news-item p {
    color: #6c757d;
    font-size: 1em;
}

.latest-news .cta-section {
    text-align: center;
    margin-top: 30px;
}

.latest-news .cta-section .cta-button {
    background-color: var(--primary-color);
    padding: 10px 20px;
    color: var(--secondary-color);
    border-radius: 5px;
    transition: background-color var(--transition-speed);
}

.latest-news .cta-section .cta-button:hover {
    background-color: var(--hover-color);
}

/* ===================================================================
   12. Footer
   =================================================================== */

footer {
    background-color: var(--footer-background-color);
    padding: 15px 20px;
    text-align: center;
    color: var(--footer-text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.footer-content a {
    color: var(--footer-text-color);
    text-decoration: none;
    font-weight: bold;
    transition: color var(--transition-speed);
}

.footer-content a:hover {
    color: var(--hover-color);
}

.footer-content p {
    margin: 10px 0;
}

.footer-content a[href="#top"] {
    display: block;
    margin-top: 10px;
    color: var(--footer-text-color);
    font-weight: bold;
}

.footer-content a[href="#top"]:hover {
    color: var(--hover-color);
}

/* ===================================================================
   13. Featured Buttons and Icons
   =================================================================== */

/* Feature Buttons Container */
.featured-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.featured-buttons .button {
    flex: 1 1 200px;
    max-width: 250px;
}

/* Feature Icons */
.featured-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.featured-icons .icon {
    font-size: 2em;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

.featured-icons .icon:hover {
    color: var(--hover-color);
}

/* ===================================================================
   14. Breadcrumb Navigation
   =================================================================== */

.breadcrumb {
    display: flex;
    list-style: none;
    padding: 10px 15px;
    background-color: var(--background-color);
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--shadow-color);
    margin-bottom: 20px;
}

.breadcrumb li {
    margin-right: 5px;
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: 5px;
    color: var(--text-color);
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ===================================================================
   15. Featured Listings
   =================================================================== */

.featured-listings {
    padding: 40px 20px;
    background-color: var(--background-color);
}

.featured-listings h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.listing-item {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.listing-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.listing-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.listing-item h3 {
    padding: 15px;
    font-size: 1.5em;
    color: var(--text-color);
    text-align: center;
}

.listing-item p {
    padding: 0 15px 15px;
    color: #6c757d;
    text-align: center;
}

/* ===================================================================
   16. Testimonials
   =================================================================== */

.testimonials {
    padding: 40px 20px;
    background-color: var(--background-color);
}

.testimonials h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.testimonial-item {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: box-shadow var(--transition-speed);
}

.testimonial-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.testimonial-item p {
    font-style: italic;
    margin-bottom: 15px;
    color: #555555;
}

.testimonial-item h4 {
    text-align: right;
    color: var(--primary-color);
}

/* ===================================================================
   17. Latest News
   =================================================================== */

.latest-news {
    padding: 40px 20px;
    background-color: var(--background-color);
}

.latest-news h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.news-item {
    background-color: var(--secondary-color);
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: box-shadow var(--transition-speed);
}

.news-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.news-item h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.news-item p {
    color: #6c757d;
    font-size: 1em;
}

.latest-news .cta-section {
    text-align: center;
    margin-top: 30px;
}

.latest-news .cta-section .cta-button {
    background-color: var(--primary-color);
    padding: 10px 20px;
    color: var(--secondary-color);
    border-radius: 5px;
    transition: background-color var(--transition-speed);
}

.latest-news .cta-section .cta-button:hover {
    background-color: var(--hover-color);
}

/* ===================================================================
   18. Footer
   =================================================================== */

footer {
    background-color: var(--footer-background-color);
    padding: 15px 20px;
    text-align: center;
    color: var(--footer-text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.footer-content a {
    color: var(--footer-text-color);
    text-decoration: none;
    font-weight: bold;
    transition: color var(--transition-speed);
}

.footer-content a:hover {
    color: var(--hover-color);
}

.footer-content p {
    margin: 10px 0;
}

.footer-content a[href="#top"] {
    display: block;
    margin-top: 10px;
    color: var(--footer-text-color);
    font-weight: bold;
}

.footer-content a[href="#top"]:hover {
    color: var(--hover-color);
}

/* ===================================================================
   19. Feature Buttons and Icons
   =================================================================== */

/* Feature Buttons Container */
.featured-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.featured-buttons .button {
    flex: 1 1 200px;
    max-width: 250px;
}

/* Feature Icons */
.featured-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.featured-icons .icon {
    font-size: 2em;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

.featured-icons .icon:hover {
    color: var(--hover-color);
}

/* ===================================================================
   20. Breadcrumb Navigation
   =================================================================== */

.breadcrumb {
    display: flex;
    list-style: none;
    padding: 10px 15px;
    background-color: var(--background-color);
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--shadow-color);
    margin-bottom: 20px;
}

.breadcrumb li {
    margin-right: 5px;
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: 5px;
    color: var(--text-color);
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb a:hover {
    text-decoration: underline;
}



/* ===================================================================
   21. Listing Details
   =================================================================== */

.listing-title {
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
    word-wrap: break-word;
}

/* Listing Photos Slider */
.listing-photos-slider {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slider {
    width: 100%;
    max-width: 800px;
    position: relative;
}

/* Detail page — desktop layout: image + key details side-by-side */
.detail-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
    gap: 16px;
    align-items: start;
    margin: 0 0 14px;
}

.detail-top-media { min-width: 0; }
.detail-top-summary { min-width: 0; }

/* Let the slider fill the left column (remove centered max-width feel) */
.detail-top-media .listing-photos-slider {
    align-items: stretch;
}
.detail-top-media .slider {
    max-width: none;
}

.detail-summary-card {
    background: var(--secondary-color, #fff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
[data-theme="dark"] .detail-summary-card {
    background: #000;
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.detail-summary-title {
    margin: 0 0 6px;
    font-size: 1.05em;
    font-weight: 800;
    color: var(--text-color, #333);
    line-height: 1.25;
}
[data-theme="dark"] .detail-summary-title { color: #fff; }

.detail-summary-price {
    margin: 0 0 8px;
    font-size: 1.35em;
    font-weight: 900;
    color: var(--primary-color, #1e90ff);
}

.detail-summary-meta {
    margin: 0 0 10px;
    font-size: 0.86em;
    color: rgba(0,0,0,0.65);
}
[data-theme="dark"] .detail-summary-meta { color: rgba(255,255,255,0.7); }

.detail-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

.detail-summary-grid .ds-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.86em;
    line-height: 1.25;
}

.detail-summary-grid .ds-label {
    color: rgba(0,0,0,0.55);
    white-space: nowrap;
}
[data-theme="dark"] .detail-summary-grid .ds-label { color: rgba(255,255,255,0.65); }

.detail-summary-grid .ds-val {
    color: var(--text-color, #333);
    font-weight: 700;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[data-theme="dark"] .detail-summary-grid .ds-val { color: #fff; }

@media (max-width: 900px) {
    .detail-top-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .detail-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 420px) {
    .detail-summary-grid { grid-template-columns: 1fr; }
}

.slider-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 2px 6px var(--shadow-color);
}

.slider-images {
    display: flex;
    transition: transform var(--transition-speed) ease-in-out;
}

.slider-images img {
    width: 100%;
    flex-shrink: 0;
    object-fit: cover;
}

.slider-nav {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 160px;
    height: 160px;
    cursor: pointer;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    transition: border var(--transition-speed);
}

.thumbnail img:hover,
.thumbnail.active img {
    border-color: darkgreen;
}

/* Listing Details Grid */
.listing-details {
   display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    #gap: 20px;
    #margin-bottom: 30px;
   # padding: 0 15px;
}

.listing-item.full-width {
    grid-column: 1 / -1;
    background-color: var(--sidebar-background-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 8px var(--shadow-color);
}

/* Listing Item Styles */
.title-large,
.item-title {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
    word-wrap: break-word;
}

.item-title i {
    font-size: 1.2em;
}

.item-value {
    color: var(--text-color);
    font-size: 1em;
    margin-top: 10px;
    word-wrap: break-word;
}

.listing-item {
    background-color: var(--sidebar-background-color);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    overflow: hidden;
}

.listing-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Scrollable Options */
.listing-item .item-value ul {
    max-height: 150px;
    overflow-y: auto;
    padding-left: 20px;
}

/* Ensure all Font Awesome icons load */
[class^="fas"], [class*=" fas"] {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

/* Ad Actions */
.ad-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.ad-actions .button {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color var(--transition-speed);
    text-align: center;
}

.ad-actions .button:hover {
    background-color: var(--hover-color);
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 10px 15px 0;
}

.admin-actions .button {
    background-color: #e74c3c;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color var(--transition-speed);
}

.admin-actions .button.btn-edit {
    background-color: #27ae60;
}

.admin-actions .button:hover {
    opacity: 0.8;
}

/* Contact Seller & Email Friend Forms */
.contact-seller,
.email-friend {
    background-color: var(--sidebar-background-color);
    padding: 20px;
    margin: 20px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow-color);
}

.contact-seller h3,
.email-friend h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.contact-seller form,
.email-friend form {
    display: flex;
    flex-direction: column;
}

.contact-seller label,
.email-friend label {
    margin-top: 10px;
    color: var(--text-color);
}

.contact-seller input,
.email-friend input,
.contact-seller textarea,
.email-friend textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: 5px;
    font-size: 1em;
}

.contact-seller button,
.email-friend button {
    margin-top: 15px;
    padding: 10px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.contact-seller button:hover,
.email-friend button:hover {
    background-color: var(--hover-color);
}

/* Social Sharing */
.social-sharing {
    text-align: center;
    margin: 20px 0;
}

.social-sharing a {
    color: var(--primary-color);
    font-size: 1.2em;
    transition: color var(--transition-speed);
}

.social-sharing a:hover {
    color: var(--hover-color);
}


/* ===================================================================
   22. Responsive Design
   =================================================================== */

/* Medium Screens (Tablets) */
@media (max-width: 1024px) {
    .listing-details {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .admin-actions {
        justify-content: center;
        margin: 10px 0;
    }
}

/* Small Screens (Mobiles) */
@media (max-width: 768px) {
    .main-wrapper {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .listing-title {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .slider {
        max-width: 100%;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .listing-details {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 0 6px;
    }

    .listing-item {
        padding: 8px 10px;
    }

    .item-title {
        font-size: 1em;
    }

    .item-value {
        font-size: 0.95em;
    }

.ad-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Creates a responsive grid with a minimum button width */
    gap: 5px; /* Adds space between buttons */
    flex-wrap: wrap; /* Allows buttons to wrap if there's not enough space horizontally */
    justify-content: center; /* Centers the buttons within the container */

}

.ad-actions .button {
    text-align: center;
    padding: 5px 10px; /* Sets padding to make the buttons compact */
    box-sizing: border-box;
	    width: auto; /* Ensures button width is only as wide as its content */

}

    .contact-seller,
    .email-friend {
        margin: 20px 10px;
    }
}

/* ===================================================================
   22. Responsive Design
   =================================================================== */

/* Medium Screens (Tablets) */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: 2;
        margin-bottom: 10px;
    }

    .content {
        width: 100%;
        order: 1;
    }

    .ad-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .breadcrumb {
        flex-wrap: wrap;
    }
}

/* Small Screens (Mobiles) */
@media (max-width: 768px) {
   

.main-wrapper {
    width: 100%;
    max-width: 100vw; /* Prevents overflow beyond the viewport width */
    box-sizing: border-box; /* Includes padding and border within the width */
    overflow-x: hidden; /* Hides any potential horizontal overflow */
    order: 1;
}


   /* Header Adjustments */
    .navbar {
        flex-direction: column;
        align-items: center;
    }

    .logo {
        text-align: center;
       # margin-bottom: 0px;
    }

    .search-section {
        width: 100%;
        margin-bottom: 1px;
    }

    .search-section form {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .search-section input[type="text"] {
        flex: 1 1 auto;
    }

    .search-section select {
        flex: 0 0 auto;
        max-width: 120px;
    }

    .search-section button {
        flex: 0 0 auto;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .nav-links ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links ul li {
        margin: 1px;
    }

    .nav-links ul li a,
    .nav-links ul li strong {
        width: auto;
        padding: 1px 1px;
        font-size: 0.9em;
    }

    .theme-switch {
        justify-content: center;
        margin-top: 1px;
    }

    /* Ad Actions Adjustments */
    .ad-actions {
        flex-direction: column;
        align-items: center;
    }

    .ad-actions .button {
        flex: 1 1 45%;
        #max-width: 45%;
        #margin: 5px;
		color: white;
    }

    /* Feature Buttons Adjustments */
    .featured-buttons .button {
        flex: 1 1 100%;
        max-width: 100%;
    }

    /* Feature Icons Adjustments */
    .featured-icons .icon {
        font-size: 1.5em;
    }

    /* Detail Icons Adjustments */
    .detail-icons .icon {
        font-size: 1.2em;
    }
}


/* ===================================================================
   23. Additional Enhancements
   =================================================================== */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Scroll Padding to Prevent Overlap with Fixed Header */
body {
    padding-top: 70px; /* Adjust based on navbar height */
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    z-index: 1000;
    transition: background-color var(--transition-speed);
}

.scroll-top:hover {
    background-color: var(--hover-color);
}

/* Show the button when scrolling */
body.scrolled .scroll-top {
    display: block;
}

/* Icons Styling */
.icon {
    font-size: var(--icon-size);
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

.icon:hover {
    color: var(--hover-color);
}

/* Featured Icons */
.featured-icons {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.featured-icons .icon {
    font-size: 1.5em;
    color: var(--accent-color);
    transition: color var(--transition-speed);
}

.featured-icons .icon:hover {
    color: var(--hover-color);
}

/* ===================================================================
   24. Detail Section Enhancements
   =================================================================== */

/* Property Detail Container */
.property-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.property-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.property-images img {
    width: 100%;
    max-width: 300px;
    border-radius: 5px;
    transition: transform var(--transition-speed);
}

.property-images img:hover {
    transform: scale(1.05);
}

.property-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.property-info .info-item {
    background-color: var(--sidebar-background-color);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.property-info .info-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.property-description {
    background-color: var(--sidebar-background-color);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.property-description:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===================================================================
   Search Results Styles
   =================================================================== */

/* Listing Item */
.listing-item {
    background-color: var(--secondary-color, #fff);
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .listing-item {
        flex-direction: row;
    }
}

[data-theme="dark"] .listing-item {
    background-color: var(--dark-background-color); /* black */
    color: var(--dark-text-color); /* adjust text color as needed */
    border: 1px solid white;
    box-shadow: none;
}

[data-theme="dark"] .listing-item .item-title, 
[data-theme="dark"] .listing-item .item-value {
    color: #ffffff; /* set text inside the listing item to white */
}

.listing-content {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
}

@media (max-width: 768px) {
    .listing-content {
        flex-direction: column;
    }
}

/* Listing Image */
.listing-image {
    flex: 1;
    max-width: 300px;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Listing Details */
.listing-details {
    flex: 2;
    padding: 10px;
    box-sizing: border-box;
}

/* Title Styling */
.listing-title {
    font-size: 1.5em;
    margin: 0 0 10px 0;
    color: var(--text-color, #333);
}

.listing-title a {
    color: inherit;
    text-decoration: none;
}

.listing-title a:hover {
    color: #007bff;
}

[data-theme="dark"] .listing-title {
    color: #ffffff;
}

/* Distance Info */
.distance {
    font-size: 0.9em; 
    color: #28a745;
    margin-bottom: 10px;
}

/* Detail Item */
.detail-item {
    font-size: 0.9em;
    color: var(--text-color, #555);
    margin-bottom: 5px;
}

.detail-item strong {
    color: var(--text-color, #333);
    margin-right: 5px;
}

[data-theme="dark"] .detail-item {
    color: #ddd;
}

[data-theme="dark"] .detail-item strong {
    color: #fff;
}

/* Listing Footer */
.listing-footer {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.listing-footer .btn {
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
    font-size: 0.9em;
    transition: background-color 0.2s;
    background-color: #007bff;
}

.listing-footer .btn:hover {
    background-color: #0056b3;
}

/* Ensuring Equal Widths */
@media (min-width: 768px) {
    .listing-item {
        flex-direction: row;
        align-items: stretch;
    }
    .listing-content {
        flex: 1;
    }
}

/* Additional Styling */
.searchImage {
    width: 100%;
    height: auto;
    display: block;
}

[data-theme="dark"] .listing-title a {
    color: #ffffff;
}

/* ===================================================================
   Mobile-Specific Styles (Add at the bottom of your existing CSS)
   =================================================================== */

/* Mobile Styles for Devices with Width up to 768px */
@media (max-width: 768px) {
    /* General Adjustments */
    body {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Header Adjustments */
    header {
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1000;
        background-color: #ffffff;
        padding: 5px 0;
    }

    .navbar {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0 10px;
    }

    /* Logo Centered */
    .logo {
        text-align: center;
        margin-bottom: 5px;
    }

    .logo h1 {
        font-size: 1.2em;
        margin: 0;
    }

    /* Navigation Links hidden on mobile — bottom bar used instead */
    .nav-links {
        display: none !important;
    }

    .nav-links ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .nav-links ul li {
        margin: 2px 5px;
    }

    .nav-links ul li a,
    .nav-links ul li strong {
        font-size: 0.8em;
        padding: 4px 6px;
        white-space: nowrap;
        color: #333;
        text-decoration: none;
    }

    .nav-links ul li a:hover {
        background-color: #f0f0f0;
    }

    /* Adjust Select Dropdown */
    .nav-links ul li select {
        padding: 4px 6px;
        font-size: 0.8em;
        border: 1px solid #ccc;
        border-radius: 4px;
        margin: 2px 5px;
    }

    /* Theme Switch */
    .theme-switch {
        margin-left: 5px;
    }

    .theme-switch label {
        font-size: 1.2em;
        color: #333;
    }

    /* Search Section Adjustments */
    .search-section {
        width: 100%;
        padding: 5px 10px;
    }

    .search-section form {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }

    .search-section input[type="text"] {
        flex: 1 1 auto;
        margin-right: 5px;
        font-size: 0.9em;
        padding: 8px;
    }

    .search-section select {
        flex: 0 0 auto;
        margin-right: 5px;
        font-size: 0.9em;
        padding: 8px;
        max-width: 100px;
    }

    .search-section button {
        flex: 0 0 auto;
        font-size: 0.9em;
        padding: 8px 12px;
    }

    /* Adjust Button Styles (Use Blue) */
    .search-section button,
    .nav-links ul li a,
    button,
    input[type="submit"] {
        background-color: #1e90ff; /* Your blue color */
        color: #ffffff;
        border: none;
        border-radius: 4px;
        text-align: center;
    }

    .search-section button:hover,
    .nav-links ul li a:hover,
    button:hover,
    input[type="submit"]:hover {
        background-color: #1c86ee;
    }

    /* Sidebar Adjustments */
    .sidebar {
        display: none;
    }

    /* Content Adjustments */
    .content {
        margin: 0;
        padding: 10px;
        margin-top: 0;
    }

    /* Footer Adjustments */
    footer {
        padding: 10px;
        text-align: center;
    }

    /* Adjustments for Detail Page */
    .detail-page {
        padding: 10px;
    }

    /* Dark Mode Adjustments */
    [data-theme="dark"] body {
        background-color: #000000;
        color: #ffffff;
    }

    [data-theme="dark"] header,
    [data-theme="dark"] .search-section,
    [data-theme="dark"] .nav-links,
    [data-theme="dark"] .content,
    [data-theme="dark"] footer {
        background-color: #000;
        color: #ffffff;
    }

    [data-theme="dark"] .nav-links ul li a {
        color: #ffffff;
    }

    [data-theme="dark"] .nav-links ul li a:hover {
        background-color: #0a0a0a;
    }

    [data-theme="dark"] .search-section input,
    [data-theme="dark"] .search-section select,
    [data-theme="dark"] .search-section button {
        background-color: #000;
        color: #ffffff;
        border: 1px solid #333;
    }

    [data-theme="dark"] .search-section button {
        background-color: #1e90ff;
        color: #ffffff;
    }

    [data-theme="dark"] .search-section button:hover {
        background-color: #1c86ee;
    }

    /* Adjustments for Icons and Selects */
    .nav-links ul li .fa-facebook-square,
    .nav-links ul li .fas.fa-moon {
        font-size: 1.2em;
    }

    /* Reduce Padding and Margins */
    .navbar,
    .nav-links ul li,
    .search-section form {
        margin: 0;
        padding: 0;
    }
}

/* Mobile Styles for Devices with Width up to 480px */
@media (max-width: 480px) {
    /* Further Adjustments */
    .navbar {
        padding: 0 5px;
    }

    .logo h1 {
        font-size: 1em;
    }

    .nav-links ul li a,
    .nav-links ul li strong {
        font-size: 0.7em;
        padding: 4px 5px;
    }

    .nav-links ul li select {
        font-size: 0.7em;
        padding: 4px 5px;
    }

    .search-section input[type="text"],
    .search-section select,
    .search-section button {
        font-size: 0.8em;
        padding: 6px;
    }

    .content {
        padding: 8px;
        margin-top: 0;
    }

    button,
    input[type="submit"] {
        font-size: 0.8em;
        padding: 6px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 0.8em;
        padding: 6px;
    }
}



@media (max-width: 768px) {
    .content {
        padding-top: 4px;
    }
}


/* ===================================================================
   FEATURED ADS GRID — Responsive Card Layout
   =================================================================== */

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 10px 0;
}

.featured-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    background: var(--secondary-color, #fff);
    transition: transform 0.25s, box-shadow 0.25s;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.featured-card a {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.featured-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.featured-card-info {
    padding: 10px 12px;
    background: rgba(0,0,0,0.80);
    color: #fff;
}

.featured-card-info h2 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-card-price {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary-color, #1e90ff);
    color: #fff;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

[data-theme="dark"] .featured-card {
    background: #000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

[data-theme="dark"] .featured-card-info {
    background: rgba(0,0,0,0.90);
}

@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .featured-card img {
        height: 140px;
    }
    .featured-card-info {
        padding: 8px 10px;
    }
    .featured-card-info h2 {
        font-size: 0.82rem;
    }
}

@media (max-width: 420px) {
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .featured-card img {
        height: 180px;
    }
}

/* ===================================================================
   2026 IMPROVEMENTS — Mobile-First Enhancements & Fixes
   These use !important to override earlier conflicting media queries
   =================================================================== */

/* ---- Logo: prevent text wrapping ---- */
.logo h1 {
    white-space: nowrap;
}

/* ---- Mobile header layout (max 768px) ---- */
@media (max-width: 768px) {

    /* Header: FIXED at top, thin, stays when scrolling */
    header {
        position: fixed !important;
        width: 100% !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1000 !important;
        background-color: var(--nav-background-color, #ffffff) !important;
        padding: 0 !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.12) !important;
    }

    [data-theme="dark"] header {
        background-color: var(--dark-nav-background-color, #000) !important;
    }

    /* Navbar: hamburger left, logo centered, balanced layout */
    .navbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        padding: 0 6px !important;
        gap: 0 !important;
        align-items: center !important;
        margin: 0 !important;
        min-height: 44px !important;
    }

    /* Logo: centered in header */
    .logo {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 1 auto !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        text-align: center !important;
        order: 1 !important;
    }

    .logo a {
        padding: 0 !important;
        margin: 0 !important;
    }

    .logo h1 {
        font-size: 1.25em !important;
        margin: 0 !important;
        line-height: 1 !important;
    }

    /* Hamburger: left side */
    .mobile-nav-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        background-color: var(--primary-color) !important;
        color: #fff !important;
        border-radius: 6px !important;
        font-size: 16px !important;
        border: none !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
        transition: background-color 0.2s !important;
        order: 0 !important;
    }

    /* Spacer to balance hamburger for centered logo */
    .header-spacer {
        width: 36px !important;
        min-width: 36px !important;
        flex-shrink: 0 !important;
        order: 2 !important;
    }

    .mobile-nav-toggle:hover,
    .mobile-nav-toggle.nav-toggle-active {
        background-color: var(--hover-color) !important;
    }

    .mobile-nav-toggle.nav-toggle-active .fa-bars:before {
        content: "\f00d";
    }

    /* Title banner: show on mobile (thin single line) */
    .header-title-banner {
        display: block !important;
        flex: 1 1 100% !important;
        order: 6 !important;
        width: 100% !important;
        font-size: 0.78em !important;
        font-weight: 500 !important;
        line-height: 1.2 !important;
        padding: 3px 10px 4px !important;
        color: var(--text-color, #333) !important;
        background: rgba(0,0,0,0.02) !important;
        border-top: 1px solid rgba(0,0,0,0.06) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .header-title-banner:empty {
        display: none !important;
    }

    [data-theme="dark"] .header-title-banner {
        color: #ddd !important;
        background: rgba(255,255,255,0.03) !important;
        border-top-color: rgba(255,255,255,0.08) !important;
    }

    /* ---- Search section: always visible on mobile ---- */
    .search-section {
        display: flex !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        order: 5 !important;
        margin: 0 !important;
        padding: 4px 6px !important;
        background: var(--nav-background-color, #fff) !important;
        border-top: 1px solid rgba(0,0,0,0.06) !important;
    }

    [data-theme="dark"] .search-section {
        background: var(--dark-nav-background-color, #000) !important;
        border-top-color: rgba(255,255,255,0.08) !important;
    }

    .search-section form {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        gap: 4px !important;
    }

    .search-section input[type="text"] {
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        font-size: 0.88em !important;
        padding: 7px !important;
        margin: 0 !important;
        border-radius: 6px !important;
    }

    .search-section select {
        flex: 0 0 auto !important;
        width: 90px !important;
        max-width: 100px !important;
        font-size: 0.82em !important;
        padding: 7px 4px !important;
        margin: 0 !important;
        border-radius: 6px !important;
    }

    .search-section button,
    .search-section input[type="submit"] {
        flex: 0 0 auto !important;
        padding: 7px 12px !important;
        font-size: 0.88em !important;
        border-radius: 6px !important;
    }

    /* ---- Nav links: hidden behind hamburger ---- */
    .nav-links {
        display: none !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        order: 10 !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }

    /* Nav links stay hidden on mobile — bottom bar handles navigation */

    .nav-links ul {
        width: 100% !important;
        display: flex !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 3px !important;
        padding: 3px 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .nav-links ul li {
        margin: 1px !important;
    }

    .nav-links ul li a,
    .nav-links ul li strong {
        font-size: 0.78em !important;
        padding: 4px 7px !important;
        display: inline-block !important;
        border-radius: 4px !important;
        white-space: nowrap !important;
    }

    .nav-links ul li select {
        font-size: 0.82em !important;
        padding: 4px 6px !important;
    }

    /* Truncate long text on small screens */
    .hide-mobile {
        display: none !important;
    }

    /* Content: offset for fixed header */
    .content {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 4px !important;
    }

    /* Main wrapper: offset handled by body padding-top (dynamic header height) */
    .main-wrapper {
        padding-top: 0 !important;
    }

    /* Hide ONLY the desktop sidebar on mobile (mobile slide-out uses .sidebar too) */
    .sidebar.desktop-menu {
        display: none !important;
    }

    /* Prevent horizontal overflow on mobile */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Photo slider: contained */
    .listing-photos-slider {
        width: 100% !important;
        overflow: hidden !important;
    }

    .slider img,
    .main-image {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
    }

    /* Thumbnails: prevent overflow on small screens */
    .slider-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .thumbnail {
        width: 60px !important;
        height: 60px !important;
        flex-shrink: 0 !important;
        overflow: hidden !important;
        border-radius: 6px !important;
    }

    .thumbnail img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Ad action buttons: 2-col grid on mobile */
    .ad-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        flex-direction: row !important;
        gap: 6px !important;
        padding: 8px 0 !important;
        align-items: stretch !important;
    }

    .ad-actions .button {
        text-align: center !important;
        padding: 10px 6px !important;
        font-size: 0.85em !important;
        width: 100% !important;
        box-sizing: border-box !important;
        color: #fff !important;
    }

    /* Listing details: 2-col grid so short fields sit side-by-side */
    .listing-details {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        padding: 0 4px !important;
    }

    .listing-item {
        width: 100% !important;
        overflow: hidden !important;
        word-break: break-word !important;
        padding: 8px 10px !important;
        margin-bottom: 0 !important;
    }

    .listing-item.full-width {
        grid-column: 1 / -1 !important;
    }

    .listing-item .item-title {
        font-size: 0.82em !important;
        gap: 4px !important;
    }

    .listing-item .item-title i {
        font-size: 0.95em !important;
    }

    .listing-item .item-value {
        font-size: 0.88em !important;
        margin-top: 4px !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Contact/friend forms: stack vertically */
    #contact, #friend {
        display: block !important;
        width: 100% !important;
        margin: 8px 0 !important;
    }

    /* Social sharing: full width */
    .social-sharing {
        width: 100% !important;
        text-align: center !important;
    }

    /* Overlays: proper sizing */
    .overlay-message {
        width: 90% !important;
        max-width: 300px !important;
    }

    #login-overlay > div {
        width: 90% !important;
        max-width: 320px !important;
    }

    /* Car manufacturer logos: contained sizing on mobile */
    .responsive-logo {
        max-height: 32px !important;
        max-width: 50px !important;
        margin-right: 6px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        vertical-align: middle !important;
        flex-shrink: 0 !important;
    }

    .item-value-logo {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .listing-item-logo {
        overflow: visible !important;
    }

    .listing-item-logo .item-text {
        font-size: 0.9em !important;
        word-break: break-word !important;
    }
}

/* ---- Very small screens (max 480px) ---- */
@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.15em !important;
    }

    .navbar {
        padding: 0 4px !important;
        min-height: 40px !important;
    }

    .mobile-nav-toggle {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        font-size: 14px !important;
    }

    .header-spacer {
        width: 32px !important;
        min-width: 32px !important;
    }

    .main-wrapper { padding-top: 0 !important; }

    .thumbnail {
        width: 50px !important;
        height: 50px !important;
    }

    .ad-actions .button {
        font-size: 0.8em !important;
        padding: 8px 4px !important;
    }

    .search-section select {
        width: 80px !important;
        font-size: 0.78em !important;
    }

    .search-section input[type="text"] {
        font-size: 0.82em !important;
        padding: 6px !important;
    }

    .content {
        margin-top: 0 !important;
        padding: 2px !important;
    }
}

/* ---- Tiny screens (max 360px) ---- */
@media (max-width: 360px) {
    .ad-actions {
        grid-template-columns: 1fr !important;
    }

    .logo h1 {
        font-size: 1em !important;
    }

    .main-wrapper { padding-top: 0 !important; }

    .search-section select {
        width: 70px !important;
        font-size: 0.75em !important;
    }

    .search-section input[type="text"] {
        font-size: 0.8em !important;
        padding: 5px !important;
    }

    .search-section button {
        padding: 5px 8px !important;
        font-size: 0.8em !important;
    }

    .listing-details {
        gap: 4px !important;
    }

    .listing-item {
        padding: 6px 8px !important;
    }

    .listing-item .item-title {
        font-size: 0.78em !important;
    }

    .listing-item .item-value {
        font-size: 0.82em !important;
        margin-top: 2px !important;
    }
}

/* ---- Desktop: always show nav, hide hamburger ---- */
@media (min-width: 769px) {
    .mobile-nav-toggle,
    .header-spacer {
        display: none !important;
    }

    .nav-links,
    .search-section {
        display: flex !important;
    }

    /* Title banner: full-width row below nav items, clearly visible */
    .header-title-banner {
        flex: 1 1 100%;
        order: 50;
        width: 100%;
        font-size: 0.85em;
        font-weight: 500;
        color: var(--text-color);
        opacity: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 4px 10px 3px;
        background: rgba(30,144,255,0.04);
        border-top: 1px solid rgba(30,144,255,0.1);
        margin-top: 0;
        font-size: 0.82em;
        letter-spacing: 0.2px;
    }

    .header-title-banner:empty {
        display: none;
    }

    [data-theme="dark"] .header-title-banner {
        color: var(--dark-text-color, #ccc);
        border-top-color: #333;
    }
}

/* ---- Footer Enhancements ---- */
.footer-enhanced {
    background: var(--footer-background-color);
    color: var(--footer-text-color);
    padding: 18px 20px 12px;
    text-align: center;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    margin-bottom: 14px;
}

.footer-links a {
    color: var(--footer-text-color);
    text-decoration: none;
    font-size: 0.88em;
    opacity: 0.9;
    transition: opacity 0.2s, text-decoration 0.2s;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-links a i {
    margin-right: 4px;
}

.footer-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 10px auto;
    max-width: 600px;
}

.footer-bottom {
    font-size: 0.82em;
    opacity: 0.85;
}

.footer-bottom a {
    color: var(--footer-text-color);
    text-decoration: none;
    margin-left: 12px;
    opacity: 0.85;
}

.footer-bottom a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ---- Footer ecosystem row ---- */
.footer-ecosystem {
    font-size: 0.82em;
    opacity: 0.85;
    margin: 8px 0 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 6px;
}

.footer-ecosystem a {
    color: var(--footer-text-color);
    text-decoration: none;
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-ecosystem a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-dot {
    opacity: 0.5;
}

/* ---- Scroll-to-top floating button ---- */
#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 22px;
    right: 18px;
    z-index: 1200;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    transition: background 0.2s, transform 0.2s;
    align-items: center;
    justify-content: center;
}

#scrollTopBtn:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
}

/* ---- Featured ads grid: 2 cols on small mobile ---- */
@media (max-width: 600px) {
    .listing-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .listing-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Dark mode: header & search fix ---- */
[data-theme="dark"] header {
    background-color: var(--dark-nav-background-color);
}

[data-theme="dark"] .mobile-nav-toggle {
    background-color: var(--dark-primary-color);
}

[data-theme="dark"] .search-section input[type="text"],
[data-theme="dark"] .search-section select {
    background-color: #000;
    color: #fff;
    border-color: #333;
}

[data-theme="dark"] .logo .logo-com {
    color: #ccc;
}

/* ---- Thumbnail sizing on mobile for detail page ---- */
@media (max-width: 480px) {
    .thumbnail {
        width: 64px;
        height: 64px;
    }
}

/* ---- General touch-friendly improvements ---- */
@media (max-width: 768px) {
    .nav-links ul li a,
    button,
    input[type="submit"],
    .button {
        min-height: 36px;
    }
}

/* ===================================================================
   NAV BUTTON STYLES — clean, themed, icon-friendly
   =================================================================== */
.nav-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 6px 12px !important;
    font-size: 0.85em !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    background: rgba(255,255,255,0.1) !important;
    color: var(--text-color, #333) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}

.nav-btn:hover {
    background: rgba(0,0,0,0.06) !important;
    border-color: rgba(0,0,0,0.12) !important;
}

.nav-btn i {
    font-size: 0.9em;
    opacity: 0.7;
}

.nav-btn-primary {
    background: var(--primary-color, #1e90ff) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.nav-btn-primary:hover {
    filter: brightness(1.1) !important;
}

.nav-btn-subtle {
    background: transparent !important;
    border-color: transparent !important;
    opacity: 0.75 !important;
}

.nav-btn-subtle:hover {
    opacity: 1 !important;
    background: rgba(0,0,0,0.04) !important;
}

/* Dark mode nav buttons */
[data-theme="dark"] .nav-btn {
    background: rgba(255,255,255,0.08) !important;
    color: #e0e0e0 !important;
    border-color: rgba(255,255,255,0.1) !important;
}

[data-theme="dark"] .nav-btn:hover {
    background: rgba(255,255,255,0.15) !important;
}

[data-theme="dark"] .nav-btn-primary {
    background: var(--dark-primary-color, #2196f3) !important;
    color: #fff !important;
}

[data-theme="dark"] .nav-btn-subtle {
    background: transparent !important;
    color: #aaa !important;
}

[data-theme="dark"] .nav-btn-subtle:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.08) !important;
}

/* Admin button in nav */
.nav-btn-admin {
    background: #c00 !important;
    color: #fff !important;
    border-color: transparent !important;
    font-size: 0.75em !important;
    padding: 4px 8px !important;
}

/* Mobile: tighter nav buttons */
@media (max-width: 768px) {
    .nav-btn {
        padding: 5px 9px !important;
        font-size: 0.78em !important;
        gap: 4px !important;
        min-height: 32px !important;
    }

    .nav-btn i {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        padding: 4px 7px !important;
        font-size: 0.74em !important;
    }
}

/* Override old blue-everything rule for nav buttons */
.nav-links ul li a.nav-btn {
    background: rgba(255,255,255,0.1) !important;
    color: var(--text-color, #333) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}

.nav-links ul li a.nav-btn:hover {
    background: rgba(0,0,0,0.06) !important;
}

.nav-links ul li a.nav-btn.nav-btn-primary {
    background: var(--primary-color, #1e90ff) !important;
    color: #fff !important;
}

.nav-links ul li a.nav-btn.nav-btn-subtle {
    background: transparent !important;
    border-color: transparent !important;
}

.nav-links ul li a.nav-btn.nav-btn-admin {
    background: #c00 !important;
    color: #fff !important;
}

[data-theme="dark"] .nav-links ul li a.nav-btn {
    background: rgba(255,255,255,0.08) !important;
    color: #e0e0e0 !important;
    border-color: rgba(255,255,255,0.1) !important;
}

[data-theme="dark"] .nav-links ul li a.nav-btn:hover {
    background: rgba(255,255,255,0.15) !important;
}

[data-theme="dark"] .nav-links ul li a.nav-btn.nav-btn-primary {
    background: var(--dark-primary-color, #2196f3) !important;
    color: #fff !important;
}

[data-theme="dark"] .nav-links ul li a.nav-btn.nav-btn-subtle {
    background: transparent !important;
    color: #aaa !important;
}

/* ===================================================================
   SEARCH BAR — clean, modern styling
   =================================================================== */
.search-section input[type="text"] {
    border: 1px solid rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    background: rgba(255,255,255,0.95) !important;
    color: #333 !important;
    font-size: 0.9em !important;
    padding: 8px 12px !important;
    outline: none !important;
}

.search-section input[type="text"]:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(30,144,255,0.15) !important;
}

.search-section select {
    border: 1px solid rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    background: rgba(255,255,255,0.95) !important;
    color: #333 !important;
    font-size: 0.85em !important;
    padding: 8px 6px !important;
    cursor: pointer !important;
}

.search-section button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: var(--primary-color, #1e90ff) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: filter 0.2s !important;
}

.search-section button:hover {
    filter: brightness(1.1) !important;
}

[data-theme="dark"] .search-section input[type="text"],
[data-theme="dark"] .search-section select {
    background: #000 !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

[data-theme="dark"] .search-section input[type="text"]:focus {
    border-color: var(--dark-primary-color) !important;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.2) !important;
}

/* Region selector styling */
.nav-links select {
    border: 1px solid rgba(0,0,0,0.12) !important;
    border-radius: 6px !important;
    padding: 5px 8px !important;
    font-size: 0.82em !important;
    background: rgba(255,255,255,0.9) !important;
    color: #333 !important;
    cursor: pointer !important;
}

[data-theme="dark"] .nav-links select {
    background: #000 !important;
    color: #ddd !important;
    border-color: #444 !important;
}

/* ===================================================================
   BROWSE PAGE — sort form + category header polish
   =================================================================== */
.category-header {
    padding: 8px 12px;
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.7;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sort-form {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 8px 4px !important;
    align-items: center !important;
}

.sort-form select {
    border: 1px solid rgba(0,0,0,0.15) !important;
    border-radius: 6px !important;
    padding: 6px 8px !important;
    font-size: 0.85em !important;
    background: rgba(255,255,255,0.95) !important;
    color: #333 !important;
}

.sort-form .button,
.sort-form input[type="submit"] {
    border-radius: 6px !important;
    font-size: 0.85em !important;
    padding: 6px 12px !important;
}

[data-theme="dark"] .sort-form select {
    background: #000 !important;
    color: #ddd !important;
    border-color: #444 !important;
}

.pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 10px 0 !important;
    align-items: center !important;
}

.pagination a,
.pagination .current-page {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 30px !important;
    height: 30px !important;
    padding: 0 6px !important;
    border-radius: 6px !important;
    font-size: 0.85em !important;
    text-decoration: none !important;
}

.pagination a {
    background: rgba(0,0,0,0.05) !important;
    color: var(--text-color, #333) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}

.pagination a:hover {
    background: var(--primary-color) !important;
    color: #fff !important;
}

.pagination .current-page {
    background: var(--primary-color) !important;
    color: #fff !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .pagination a {
    background: rgba(255,255,255,0.08) !important;
    color: #ddd !important;
    border-color: rgba(255,255,255,0.1) !important;
}

[data-theme="dark"] .pagination a:hover {
    background: var(--dark-primary-color) !important;
    color: #fff !important;
}

/* ===================================================================
   GLOBAL FORM STYLES — consistent across login, register, profile,
   add listing, edit, and all other forms site-wide
   =================================================================== */

/* All text inputs, selects, textareas get the same base look */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="date"],
textarea,
select {
    padding: 9px 12px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    font-size: 0.92em;
    font-family: inherit;
    background: rgba(255,255,255,0.97);
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    max-width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color, #1e90ff);
    box-shadow: 0 0 0 2px rgba(30,144,255,0.15);
}

textarea {
    resize: vertical;
    min-height: 60px;
}

/* Dark mode inputs */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #000;
    color: #e0e0e0;
    border-color: #444;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--dark-primary-color, #2196f3);
    box-shadow: 0 0 0 2px rgba(33,150,243,0.2);
}

/* Submit buttons and general buttons */
input[type="submit"],
button[type="submit"],
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color, #1e90ff);
    color: #fff;
    font-size: 0.92em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
.btn:hover {
    filter: brightness(1.1);
}

input[type="submit"]:active,
button[type="submit"]:active,
.btn:active {
    transform: scale(0.98);
}

/* File inputs */
input[type="file"] {
    padding: 8px;
    border: 1px dashed rgba(0,0,0,0.2);
    border-radius: 8px;
    background: rgba(0,0,0,0.02);
    cursor: pointer;
    font-size: 0.88em;
}

[data-theme="dark"] input[type="file"] {
    border-color: #444;
    background: rgba(255,255,255,0.04);
    color: #ccc;
}

/* Labels */
label {
    display: block;
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 3px;
    color: var(--text-color, #555);
}

[data-theme="dark"] label {
    color: #bbb;
}

/* Form groups / rows */
.form-group,
.form-field {
    margin-bottom: 14px;
}

/* Legacy table-based forms: make them responsive */
form table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

form table td {
    padding: 4px 6px;
    vertical-align: top;
}

form table input[type="text"],
form table input[type="email"],
form table input[type="password"],
form table textarea,
form table select {
    width: 100%;
}

@media (max-width: 600px) {
    form table,
    form table tbody,
    form table tr,
    form table td {
        display: block;
        width: 100%;
    }
    form table td {
        padding: 2px 0;
    }
    form table td:first-child {
        font-weight: 600;
        font-size: 0.82em;
        padding-top: 8px;
        color: var(--text-color, #555);
    }
}

/* Alerts / Messages */
.alert,
.message,
.reg-message {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.9em;
    line-height: 1.4;
}

.alert-success {
    background: rgba(40,167,69,0.1);
    border: 1px solid rgba(40,167,69,0.2);
    color: #28a745;
}

.alert-danger {
    background: rgba(220,53,69,0.1);
    border: 1px solid rgba(220,53,69,0.2);
    color: #dc3545;
}

[data-theme="dark"] .alert-success {
    background: rgba(40,167,69,0.15);
    border-color: rgba(40,167,69,0.3);
}

[data-theme="dark"] .alert-danger {
    background: rgba(220,53,69,0.15);
    border-color: rgba(220,53,69,0.3);
}

/* Breadcrumbs */
.breadcrumb {
    font-size: 0.82em;
    padding: 6px 8px;
    opacity: 0.6;
}

.breadcrumb a {
    color: var(--primary-color, #1e90ff);
    text-decoration: none;
}

/* Action links bar */
.action-links {
    padding: 10px 0;
    font-size: 0.9em;
}

.action-links .button,
.action-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88em;
    background: var(--primary-color, #1e90ff);
    color: #fff;
    transition: filter 0.2s;
}

.action-links .button:hover,
.action-links a:hover {
    filter: brightness(1.1);
}

/* Profile page container */
.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 12px;
}

/* Profile section: cover photo + avatar */
.profile-section {
    text-align: center;
    margin-bottom: 20px;
}

.cover-photo {
    width: 100%;
    height: 180px;
    background-color: #e0e0e0;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    position: relative;
}

[data-theme="dark"] .cover-photo {
    background-color: #000;
}

.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--content-background-color, #fff);
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ccc;
    background-size: cover;
    background-position: center;
}

[data-theme="dark"] .profile-image {
    border-color: #000;
}

/* Transaction table */
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.88em;
}

.transaction-table th,
.transaction-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.transaction-table th {
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

[data-theme="dark"] .transaction-table th,
[data-theme="dark"] .transaction-table td {
    border-bottom-color: rgba(255,255,255,0.08);
}

/* Admin section in profile */
.admin-section {
    background: rgba(255,0,0,0.03);
    border: 1px solid rgba(255,0,0,0.1);
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
}

[data-theme="dark"] .admin-section {
    background: rgba(255,50,50,0.06);
    border-color: rgba(255,50,50,0.15);
}

/* Drop area for image uploads */
#drop-area {
    border: 2px dashed rgba(0,0,0,0.15) !important;
    border-radius: 10px !important;
    padding: 24px !important;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(0,0,0,0.01);
}

#drop-area:hover,
#drop-area.highlight {
    border-color: var(--primary-color, #1e90ff) !important;
    background: rgba(30,144,255,0.04);
}

[data-theme="dark"] #drop-area {
    border-color: #444 !important;
    background: rgba(255,255,255,0.02);
}

/* Pending email notice */
.pending-email {
    font-size: 0.82em;
    color: #e67e22;
    margin-top: 4px;
}

/* ===================================================================
   DARK MODE — comprehensive text contrast fix
   No more grey-on-black. All text is bright and readable.
   =================================================================== */

[data-theme="dark"] body { color: #e8e8e8; }
[data-theme="dark"] p { color: #ddd; }
[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4,
[data-theme="dark"] h5, [data-theme="dark"] h6 { color: #6cb4ff; }
[data-theme="dark"] a { color: #6cb4ff; }
[data-theme="dark"] a:hover { color: #90ceff; }
[data-theme="dark"] .sidebar-menu li a { color: #ddd; }
[data-theme="dark"] .sidebar-menu li a:hover { color: #6cb4ff; }
[data-theme="dark"] .category-header { color: #ccc; border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .category-header p { color: #ccc; }
[data-theme="dark"] .browse-header h4 { color: #e0e0e0; }
[data-theme="dark"] .sort-form label { color: #ccc; }
[data-theme="dark"] .btn-go { background: #28a745; color: #fff; }
[data-theme="dark"] .btn-add { background: #1a73e8; color: #fff !important; }
[data-theme="dark"] .listing-header h3 a { color: #6cb4ff !important; }
[data-theme="dark"] .listing-header h3 { color: #e0e0e0; }
[data-theme="dark"] .listing-details .detail-item { color: #ccc; }
[data-theme="dark"] .listing-details .detail-item strong { color: #fff; }
[data-theme="dark"] .listing-footer .button { color: #fff !important; }
[data-theme="dark"] .listing-footer font[color="red"] { color: #ff6b6b !important; }
[data-theme="dark"] .category-footer p { color: #bbb; }
[data-theme="dark"] .testimonial-item p { color: #ccc; }
[data-theme="dark"] .news-item p { color: #ccc; }
[data-theme="dark"] .news-item h3 { color: #6cb4ff; }
[data-theme="dark"] .breadcrumb { background-color: #000; }
[data-theme="dark"] .breadcrumb li + li::before { color: #888; }
[data-theme="dark"] .footer-enhanced { background: #000; }
[data-theme="dark"] .footer-links a { color: #ccc; }
[data-theme="dark"] .footer-ecosystem a { color: #6cb4ff; }
[data-theme="dark"] .footer-ecosystem span { color: #bbb; }
[data-theme="dark"] .footer-bottom p { color: #aaa; }
[data-theme="dark"] .footer-bottom a { color: #aaa; }
[data-theme="dark"] .footer-divider { border-top-color: rgba(255,255,255,0.12); }

/* Detail page dark mode */
[data-theme="dark"] .listing-title { color: #6cb4ff; }
[data-theme="dark"] .item-title { color: #6cb4ff; }
[data-theme="dark"] .item-value { color: #e0e0e0; }
[data-theme="dark"] .listing-item { background: #000; border-color: #333; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
[data-theme="dark"] .listing-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
[data-theme="dark"] .contact-seller { background: #000; }
[data-theme="dark"] .email-friend { background: #000; }
[data-theme="dark"] .contact-seller h3 { color: #6cb4ff; }
[data-theme="dark"] .email-friend h3 { color: #6cb4ff; }
[data-theme="dark"] .contact-seller label { color: #ccc; }
[data-theme="dark"] .email-friend label { color: #ccc; }
[data-theme="dark"] .ad-actions .button { color: #fff !important; }
[data-theme="dark"] .admin-actions .button { color: #fff !important; }
[data-theme="dark"] .admin-section { background: rgba(255,50,50,0.08); border-color: rgba(255,50,50,0.2); }

/* Register/profile dark mode */
[data-theme="dark"] .reg-section-label { color: #999; border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .reg-card h2 { color: #6cb4ff; }
[data-theme="dark"] .reg-sub { color: #aaa; }
[data-theme="dark"] .reg-sub a { color: #6cb4ff; }
[data-theme="dark"] .reg-field label { color: #ccc; }
[data-theme="dark"] .reg-field label .optional { color: #777; }

/* Search results & browse cards dark mode */
[data-theme="dark"] .search-results .listing-item { background: #000; border-color: #333; }
[data-theme="dark"] .listing-grid .listing-item { background: #000; border-color: #333; }
[data-theme="dark"] .listing-title a { color: #6cb4ff; }

/* Forms dark mode text */
[data-theme="dark"] label { color: #ccc; }
[data-theme="dark"] form table td:first-child { color: #ccc; }
[data-theme="dark"] .form-group label { color: #ccc; }
[data-theme="dark"] .form-field label { color: #ccc; }
[data-theme="dark"] .container { color: #e0e0e0; }

/* Featured card dark mode */
[data-theme="dark"] .featured-card { background: #000; border: 1px solid #333; }
[data-theme="dark"] .featured-card-info { background: rgba(0,0,0,0.92); }

/* Sidebar dark mode */
[data-theme="dark"] .sidebar { background: #000; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
[data-theme="dark"] .sidebar h2 { color: #6cb4ff; }

/* Fix grey placeholder text in dark mode */
[data-theme="dark"] input::placeholder { color: #888 !important; opacity: 1 !important; }
[data-theme="dark"] textarea::placeholder { color: #888 !important; opacity: 1 !important; }

/* Alert text visibility in dark mode */
[data-theme="dark"] .alert-warning { background: rgba(255,193,7,0.12); border-color: rgba(255,193,7,0.25); color: #ffc107; }
[data-theme="dark"] .alert-danger { color: #ff6b6b; }
[data-theme="dark"] .alert-success { color: #4caf50; }

/* ===================================================================
   REGISTER/PROFILE — wider 2-column layout on desktop
   =================================================================== */
@media (min-width: 769px) {
    .reg-wrap { max-width: 720px; }
    .reg-card { padding: 28px 32px; }
    .reg-row { display: flex; gap: 14px; }
    .reg-row .reg-field { flex: 1; }
}

/* ===================================================================
   BROWSE/SEARCH — card consistency and image fill
   =================================================================== */
.listing-grid.search-results { gap: 12px; }

.listing-grid .listing-item,
.search-results .listing-item {
    display: flex;
    flex-direction: column;
    width: auto !important;      /* override legacy nicecss fixed widths */
    max-width: none !important;  /* prevent narrow columns */
    justify-self: stretch;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.listing-grid .listing-item:hover,
.search-results .listing-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.listing-grid .listing-image img,
.search-results .listing-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.listing-grid .listing-header {
    padding: 6px 10px 2px;
}

.listing-grid .listing-header h3 {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.3;
}

.listing-grid .listing-header h3 a {
    color: var(--text-color, #333);
    text-decoration: none;
}

.listing-grid .listing-header h3 a:hover {
    color: var(--primary-color);
}

.listing-grid .listing-details {
    padding: 4px 10px;
    flex: 1;
}

.listing-grid .listing-footer {
    padding: 6px 10px 10px;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: auto;
}

[data-theme="dark"] .listing-grid .listing-footer { border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .listing-grid .listing-header h3 a { color: #6cb4ff; }

/* Subcategory list styling */
.subcategory-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 10px 0;
}

.subcategory-item {
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    background: rgba(0,0,0,0.02);
    transition: background 0.2s, transform 0.2s;
}

.subcategory-item:hover {
    background: rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

[data-theme="dark"] .subcategory-item { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .subcategory-item:hover { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .subcategory-title { color: #e0e0e0; }
[data-theme="dark"] .subcategory-count { color: #aaa; }

.subcategory-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
}

.subcategory-title {
    font-size: 0.88em;
    font-weight: 500;
    color: var(--text-color, #333);
}

.subcategory-count {
    font-size: 0.78em;
    color: #888;
    margin-top: 2px;
}

/* Mobile browse cards: 2 col, smaller images */
@media (max-width: 600px) {
    .listing-grid .listing-image img,
    .search-results .listing-image img {
        height: 150px;
    }
    .listing-grid .listing-header h3 { font-size: 0.85em; }
}

@media (max-width: 360px) {
    .listing-grid .listing-image img,
    .search-results .listing-image img {
        height: 180px;
    }
}

/* Mobile bottom nav bar spacing */
@media (max-width: 768px) {
    body { padding-bottom: 56px !important; }
}

/* Show only on mobile (hidden on desktop) */
@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}
