@import 'assets/contact-reveal.css';

:root {
    /* Colors */
    --primary: #0a4d33;
    /* Forest Green */
    --primary-light: #126343;
    --secondary: #f4b400;
    /* Golden Retriever Yellow */
    --accent: #ff4500;
    /* Vibrant International Orange (Red-Orange) */
    --accent-hover: #e03e00;
    --background: #f8fafc;
    /* Bone White */
    --surface: #ffffff;
    --text: #1c1917;
    --text-muted: #57534e;
    --border: #e7e5e4;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 4rem;

    /* Breakpoints */
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Advert Type Colors */
    --type-sale: #22c55e;
    --type-stud: #8b5cf6;
    --type-rescue: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1520px;
    /* Expansive wide layout */
    margin: 0 auto;
    padding: 0 var(--space-xl);
    /* Increased gutter for premium feel */
}

/* Typography Utility Classes */
.text-h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary);
}

.text-h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.text-h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.text-body {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* Layout Utilities */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-xs {
    gap: var(--space-xs);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

/* Visibility Utilities */
.hide-mobile {
    display: inherit;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .flex.show-mobile {
        display: flex !important;
    }
}

/* UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text);
}

.btn-secondary:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background-color: #f3f4f6;
    color: var(--text);
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.btn-xs {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1.1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
}

.btn-icon:hover {
    background-color: #ededed;
    color: var(--primary);
}

.btn-pink {
    background-color: #ec4899;
    color: white;
}

.btn-green {
    background-color: #22c55e;
    color: white;
}

.btn-violet {
    background-color: #8b5cf6;
    color: white;
}

/* Navbar */
.navbar {
    height: 90px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-links a {
    font-weight: 600;
    font-size: 1rem;
}

.nav-links a:hover {
    color: var(--primary);
}

.logo-icon {
    font-size: 2rem;
    background: var(--secondary);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.mobile-menu-toggle {
    display: none;
}

/* Hero */
.hero {
    padding: var(--space-xl) 0;
    background: radial-gradient(circle at top right, #fff7ed 0%, var(--background) 70%);
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: var(--space-xl);
}

.badge {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: rgba(10, 77, 51, 0.08);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filters-sidebar {
    position: sticky;
    top: 180px;
    height: fit-content;
    transition: transform 0.3s ease, visibility 0.3s;
}

@media (max-width: 768px) {
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1001;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        align-items: flex-end;
        padding: 0;
    }

    .filters-sidebar.active {
        display: flex;
    }

    .filters-sidebar .sidebar-card {
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 24px 24px 0 0;
        padding: 2rem 1.5rem;
    }
}

.filters-sidebar h3 {
    margin-bottom: var(--space-md);
}

.sidebar-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* Browse Page Sidebar & Filter Styles */
.browse-header {
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-lg);
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.search-bar-advanced {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border);
    position: sticky;
    top: 90px;
    z-index: 999;
}

@media (max-width: 768px) {
    .search-bar-advanced {
        flex-direction: column;
        gap: 1rem;
        top: 70px;
        padding: 0.75rem;
        margin-bottom: var(--space-lg);
    }

    .search-input-wrapper {
        width: 100%;
        padding: 0.5rem;
        background: #f3f4f6;
        border-radius: var(--radius-md);
    }
}

.search-input-wrapper input {
    border: none;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
}

.filter-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.browse-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

@media (max-width: 1024px) {
    .browse-content {
        grid-template-columns: 280px 1fr;
        gap: var(--space-lg);
    }
}

@media (max-width: 768px) {
    .browse-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

.filter-group {
    margin-bottom: var(--space-lg);
}

.filter-group label {
    display: block;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    font-size: 1.1rem;
    /* Increased for readability */
    color: #1e293b;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-list label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-muted);
}

.range-inputs input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
}

.range-inputs input:focus {
    border-color: var(--primary);
}

.hero-content p {
    margin: var(--space-md) 0 var(--space-lg);
}

.hero-image-container {
    position: relative;
    height: 550px;
    border-radius: 40px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-bg-blur {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 300px;
    height: 300px;
    background: var(--secondary);
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
}

/* Categories */
.section-padding {
    padding: 6rem 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-top: 3rem;
}

.category-card {
    background: var(--surface);
    padding: 2.5rem var(--space-md);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.cat-icon {
    font-size: 3.5rem;
}

.cat-info h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.cat-info span {
    color: var(--text-muted);
    font-weight: 500;
}

/* Listings */
/* Listings */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.listing-card {
    background: var(--surface);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.listing-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    transform: translateY(-8px);
    border-color: var(--primary);
}

.listing-img {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.listing-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.listing-card:hover .listing-img img {
    transform: scale(1.08);
}

.listing-details {
    padding: 2rem;
    /* Luxury padding profile */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* Better vertical rhythm */
}

.listing-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.listing-breed {
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.listing-price {
    font-size: 1.4rem;
    font-weight: 900;
    color: #0f172a;
    /* Deeper contrast */
}

.listing-title {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
    color: #1e293b;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Allow 2 lines for better readability */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-loc {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.listing-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: auto;
}

.listing-age {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
}

/* Skeleton Loading Animation */
@keyframes skeleton-loading {
    0% {
        background-color: #f1f5f9;
    }

    50% {
        background-color: #e2e8f0;
    }

    100% {
        background-color: #f1f5f9;
    }
}

.skeleton {
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 12px;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.listing-heart {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 32px;
    height: 32px;
    background: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    color: var(--text-muted);
}

.listing-heart:hover {
    transform: scale(1.1);
    color: #ef4444;
}

.listing-heart.active {
    color: #ef4444;
}

.listing-details {
    padding: var(--space-md);
}

.listing-breed {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.listing-price {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text);
}

.listing-title {
    font-size: 1.5rem;
    margin: 8px 0 12px;
    font-weight: 700;
}

.listing-loc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.listing-footer {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    margin-top: 5px;
}

.listing-age {
    font-weight: 600;
    color: var(--text-muted);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 200px;
    padding: 0.5rem 0;
    margin: 0.5rem 0 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background-color: var(--background);
    color: var(--primary);
}

/* Trust Banner */
.trust-banner {
    background-color: var(--primary);
    color: white;
    padding: 5rem 0;
    margin: 4rem 0;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 4rem;
    text-align: center;
}

.trust-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.trust-item h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.trust-item p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background-color: #0c0a09;
    color: white;
    padding: 6rem 0 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 6rem;
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-col h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

.footer-col a {
    display: block;
    color: #a8a29e;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.footer-col a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid #262626;
    text-align: center;
    color: #737373;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 800px;
        margin: 0 auto;
    }

    .hero-btns {
        justify-content: center;
    }

    .hero-image-container {
        height: 400px;
        margin-top: 3rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-actions {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        width: 45px;
        height: 45px;
        background: #f3f4f6;
        border-radius: 10px;
    }

    .trust-grid {
        gap: 3rem;
    }

    .footer-nav {
        grid-template-columns: 1fr;
    }

    /* Prevent horizontal scroll on mobile */
    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0 1rem;
        max-width: 100%;
    }

    .browse-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    /* Fix hero section on mobile */
    .hero {
        padding: 2rem 0;
    }

    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
    }

    .hero-image-container {
        height: 300px;
    }

    /* Fix category grid on mobile */
    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Fix listing grid on mobile */
    .listing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Adjust navbar height on mobile */
    .navbar {
        height: 70px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .text-h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .text-h1 {
        font-size: 2rem;
    }

    .text-body {
        font-size: 1rem;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .listing-title {
        font-size: 1.25rem;
    }

    .listing-price {
        font-size: 1.2rem;
    }
}

/* Verification Styles */
.verif-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.verif-badge.verified {
    background: #dcfce7;
    color: #166534;
}

.verif-badge.pending {
    background: #fef9c3;
    color: #854d0e;
}

.verif-badge.none {
    background: #f1f5f9;
    color: var(--text-muted);
}

.verif-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: linear-gradient(135deg, #0a4d33 0%, #126343 100%);
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.verif-banner-content h4 {
    margin-bottom: 4px;
}

.verif-banner-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Filter System Enhancements */
.species-selector {
    margin-bottom: 2rem;
}

.species-btn {
    min-width: 120px;
}

.species-btn i {
    width: 20px;
    height: 20px;
}

.search-bar-advanced {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #fdfdfd;
    font-size: 0.95rem;
    font-weight: 500;
}

.filter-btn:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(10, 77, 51, 0.1);
}

.filters-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.sidebar-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f2f2f2;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-list input[type="checkbox"],
.checkbox-list input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-input-sm,
.form-select-sm {
    width: 100%;
    padding: 0.5rem 0.7rem;
    /* Reduced padding */
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

/* Mobile Filter Modal - Bottom Sheet Style */
@media (max-width: 768px) {
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 10000;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .filters-sidebar.active {
        opacity: 1;
        pointer-events: all;
        display: block;
    }

    .filters-sidebar .sidebar-card {
        position: fixed;
        /* Use fixed for reliability */
        bottom: 0;
        left: 0;
        width: 100%;
        height: 85vh;
        max-height: 85vh;
        border-radius: 32px 32px 0 0;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
        /* Faster, snackier feel */
        box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.3);
        padding: 1.5rem;
        padding-bottom: 8rem;
        background: #fff;
        z-index: 10001;
        /* Above backdrop */
    }

    .filters-sidebar.active .sidebar-card {
        transform: translateY(0);
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.4);
    }

    /* Mobile filter inputs - larger touch targets */
    .filters-sidebar .form-input-sm,
    .filters-sidebar .form-select-sm {
        height: 48px;
        font-size: 16px;
        /* Prevents iOS zoom */
        padding: 0.75rem 1rem;
    }

    /* Mobile pills - larger touch targets */
    .filters-sidebar .pill-radio span {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile filter groups - more spacing */
    .filters-sidebar .filter-group {
        margin-bottom: 1.25rem;
    }

    .filters-sidebar .filter-group label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    /* Hide desktop-only elements */
    .filters-sidebar .sidebar-promos {
        display: none;
    }

    /* Mobile search button */
    .filters-sidebar #sidebar-search-btn {
        height: 52px;
        font-size: 1.05rem;
    }

    /* Show mobile sticky button */
    .mobile-filter-apply {
        display: block !important;
    }

    /* Mobile listing cards - larger, more touch-friendly */
    .listing-card .listing-title {
        font-size: 1.15rem;
        line-height: 1.4;
    }

    .listing-card .listing-price {
        font-size: 1.5rem;
    }

    .listing-details {
        padding: 1.5rem;
    }

    /* Browse Page Body Mobile Overrides */
    .browse-page-body .container {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .browse-page-body .navbar {
        position: static !important;
        /* Allow navbar to scroll away */
        height: 70px;
        /* Slimmer mobile navbar */
    }

    .browse-page-body .breadcrumb {
        display: none !important;
    }

    .browse-page-body {
        background: #f8fafc;
        /* Subtle light background for feed look */
    }

    /* Sticky Filter Bar for Mobile */
    .browse-page-body .compact-results-bar {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        margin: 0 !important;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }

    .browse-page-body .compact-results-bar h1 {
        font-size: 1rem !important;
        margin: 0 !important;
        flex-shrink: 0;
    }

    .browse-page-body .compact-results-bar .flex.gap-sm.align-center {
        width: auto;
        gap: 0.5rem;
    }

    .browse-page-body .compact-results-bar .btn {
        flex: none;
        height: 36px;
        padding: 0 0.75rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 999px;
        font-size: 0.85rem;
    }

    /* Edge-to-edge listing cards */
    .browse-page-body .listing-grid {
        grid-template-columns: 1fr !important;
        gap: 0;
        padding: 0;
        margin-top: 0;
    }

    .browse-page-body .listing-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 8px solid #f1f5f9;
        margin-bottom: 0;
        box-shadow: none;
        width: 100%;
    }

    .browse-page-body .listing-img {
        height: 280px;
    }

    .browse-page-body .listing-details {
        padding: 1.25rem 1rem;
    }

    /* Prevent body scroll when modal is open */
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Tablet - 2 columns */
@media (min-width: 480px) and (max-width: 768px) {
    .listing-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* --- Sidebar & Layout Logic --- */
:root {
    --sidebar-width: 340px;
    /* Premium width with laptop visibility */
}

.browse-content {
    display: flex;
    gap: 3.5rem;
    /* Balanced gap for wide sidebar */
    align-items: start;
    margin-top: 1rem;
}


/* Custom Scrollbar */
.filters-sidebar::-webkit-scrollbar {
    width: 3px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.sidebar-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 24px;
    padding: 1.8rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

/* Accordion Styling */
.filter-accordion {
    border-bottom: 1px solid #f8fafc;
    padding: 1.25rem 0;
}

.filter-accordion summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    color: #334155;
    list-style: none;
}

.filter-accordion summary::after {
    content: '+';
    font-size: 1.2rem;
    color: #94a3b8;
    transition: transform 0.2s;
}

.filter-accordion[open] summary::after {
    content: '−';
}

.accordion-content {
    padding-top: 1.25rem;
}



/* --- Unified Search Bar (Top Bar) --- */
/* --- Unified Search Bar (Top Bar) --- */
.command-center {
    background: transparent;
    /* Remove the white box background */
    border-bottom: none;
    /* No hard border */
    padding: 1.5rem 0;
    position: sticky;
    top: 90px;
    z-index: 1000;
}

.command-center .container {
    max-width: 1520px;
}

.unified-search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    padding: 8px 16px;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    /* Stronger shadow on the pill itself */
}

.unified-search-bar:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.unified-search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(10, 77, 51, 0.08);
    transform: translateY(-1px);
}

.search-section {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 44px;
    flex: 1;
}

.search-section i {
    color: var(--primary);
    margin-right: 0.75rem;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.search-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    width: 100%;
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 600;
}

.search-section.distance {
    flex: 0 0 160px;
}

/* Breed Selector with Autocomplete */
.breed-selector-wrapper {
    position: relative;
    /* Slightly wider */
}

.autocomplete-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

/* Verified Toggle - Top Bar Version */
.top-verified-toggle {
    background: #f1f5f9;
    color: #0f172a;
    /* High contrast dark text when inactive */
    border: 1.5px solid #cbd5e1;
    padding: 0 1.25rem;
    height: 44px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    /* Bolder */
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
    white-space: nowrap;
}

/* Premium Species Selector */
.species-dropdown-wrapper {
    position: relative;
    cursor: pointer;
    user-select: none;
    padding: 0 1rem;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    color: var(--text);
    min-width: 130px;
}

.species-dropdown-wrapper i {
    color: var(--primary);
}

.species-dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 180px;
    display: none;
    z-index: 1001;
}

.species-dropdown-item {
    padding: 0.75rem 1rem;
    transition: background 0.2s;
}

.species-dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.species-dropdown-item.active {
    background: #e0f2fe;
    color: var(--primary);
    font-weight: 800;
}

.breed-guide-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s;
    background: #fff;
    white-space: nowrap;
}

.breed-guide-link:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

.top-verified-toggle i {
    color: #10b981;
    /* Keep the checkmark green */
}

.top-verified-toggle.active {
    background: #10b981;
    color: white;
    border-color: #059669;
}

.top-verified-toggle.active i {
    color: white;
}

/* Sidebar & Layout Fixes */
.filters-sidebar {
    position: sticky !important;
    top: 110px !important;
    /* Now sits safely under the 90px navbar */
    flex: 0 0 var(--sidebar-width);
    height: fit-content;
    overflow: visible;
    z-index: 20;
}

.sidebar-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 32px;
    padding: 1.75rem;
    /* Premium padding for spacious feel */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
}

.filter-group {
    margin-bottom: 0.6rem;
    /* Ultra-tight for maximum visibility */
}

.pill-radio span {
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
}

.filter-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: #0f172a;
}

.horizontal-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.pill-radio span {
    display: block;
    text-align: center;
    padding: 0.6rem 0.8rem;
    background: #f8fafc;
    color: #1e293b;
    /* Higher contrast from 475569 */
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1.5px solid #e2e8f0;
    /* Visible border */
}

.pill-radio input:checked+span {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(10, 77, 51, 0.2);
}

.pill-radio {
    cursor: pointer;
    flex: 1;
    min-width: 80px;
}

.pill-radio input {
    display: none;
}

.compact-results-bar {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}



.filter-label-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    font-size: 1rem;
    /* Increased to 16px approx */
    font-weight: 600;
    color: #334155;
    /* Darker for accessibility */
    transition: color 0.2s;
    padding: 0.4rem 0;
}

.filter-label-icon i {
    width: 18px;
    height: 18px;
    color: var(--primary);
    opacity: 0.9;
}

.filter-label-icon input[type="radio"],
.filter-label-icon input[type="checkbox"] {
    accent-color: var(--primary);
    width: 20px;
    /* Larger hit area */
    height: 20px;
}

/* Primary Vibrant Action Buttons */
.btn-primary-bright {
    background: var(--accent);
    color: white !important;
    border: none;
    font-weight: 800;
    padding: 0.8rem 2.5rem;
    border-radius: 100px;
    /* Fully rounded for unified look */
    box-shadow: 0 8px 25px rgba(255, 69, 0, 0.3);
    /* Vibrant shadow */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    text-align: center;
}

.btn-primary-bright:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 69, 0, 0.4);
}


@media (max-width: 1024px) {
    .command-bar {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
/* ============================================================
/* ============================================================
/* ============================================================
   ULTRA-SPECIFIC MOBILE BROWSE OVERRIDES (FIXED & EDGE-TO-EDGE)
   ============================================================ */
@media (max-width: 1024px) {

    /* Kill all container spacing - FORCE FULL WIDTH */
    body.browse-page-body .container,
    body.browse-page-body main.container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Force Navbar to scroll away */
    body.browse-page-body .navbar {
        position: absolute !important;
        top: 0 !important;
        width: 100% !important;
        height: 70px !important;
        background: #fff !important;
    }

    body.browse-page-body main.container {
        margin-top: 70px !important;
        padding: 0 !important;
    }

    /* Sticky Search Bar - THE HERO OF THE PAGE */
    body.browse-page-body .compact-results-bar {
        position: sticky !important;
        top: 0 !important;
        z-index: 2000 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(15px) !important;
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
        width: 100% !important;
    }

    body.browse-page-body .text-results-count {
        display: none !important;
    }

    /* Listing Grid - No gaps, no side space */
    body.browse-page-body .listing-grid {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* Cards - Full Device Width */
    body.browse-page-body .listing-card {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        margin: 0 0 12px 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        border-bottom: 8px solid #f8fafc !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    body.browse-page-body .listing-img {
        height: 300px !important;
        width: 100% !important;
        border-radius: 0 !important;
    }

    body.browse-page-body .listing-img img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    body.browse-page-body .listing-details {
        padding: 1.25rem 1rem !important;
    }

    /* FILTER MODAL - iOS BOTTOM SHEET STYLE */
    body.browse-page-body .filters-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 10000 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(8px) !important;
        display: none;
        opacity: 0;
        transition: opacity 0.4s ease;
    }

    body.browse-page-body .filters-sidebar.active {
        display: block !important;
        opacity: 1 !important;
    }

    body.browse-page-body .sidebar-card {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 85vh !important;
        max-height: 85vh !important;
        background: #fff !important;
        border-radius: 32px 32px 0 0 !important;
        padding: 1.5rem !important;
        padding-bottom: 120px !important;
        /* CRITICAL: Room for the fixed button at the bottom */
        box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.4) !important;
        transform: translateY(100%) !important;
        transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1) !important;
        overflow-y: auto !important;
        z-index: 10001 !important;
        -webkit-overflow-scrolling: touch;
    }

    body.browse-page-body .filters-sidebar.active .sidebar-card {
        transform: translateY(0) !important;
    }

    /* Fixed Button at bottom of the WHOLE SCREEN when sidebar is active */
    body.browse-page-body .mobile-filter-apply {
        display: none;
        /* Only show when sidebar is active */
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #fff !important;
        padding: 1rem 1.5rem !important;
        border-top: 1px solid #e2e8f0 !important;
        z-index: 10005 !important;
        /* Above everything */
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(100%);
        transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    }

    body.browse-page-body .filters-sidebar.active .mobile-filter-apply {
        display: block !important;
        transform: translateY(0);
    }

    body.browse-page-body .mobile-filter-apply button {
        width: 100% !important;
        height: 60px !important;
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        border-radius: 18px !important;
        box-shadow: 0 10px 25px rgba(255, 69, 0, 0.3) !important;
    }

    /* Larger touch targets for filter inputs */
    body.browse-page-body .form-input-sm,
    body.browse-page-body .form-select-sm {
        height: 52px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
    }

    body.browse-page-body .filter-group label {
        font-weight: 700 !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
    }
}


/* --- DESKTOP LAYOUT RECOVERY V3 --- */
@media (min-width: 1025px) {
    body.browse-page-body .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 1400px !important;
    }

    body.browse-page-body .browse-content {
        display: flex !important;
        gap: 4rem !important;
        align-items: flex-start !important;
        margin-top: 2rem !important;
    }

    body.browse-page-body .filters-sidebar {
        width: 330px !important;
        flex-shrink: 0 !important;
        position: sticky !important;
        top: 110px !important;
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        background: transparent !important;
        z-index: 10 !important;
    }

    body.browse-page-body .sidebar-card {
        position: static !important;
        transform: none !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        padding: 2rem !important;
        background: #fff !important;
        border-radius: 24px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
        border: 1px solid #f1f5f9 !important;
    }

    /* THE GRID FIX */
    body.browse-page-body .results-grid.listing-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
        flex: 1 !important;
        margin: 0 !important;
    }

    body.browse-page-body .listing-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px !important;
        border: 1px solid #f1f5f9 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        background: #fff !important;
    }

    body.browse-page-body .listing-card .listing-title {
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
        min-height: 4.5em !important;
    }

    body.browse-page-body .mobile-filter-apply {
        display: none !important;
    }

    body.browse-page-body .navbar {
        position: sticky !important;
        height: 90px !important;
        width: 100% !important;
    }
}

@media (min-width: 1025px) {
    body.browse-page-body .listing-img {
        height: 220px !important;
        border-radius: 20px 20px 0 0 !important;
    }
}

/* Modal Component */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    justify-content: center;
    /* Center by default, specialized via margin */
    align-items: center;
    /* Center by default */
}

.modal-overlay.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    z-index: 1001;
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-container[data-position="right"] {
    margin-left: auto;
    margin-right: 0;
    height: 100%;
    max-height: 100%;
    border-radius: 12px 0 0 12px;
    animation: slideInRight 0.3s ease-out;
}

.modal-container[data-position="bottom"] {
    margin-top: auto;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    animation: slideInBottom 0.3s ease-out;
}

.modal-container[data-position="center"] {
    animation: fadeInScale 0.2s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Contact Seller Modal Specifics */
.contact-modal-wrapper {
    max-height: 85vh;
    overflow-y: auto;
}

.contact-ad-context {
    display: flex;
    gap: 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
}

.contact-ad-context:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.qr-btn {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.qr-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdf4;
    transform: scale(1.03);
}

.qr-btn:active {
    transform: scale(0.98);
}

#char-count.warning {
    color: #ef4444 !important;
    font-weight: 600;
}

.spinner-sm {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile overrides for Modal */
@media (max-width: 768px) {
    .modal-container[data-position="right"] {
        /* Override to bottom on mobile */
        margin-left: 0;
        margin-right: 0;
        margin-top: auto;
        width: 100%;
        height: auto;
        max-height: 90%;
        border-radius: 12px 12px 0 0;
        animation: slideInBottom 0.3s ease-out;
    }
}

/* Toast Component */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Allow clicking through container */
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    animation: slideInRightToast 0.3s ease-out;
    pointer-events: auto;
    /* Re-enable pointer events for toasts */
    border: 1px solid #f1f5f9;
}

.toast-success {
    border-left: 4px solid #22c55e;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-icon {
    font-weight: bold;
    font-size: 1.2rem;
}

.toast-success .toast-icon {
    color: #22c55e;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-message {
    flex-grow: 1;
    font-size: 0.95rem;
    color: #1e293b;
}

.toast-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.toast-close:hover {
    color: #475569;
}

@keyframes slideInRightToast {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile positioning for Toast */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 80px;
        /* Above sticky footer */
        left: 10px;
        right: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* =========================================
   Gallery System Styles
   ========================================= */

/* Gallery Carousel */
.gallery-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: #f1f5f9;
    aspect-ratio: 4/3;
    /* default, can be overridden */
}

.gallery-main-wrapper {
    width: 100%;
    height: 100%;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    opacity: 0;
    /* Hidden by default, show on hover */
}

.gallery-wrapper:hover .gallery-arrow {
    opacity: 1;
    transition-delay: 0.1s;
}

.gallery-prev {
    left: 16px;
}

.gallery-next {
    right: 16px;
}

.gallery-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.gallery-arrow:disabled,
.gallery-arrow[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Thumbnails */
.gallery-thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 1rem 0 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.thumb-btn {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-btn.active {
    border-color: var(--primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.thumb-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    bottom: auto;
    left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    text-align: center;
    padding: 3px 8px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
}

@media (prefers-color-scheme: dark) {
    .lightbox-overlay {
        background: rgba(0, 0, 0, 0.98);
    }

    .lightbox-counter,
    .lightbox-close,
    .lightbox-nav {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

.lightbox-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    pointer-events: none;
    /* Let clicks pass through to overlay */
}

.lightbox-controls>* {
    pointer-events: auto;
}

.lightbox-close {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-counter {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
}

.lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    /* Prevent browser zooming/scrolling */
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s linear;
    /* Fast for drag, maybe slower for zoom? */
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    z-index: 20;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .gallery-arrow {
        display: none;
        /* Hide desktop arrows on mobile */
    }

    .lightbox-nav {
        display: none;
        /* Hide lightbox arrows on mobile, rely on swipe */
    }

    .gallery-thumbs {
        flex-wrap: wrap;
        /* Stack thumbnails instead of pushing page right */
        gap: 10px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .thumb-btn {
        width: calc(25% - 8px);
        /* 4 per row */
        height: auto;
        aspect-ratio: 1;
    }
}

@media (max-width: 375px) {
    .gallery-thumbs {
        gap: 6px;
    }

    .thumb-btn {
        width: calc(25% - 5px);
        /* Keep 4 per row but tighter */
        border-width: 2px;
    }

    .gallery-main-wrapper {
        min-height: 200px;
    }

    .lightbox-counter {
        font-size: 0.9rem;
        padding: 4px 12px;
    }
}

.lightbox-zoom-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 30;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbox-zoom-indicator.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* Gallery & Lightbox Performance Optimizations */
.spinner-icon {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.gallery-main-wrapper {
    background-color: #f1f5f9;
    position: relative;
    min-height: 300px;
    overflow: hidden;
}

/* Skeleton Loading State for Images */
.gallery-main-wrapper::before,
.thumb-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.6) 50%,
            transparent 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* Hide skeleton when image or specific state is active */
.gallery-main-wrapper.is-ready::before,
.gallery-main-wrapper.has-error::before,
.thumb-btn.is-ready::before {
    display: none;
}

.gallery-spinner,
.gallery-error {
    z-index: 2;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.main-image {
    transition: opacity 0.3s ease, aspect-ratio 0.3s ease;
}

.lazy-thumb {
    background-color: #f1f5f9;
}

.lightbox-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    min-height: 200px;
}

.lightbox-image {
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.gallery-error,
.lightbox-error {
    font-weight: 600;
    text-align: center;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* --- CONTACT REVEAL --- */
.contact-section {
    margin: 20px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.phone-number-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.phone-blurred {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.blur-text {
    font-size: 1.25rem;
    letter-spacing: 4px;
    color: #94a3b8;
    font-family: monospace;
}

.phone-revealed {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.phone-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    flex: 1;
}

.btn-icon-reveal {
    padding: 8px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.btn-icon-reveal:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.verification-modal,
.error-modal {
    text-align: center;
    padding: 32px;
    max-width: 400px;
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    flex: 1;
}

/* --- TICKET 2: VERTICAL LAYOUT REDESIGN & RESPONSIVE CONSOLIDATION --- */

/* Desktop: 65/35 Split-View (>1280px) */
@media (min-width: 1280px) {
    .listing-container {
        display: grid;
        grid-template-columns: 2fr 1fr;
        /* 65/35 split */
        gap: 2rem;
        max-width: 1400px;
        margin: 0 auto;
        padding: 2rem;
    }

    .listing-main {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .listing-sidebar {
        position: sticky;
        top: 100px;
        /* Below navbar (navbar is ~90px) */
        align-self: start;
        background: white;
        border-radius: 12px;
        padding: 1.5rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    /* Hide sticky footer on desktop */
    .listing-sticky-footer {
        display: none !important;
    }

    /* Hide mobile-only header on desktop */
    .mobile-only-header,
    .mobile-only-section {
        display: none !important;
    }
}

/* Tablet & Mobile: Single Column (<1280px) */
@media (max-width: 1279px) {
    .listing-container {
        display: block;
        max-width: 100%;
        padding: 1rem;
        padding-bottom: 80px;
        /* Space for sticky footer */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    .listing-main {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* Hide sidebar on mobile - content in sticky footer instead */
    .listing-sidebar {
        display: none;
    }

    /* Show sticky footer on mobile */
    .listing-sticky-footer {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        padding: 1rem;
        align-items: center;
        justify-content: space-between;
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    /* Ensure mobile-only elements are visible */
    .mobile-only-header,
    .mobile-only-section {
        display: block !important;
        margin-bottom: 0 !important;
    }

    .contact-section-card {
        margin-top: 1rem;
    }

    .seller-mini-profile-mobile {
        border-top: none !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Mobile Optimizations from Ticket */
    .action-btn,
    .listing-tabs button,
    .gallery-thumbnail {
        min-height: 44px;
    }

    /* Mobile Typography adjustment */
    .listing-title {
        font-size: 1.5rem;
        /* Slightly smaller for mobile */
        line-height: 1.3;
    }

    .listing-price {
        font-size: 1.75rem;
    }
}

/* Section Styling (Both Desktop and Mobile) */
.listing-main>section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.listing-gallery {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Typography Reused */
.listing-title,
.mobile-only-header .listing-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.mobile-only-header .listing-title {
    font-size: 1.5rem;
    /* Slightly smaller for mobile */
}

.listing-price,
.mobile-only-header .listing-price {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
}

.mobile-only-header .listing-price {
    font-size: 1.75rem;
}

.listing-unit,
.mobile-only-header .listing-unit {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

/* Sidebar Specific Layout */
.listing-sidebar .listing-price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 1rem 0;
}

.listing-sidebar .listing-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.listing-sidebar .action-btn {
    width: 100%;
}

.listing-sidebar .contact-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.listing-sidebar .seller-mini-profile {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.listing-sidebar .buyer-protect {
    margin-top: 1rem;
}


.sticky-footer-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.sticky-footer-btn {
    flex: 1;
    max-width: 200px;
    padding: 0.75rem 1.5rem;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}

/* --- NEW ADVERT PAGE LAYOUT --- */

/* 1. Attributes Pills (Keep existing look) */
.attr-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.attr-pill i {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

.listing-attributes-section {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.listing-attributes-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* 2. Component Styles (Adapted from old CSS) */
/* Title & Price - styling is same, just need to ensure keys match */
.listing-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.listing-price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 1rem 0;
}

.listing-price {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
}

.listing-unit {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

/* Actions */
.listing-actions {
    display: flex;
    flex-direction: column;
    /* Stack vertically in sidebar */
    gap: 0.75rem;
    margin-top: 1rem;
}

.listing-actions .action-btn {
    width: 100%;
}


@media (max-width: 767px) {
    /* Further specific tweaks if needed, but 1279px covers most */
}


button,
a {
    touch-action: manipulation;
}

/* Breed Traits Section */
.listing-breed-traits {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--border);
    min-height: 420px;
    transition: min-height 0.3s ease;
}

.listing-breed-traits.is-loading {
    position: relative;
    overflow: hidden;
}

.listing-breed-traits.is-loading .section-subtitle,
.listing-breed-traits.is-loading .trait-score,
.listing-breed-traits.is-loading .trait-bar {
    animation: skeleton-loading 1.5s infinite linear;
    background-color: #f1f5f9;
    color: transparent !important;
    border-color: transparent !important;
}

.listing-breed-traits.is-loading .section-subtitle {
    height: 1.25rem;
    width: 90%;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.listing-breed-traits.is-loading .trait-score {
    width: 32px;
    height: 1.25rem;
    border-radius: 4px;
}

.listing-breed-traits.is-loading .trait-bar {
    border-radius: 4px;
}

.listing-breed-traits.is-loading .trait-bar-fill {
    opacity: 0;
}

/* Replaced by .section-header */
.breed-traits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.trait-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trait-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.trait-score {
    color: #22c55e;
    font-weight: 700;
}

.trait-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.trait-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 4px;
    transition: width 1s ease-out;
}

@media (max-width: 768px) {
    .breed-traits-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Related Adverts --- */
.listing-related-adverts {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Replaced by .section-header */
.related-adverts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.related-advert-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.related-advert-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.related-advert-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #e2e8f0;
}

.related-advert-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-advert-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-advert-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #22c55e;
    margin: 0 0 0.5rem 0;
}

.related-advert-location {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
}

/* Mobile: 2-column grid */
@media (max-width: 767px) {
    .related-adverts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .related-advert-image {
        height: 120px;
    }

    .related-advert-title {
        font-size: 0.9rem;
    }

    .related-advert-price {
        font-size: 1rem;
    }
}

/* --- Status Badges --- */
.listing-status-badge {
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending,
.status-needs_review {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fef3c7;
}

.status-approved {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-rejected {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.status-sold {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}

.status-expired {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* --- Final Mobile Optimizations --- */

/* Prevent double-tap zoom & optimize touch */
button,
a,
.action-btn,
.btn,
.nav-links a {
    touch-action: manipulation;
}

/* Smooth scrolling on containers */
html,
body,
.listing-container,
.browse-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Enforce minimum tap targets for mobile/tablet */
@media (max-width: 1279px) {

    button,
    a.btn,
    .action-btn,
    .btn,
    .nav-links a,
    .mobile-menu-toggle {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Form Input Optimization for Mobile (<= 767px) */
@media (max-width: 767px) {

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevents iOS auto-zoom */
        padding: 12px 16px !important;
        min-height: 48px;
    }

    .action-btn,
    .btn {
        width: 100%;
        /* Full width buttons on mobile usually better */
    }
}

/* Reduce Layout Shift (CLS) with Aspect Ratio */
.listing-gallery img,
.related-advert-image,
.listing-card img,
.gallery-main img,
.photo-preview img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background-color: #f1f5f9;
}

/* Reduced Motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Section Headers with Icons --- */

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
}

/* --- Section-Specific Styling --- */

/* Description Section */
.listing-description {
    background: linear-gradient(to bottom, #f0fdf4 0%, white 100%) !important;
    border-left: 4px solid #22c55e !important;
}

/* Health Report Card */
.listing-health-card {
    background: linear-gradient(to bottom, #eff6ff 0%, white 100%) !important;
    border-left: 4px solid #3b82f6 !important;
}

.listing-health-card .health-report-card {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Breed Traits */
.listing-breed-traits {
    background: linear-gradient(to bottom, #f5f3ff 0%, white 100%) !important;
    border-left: 4px solid #8b5cf6 !important;
}

/* Related Adverts */
.listing-related-adverts {
    background: linear-gradient(to bottom, #fff7ed 0%, white 100%) !important;
    border-left: 4px solid #f97316 !important;
}

/* Attributes Section - Keep transparent and remove card styling */
.listing-attributes-section {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-left: 4px solid #64748b !important;
    padding-left: 1rem !important;
    border-radius: 0 !important;
    margin-bottom: 2rem !important;
}

/* Description Tabs */
.desc-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.desc-tab {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.desc-tab:hover {
    color: var(--primary);
}

.desc-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Puppy Grid and Cards */
.puppy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.puppy-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.puppy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.puppy-card-image {
    position: relative;
    height: 180px;
    background: #f1f5f9;
}

.puppy-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.puppy-card-content {
    padding: 1.25rem;
}

.puppy-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.puppy-sex {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.puppy-description {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.puppy-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
}

.availability-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.availability-badge.available {
    background: #22c55e;
    color: white;
}

.availability-badge.reserved {
    background: #f59e0b;
    color: white;
}

.availability-badge.sold {
    background: #64748b;
    color: white;
}

.puppy-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

/* --- Improved Spacing --- */

.listing-main>section {
    margin-bottom: 2rem;
    /* Increase spacing between sections */
}

.listing-main>section:last-child {
    margin-bottom: 0;
}

/* --- Mobile Adjustments --- */

@media (max-width: 1279px) {
    .section-header {
        gap: 0.75rem;
    }

    .section-header-icon {
        width: 40px;
        height: 40px;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .section-subtitle {
        font-size: 0.85rem;
    }
}

/* Active Filters System */
.active-filters-display {
    display: none;
    /* Hidden by default if empty */
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: 0.5rem;
}

.active-filters-display.has-filters {
    display: flex;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.filter-chip:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.filter-chip-text {
    font-weight: 500;
    margin-right: 0.5rem;
}

.filter-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip-remove:hover {
    background: #cbd5e1;
    color: #ef4444;
}

.clear-all-filters {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    margin-left: 0.5rem;
}

.clear-all-filters:hover {
    color: var(--primary-light);
}

/* Badge Top for Sidebar */
.badge-top {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #15803d;
    /* darker green */
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    display: inline-block;
    vertical-align: middle;
}

/* Loading Spinner Overlay */
.results-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid #f1f5f9;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

/* API Error Banner */
.api-error-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.api-error-banner .error-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.api-error-banner .error-text {
    flex: 1;
}

@media (max-width: 768px) {
    .api-error-banner {
        padding: 1rem;
    }

    .api-error-banner .error-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .api-error-banner .btn {
        width: 100%;
    }
}