/* ============================================
   HOME V2 STYLES
   ============================================ */

/* ============================================
   DESIGN TOKENS (Lovable spec)
   ============================================ */
:root {
    --v2-primary: #2d5a3d;
    --v2-primary-hover: #1e3f2a;
    --v2-accent: #d4a847;
    --v2-accent-hover: #b8912f;
    --v2-bg: #f8f6f2;
    --v2-bg-card: #ffffff;
    --v2-fg: #2b2b2b;
    --v2-muted: #6b7280;
    --v2-border: #e5e7eb;
    --v2-font: Plus Jakarta Sans, system-ui, sans-serif;
    --v2-secondary: 40 33% 92%;
}

/* Override style.css body overflow:hidden which breaks position:sticky */
body {
    overflow: visible;
}

.page-content-v2 {
    background: var(--v2-bg);
    /* padding-bottom: 80px; */
}

/* --- Header V2 ---
   z-index must beat any positioned content on pages it sits above. The
   dogs-for-sale filter sidebar is at z-index: 1000 (so it can be a fixed
   slide-over on mobile), so the header — and its open Dogs-For-Sale
   dropdown — must sit at z-index >= that to render in front. */
.header-v2 {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1500;
    background: #fff;
    box-shadow: 0 1px 0 0 var(--v2-border);
}

/* Top row: Logo | Search | Actions */
.header-v2 .header-top-row {
    border-bottom: 1px solid var(--v2-border);
}

.header-v2 .header-top-inner {
    display: flex;
    align-items: center;
    padding: 14px 40px;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.header-v2 .logo {
    /* Shrinkable: on very narrow viewports (<~315px) the logo scales down
       instead of pushing the avatar button past the right edge — every
       other top-bar item is fixed-size. */
    min-width: 0;
}

.header-v2 .logo a {
    display: flex;
    align-items: center;
}

.header-v2 .logo img {
    height: 35px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

/* Bottom row: Nav links */
.header-v2 .header-bottom-inner {
    display: flex;
    align-items: center;
    padding: 0 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Desktop nav */
.header-v2 .desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-v2 .desktop-nav .nav-item {
    position: relative;
}

.header-v2 .desktop-nav .nav-link {
    font-family: var(--v2-font);
    font-weight: 500;
    font-size: 14px;
    color: var(--v2-muted);
    text-decoration: none;
    padding: 10px 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    /* Reset native <button> chrome so the DFS toggle is visually identical
       to the sibling <a class="nav-link"> items. */
    border: 0;
    background: transparent;
    cursor: pointer;
    appearance: none;
}

.nav-item:has(.dfs-dropdown.open) .nav-link {
    color: var(--v2-primary);
    background-color: hsl(var(--v2-secondary));
    border-radius: 8px;
}

.header-v2 .desktop-nav .nav-link:hover,
.header-v2 .desktop-nav .nav-link.active {
    color: var(--v2-primary);
    background-color: hsl(var(--v2-secondary));
    border-radius: 8px;
}

.header-v2 .desktop-nav .nav-link .chevron {
    width: 10px;
    height: 10px;
    transition: transform 0.2s;
    color: #666;
}

.nav-item:has(.dfs-dropdown.open) .nav-link .chevron {
    transform: rotate(180deg);
}

/* Header search bar (desktop) — wide, centered */
.header-v2 .header-search {
    display: flex;
    align-items: center;
    border-color: hsl(40 20% 88%);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    gap: 8px;
    flex: 1;
    max-width: 520px;
    margin: 0 auto;
    position: relative;
}

.header-v2 .header-search .search-icon {
    width: 16px;
    height: 16px;
    color: #888;
    flex-shrink: 0;
    position: absolute;
    left: 12px;
    top: 10px;
    line-height: 24px;
}

.header-v2 .header-search input {
    border: none;
    background-color: hsl(40 33% 92%);
    font-family: var(--v2-font);
    font-size: 14px;
    color: #333;
    width: 100%;
    line-height: 1.25;
    padding-bottom: 8px;
    padding-left: 40px;
    padding-right: 12px;
    padding-top: 8px;
}

.header-v2 .header-search input::placeholder {
    color: #999;
}

.header-v2 .header-search input:focus-visible {
    outline: 2px solid transparent;
    --offset-width: 2px;
    --ring-width: 3px;
    --offset-color: #ffffff;
    --ring-color: hsl(147 33% 26%);
    box-shadow:
        0 0 0 var(--offset-width) var(--offset-color),
        0 0 0 calc(var(--offset-width) + var(--ring-width)) var(--ring-color);
}

/* Header right actions */
.header-v2 .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-v2 .post-listing-btn {
    font-family: var(--v2-font);
    font-weight: 500;
    font-size: 14px;
    color: #000;
    background-color: var(--v2-accent);
    border: none;
    border-radius: 8px;
    padding: 9px 11px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.header-v2 .post-listing-btn:hover {
    background-color: var(--v2-accent-hover);
    color: #000;
}

/* User avatar button + dropdown menu */
.header-v2 .auth-avatar-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.header-v2 .auth-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--v2-primary);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition:
        opacity 0.2s ease,
        transform 0.05s ease;
    padding: 0;
}

.header-v2 .auth-avatar-btn:hover {
    opacity: 0.9;
}

.header-v2 .auth-avatar-btn[aria-expanded="true"] {
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.18);
}

.header-v2 .auth-avatar-btn svg {
    width: 18px;
    height: 18px;
}

.header-v2 .auth-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--v2-border, #e5e7eb);
    border-radius: 12px;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 60;
    font-family: var(--v2-font);
}

.header-v2 .auth-menu.open {
    display: flex;
    animation: auth-menu-in 0.12s ease-out;
}

@keyframes auth-menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-v2 .auth-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--v2-fg, #1a1a1a);
    font-family: var(--v2-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    transition:
        background 0.12s ease,
        color 0.12s ease;
    width: 100%;
}

.header-v2 .auth-menu-item:hover,
.header-v2 .auth-menu-item:focus-visible {
    background: rgba(45, 90, 61, 0.06);
    color: var(--v2-primary, #2d5a3d);
    outline: none;
}

.header-v2 .auth-menu-item.is-danger {
    color: #b00020;
}

.header-v2 .auth-menu-item.is-danger:hover,
.header-v2 .auth-menu-item.is-danger:focus-visible {
    background: rgba(176, 0, 32, 0.06);
    color: #800018;
}

.header-v2 .auth-menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================
   MOBILE HAMBURGER + NAV DRAWER
   Visible <=768px (when desktop .header-bottom-row nav is hidden). Provides
   access to Blog, Pricing, Contact, FAQs, Buying Tips that the 4-item
   bottom-nav doesn't cover.
   ============================================ */
.header-v2 .mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--v2-fg);
    cursor: pointer;
    margin-right: -4px;
    /* slight negative margin so the icon's optical center aligns with the logo's left edge */
}

.header-v2 .mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 85vw);
    background: #fff;
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
}

.mobile-nav-drawer.is-open {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--v2-border);
}

.mobile-nav-title {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 14px;
    color: var(--v2-fg);
    margin: 0;
    letter-spacing: normal;
}

.mobile-nav-close {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--v2-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-close svg {
    width: 24px;
    height: 24px;
    display: block;
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

.mobile-nav-links a {
    display: block;
    padding: 14px 20px;
    font-family: var(--v2-font);
    font-size: 15px;
    font-weight: 500;
    color: var(--v2-fg);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: hsl(var(--v2-secondary));
    color: var(--v2-primary);
    border-left-color: var(--v2-primary);
    text-decoration: none;
}

/* Mobile search icon */
.header-v2 .mobile-search-toggle {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #333;
}

.header-v2 .mobile-search-toggle svg {
    width: 20px;
    height: 20px;
}

/* Mobile expandable search */
.header-v2 .mobile-search-bar {
    display: none;
    padding: 8px 16px 12px;
    background: #fff;
}

.header-v2 .mobile-search-bar.open {
    display: block;
}

.header-v2 .mobile-search-bar .search-input-wrap {
    display: flex;
    align-items: center;
    background: #f5f5f4;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
}

.header-v2 .mobile-search-bar input {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--v2-font);
    font-size: 14px;
    color: #333;
    width: 100%;
}

.header-v2 .mobile-search-bar input::placeholder {
    color: #999;
}

.header-v2 .mobile-search-bar .search-icon {
    width: 16px;
    height: 16px;
    color: #888;
    flex-shrink: 0;
}

/* --- Dogs For Sale Mega Dropdown --- */
.dfs-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 24px;
    min-width: 340px;
    display: none;
    z-index: 200;
}

.dfs-dropdown.open {
    display: block;
}

.dfs-dropdown .dropdown-section-title {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.dfs-dropdown .category-links {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.dfs-dropdown .category-links li:hover {
    color: var(--v2-primary);
    background-color: hsl(var(--v2-secondary));
    border-radius: 8px;
}

.dfs-dropdown .category-links li a {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    padding: 6px;
    display: block;
    transition: color 0.2s;
}

.dfs-dropdown .category-links li a:hover {
    color: var(--v2-primary);
}

.dfs-dropdown .breed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dfs-dropdown .breed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 4px 0;
}

.dfs-dropdown .breed-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.dfs-dropdown .breed-item span {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dfs-dropdown .breed-item:hover span {
    color: var(--v2-primary);
}

/* --- Hero Section V2 --- */
.hero-v2 {
    position: relative;
    min-height: 600px;
    background-size: cover;
    background-position: 60% center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.hero-v2 .wrapper {
    padding:;
}

.hero-v2::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(43, 43, 43, 0.4),
        rgba(43, 43, 43, 0.5),
        rgba(43, 43, 43, 0.7)
    );
    z-index: 1;
}

.hero-v2 .hero-content {
    position: relative;
    z-index: 2;
    max-width: 672px;
    /* padding: 64px 40px; */
    width: 100%;
}

.hero-v2 .hero-content h1 {
    font-family: var(--v2-font);
    font-weight: 800;
    font-size: 60px;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: #fff;
    margin-bottom: 16px;
    text-wrap: balance;
}

.hero-v2 .hero-content .hero-subtitle {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
    max-width: 512px;
}

/* Hero search form — white card with cream input/select pills inside */
.hero-search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 8px;
    gap: 8px;
    /* max-width: 600px; */
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    justify-content: space-evenly;
}

.hero-search-form .search-input-group {
    position: relative;
    /* flex: 1; */
    /* min-width: 0; */
}

.hero-search-form .search-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--v2-muted);
    pointer-events: none;
}

.hero-search-form .search-input {
    width: 100%;
    max-width: 350px;
    height: 44px;
    border: none;
    outline: none;
    background: hsl(var(--v2-secondary));
    font-family: var(--v2-font) !important;
    font-size: 14px !important;
    color: var(--v2-fg);
    padding: 0 12px 0 40px;
    border-radius: 8px;
    box-sizing: border-box;
    line-height: 1.25rem;
}

.hero-search-form .search-input::placeholder {
    color: var(--v2-muted);
}

.hero-search-form .search-divider {
    display: none;
}

.hero-search-form .category-select {
    height: 44px;
    width: 160px;
    font-family: var(--v2-font) !important;
    font-size: 14px !important;
    color: var(--v2-fg);
    border: none;
    outline: none;
    background: hsl(var(--v2-secondary));
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: auto;
}

.hero-search-form .search-btn {
    height: 44px;
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background-color: var(--v2-primary);
    border: none;
    border-radius: 8px;
    padding: 0 32px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.hero-search-form .search-btn:hover {
    background-color: var(--v2-primary-hover);
}

/* Quick filter chips — 20% white pills with backdrop blur */
.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.hero-chips .chip {
    font-family: var(--v2-font);
    font-weight: 500;
    font-size: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    border-radius: 9999px;
    padding: 6px 12px;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.hero-chips .chip:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* --- How It Works Section --- */
.how-it-works {
    padding: 80px 40px;
    background: var(--v2-bg-card);
    text-align: center;
}

.how-it-works .how-it-works-header {
    margin-bottom: 48px;
}

.how-it-works .section-heading {
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 24px;
    color: var(--v2-fg);
    margin-bottom: 8px;
}

@media (min-width: 640px) {
    .how-it-works .section-heading {
        font-size: 30px;
    }
}

.how-it-works .section-subheading {
    font-family: var(--v2-font);
    font-weight: 300;
    font-size: 16px;
    color: var(--v2-muted);
    margin: 0;
}

.how-it-works .steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .how-it-works .steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

.how-it-works .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    /* Fade-in-up — JS toggles .is-visible on scroll-into-view (replicates framer-motion whileInView) */
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
    transition-delay: var(--step-delay, 0s);
}

.how-it-works .step.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .how-it-works .step {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.how-it-works .step-icon {
    width: 56px;
    height: 56px;
    background: rgba(45, 90, 61, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.how-it-works .step-icon svg {
    width: 24px;
    height: 24px;
    color: var(--v2-primary);
}

.how-it-works .step h3 {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 18px;
    color: var(--v2-fg);
    margin-bottom: 8px;
}

.how-it-works .step p {
    font-family: var(--v2-font);
    font-weight: 300;
    font-size: 14px;
    line-height: 1.625;
    color: var(--v2-muted);
    margin: 0;
}

/* --- Featured Listings Section --- */
.featured-listings {
    padding: 0px 40px 80px 40px;
    background: var(--v2-bg);
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto 32px;
}

.featured-title {
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 28px;
    color: var(--v2-fg);
    margin-bottom: 4px;
}

.featured-subtitle {
    font-family: var(--v2-font);
    font-weight: 300;
    font-size: 15px;
    color: var(--v2-muted);
    margin: 0;
}

.view-all-link,
.all-breeds-link {
    font-family: var(--v2-font);
    font-weight: 500;
    font-size: 14px;
    color: var(--v2-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 4px;
}

.view-all-link:hover,
.all-breeds-link:hover {
    color: var(--v2-primary-hover);
}

/* Listings grid */
.listings-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Listing card — Lovable: rounded-xl, soft shadow, hover lift -translate-y-1 + bigger shadow */
.listing-card-v2 {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: var(--v2-bg-card);
    overflow: hidden;
    box-shadow:
        0 1px 3px 0 hsla(0, 0%, 0%, 0.06),
        0 1px 2px -1px hsla(0, 0%, 0%, 0.06);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.listing-card-v2:hover {
    transform: translateY(-4px);
    color: inherit;
    box-shadow:
        0 10px 25px -5px hsla(0, 0%, 0%, 0.1),
        0 8px 10px -6px hsla(0, 0%, 0%, 0.08);
}

/* Listing image — Lovable: hover scale 1.05 with 500ms duration on the IMG only */
.listing-image-v2 {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.listing-image-v2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.listing-card-v2:hover .listing-image-v2 img {
    transform: scale(1.05);
}

/* Category pill — Lovable: rounded-full pill, exact HSL token colours */
.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 9999px;
    color: #fff;
    z-index: 2;
}

.badge-puppy {
    background-color: hsl(213, 80%, 50%);
}

.badge-part-trained {
    background-color: hsl(30, 85%, 52%);
}

.badge-trained {
    background-color: hsl(147, 50%, 40%);
}

.badge-stud {
    background-color: hsl(270, 50%, 50%);
}

/* Photo-count badge — Lovable: dark glass with backdrop-blur and a Lucide Camera icon */
.image-count-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-family: var(--v2-font);
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.image-count-badge svg {
    width: 12px;
    height: 12px;
    display: block;
}

/* Listing info */
.listing-info-v2 {
    padding: 14px 16px 16px;
}

.listing-title-v2 {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 14px;
    color: var(--v2-fg);
    margin-bottom: 4px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    transition: color 0.2s ease;
}

.listing-card-v2:hover .listing-title-v2 {
    color: var(--v2-primary);
}

.listing-breed-v2 {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 12px;
    color: var(--v2-muted);
    margin-bottom: 8px;
}

.listing-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.listing-price-v2 {
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 18px;
    color: var(--v2-fg);
}

.listing-location-v2 {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 12px;
    color: var(--v2-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.listing-location-v2 svg {
    width: 12px;
    height: 12px;
    color: currentColor;
    display: block;
    flex-shrink: 0;
}

/* Footer row — Lovable: top border separator between price row and seller row */
.listing-meta-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--v2-border);
}

.listing-seller-v2 {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 12px;
    color: var(--v2-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}


.listing-time-v2 {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 12px;
    color: var(--v2-muted);
}

/* View all (mobile) */
.view-all-mobile {
    display: none;
    text-align: center;
    padding-top: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.view-all-listings-btn {
    font-family: var(--v2-font);
    font-weight: 500;
    font-size: 15px;
    color: var(--v2-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.view-all-listings-btn:hover {
    color: var(--v2-primary-hover);
}

/* --- Browse by Breed Section --- */
.browse-by-breed {
    padding: 80px 40px;
    background: var(--v2-bg-card);
}

.breed-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto 32px;
}

.breed-section-title {
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 28px;
    color: var(--v2-fg);
    margin-bottom: 4px;
}

.breed-section-subtitle {
    font-family: var(--v2-font);
    font-weight: 300;
    font-size: 15px;
    color: var(--v2-muted);
    margin: 0;
}

/* Breed grid — Lovable: 4:3 image cards with text overlay, gradient backdrop, 2/3/4 columns */
.breed-grid-v2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.breed-card-v2 {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;

    /* Fade-in-up on scroll-into-view — y:15 offset, 0.05s stagger × 0.4s duration (snappy) */
    opacity: 0;
    transform: translateY(15px);
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
    transition-delay: var(--breed-delay, 0s);
}

.breed-card-v2.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .breed-card-v2 {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.breed-card-v2 img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.breed-card-v2:hover img {
    transform: scale(1.1);
}

/* Dark gradient overlay — readable text against any breed photo */
.breed-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        hsla(0, 0%, 17%, 0.7) 0%,
        hsla(0, 0%, 17%, 0.2) 50%,
        transparent 100%
    );
    pointer-events: none;
}

/* Text bottom-anchored over the image */
.breed-card-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.breed-card-name {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 14px;
    color: hsl(40, 33%, 96%);
    line-height: 1.25;
}

@media (min-width: 640px) {
    .breed-card-name {
        font-size: 16px;
    }
}

.breed-card-count {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 12px;
    color: rgba(252, 250, 244, 0.75);
    color: hsla(40, 33%, 96%, 0.75);
    line-height: 1.25;
}

/* --- Mobile Bottom Nav --- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--v2-border);
    z-index: 1000;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav .nav-items a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #888;
    font-family: var(--v2-font);
    font-size: 10px;
    font-weight: 500;
    padding: 4px 12px;
    transition: color 0.2s;
}

.bottom-nav .nav-items a.active {
    color: var(--v2-primary);
}

.bottom-nav .nav-items a svg {
    width: 22px;
    height: 22px;
}

.bottom-nav .nav-items a .post-icon-circle {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav .nav-items a .post-icon-circle svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet / medium screens */
@media (max-width: 1024px) {
    .header-v2 .header-top-inner {
        padding: 12px 20px;
    }

    .header-v2 .header-bottom-inner {
        padding: 0 20px;
    }

    .header-v2 .header-search {
        max-width: 380px;
    }

    .hero-v2 .hero-content {
        padding: 40px 20px 60px;
    }

    .hero-v2 .hero-content h1 {
        font-size: 40px;
    }

    .featured-listings {
        padding: 0px 20px 60px 20px;
    }

    .browse-by-breed {
        padding: 60px 20px;
    }

    .breed-grid-v2 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet breakpoint */
@media (max-width: 868px) {
    /* Hide desktop search, show mobile search icon */
    .header-v2 .header-search {
        display: none;
    }

    .header-v2 .mobile-search-toggle {
        display: flex;
    }

    /* With the desktop search bar hidden, push actions to the right edge so
       the logo and actions are visually separated instead of clustering left. */
    .header-v2 .header-actions {
        margin-left: auto;
    }

    .header-v2 .header-top-inner {
        padding: 12px 16px;
    }

    .hero-v2 {
        min-height: 560px;
    }

    .hero-v2 .hero-content h1 {
        font-size: 36px;
    }

    .listings-grid-v2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    /* Hide desktop nav row */
    .header-v2 .header-bottom-row {
        display: none;
    }

    .header-v2 .header-top-inner {
        padding: 10px 16px;
    }

    .header-v2 .logo img {
        height: 26px;
    }

    /* Hide header Post Listing — bottom-nav has a "Post" tab pointing at the
       same /place-ad URL, and Post Listing's ~111px width crowds the header. */
    .header-v2 .post-listing-btn {
        display: none;
    }

    /* Show hamburger — opens the mobile nav drawer (Blog, Pricing, Contact, …). */
    .header-v2 .mobile-menu-toggle {
        display: inline-flex;
    }

    /* Show bottom nav */
    .bottom-nav {
        display: block;
    }

    /* Hero adjustments */
    .hero-v2 {
        min-height: 520px;
        align-items: flex-start;
    }

    .hero-v2::before {
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.5) 0%,
            rgba(0, 0, 0, 0.35) 100%
        );
    }

    .hero-v2 .hero-content {
        padding: 40px 12px 40px;
        max-width: 100%;
    }

    .hero-v2 .hero-content h1 {
        font-size: 32px;
    }

    .hero-v2 .hero-content .hero-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    /* Stack hero search form vertically — same cream pills, just stacked */
    .hero-search-form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px;
    }

    .hero-search-form .search-input-group {
        width: 100%;
    }

    /* In column layout the input matches the full row width like its siblings,
       overriding the desktop max-width: 350px (which would leave dead space). */
    .hero-search-form .search-input {
        max-width: 100%;
    }

    .hero-search-form .category-select {
        width: 100%;
    }

    .hero-search-form .search-btn {
        width: 100%;
        padding: 0;
    }

    /* Chips */
    .hero-chips {
        max-width: 100%;
    }

    /* How it works */
    .how-it-works {
        padding: 60px 20px;
    }

    .how-it-works .how-it-works-header {
        margin-bottom: 40px;
    }

    /* Featured listings */
    .featured-listings,
    .browse-by-breed {
        padding: 48px 16px;
    }

    .listings-grid-v2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .view-all-mobile {
        display: block;
    }

    .featured-header .view-all-link {
        display: none;
    }

    /* Browse by breed */
    .breed-grid-v2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Match Featured Listings — hide desktop "All Breeds" link on mobile */
    .breed-section-header .all-breeds-link {
        display: none;
    }

    /* Extra padding at bottom for bottom nav */
    .page-content-v2 {
        padding-bottom: 70px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero-v2 .hero-content h1 {
        font-size: 28px;
    }

    .hero-v2 .hero-content .hero-subtitle {
        font-size: 13px;
    }

    .how-it-works .section-subheading {
        font-size: 14px;
    }

    .featured-title,
    .breed-section-title {
        font-size: 22px;
    }

    .featured-subtitle,
    .breed-section-subtitle {
        font-size: 13px;
    }
}

/* Dropdown close when clicking outside */
.dfs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
}

.dfs-overlay.open {
    display: block;
}

/* ============================================
   WHY CHOOSE SECTION
   ============================================ */
/* --- Why Choose Section (Lovable: 4-card feature grid on dark green) ---
   Lovable token map: primary-foreground = hsl(40 33% 96%) (warm near-white).
   Cards use it at 10% alpha for background, 15% for icon-well, 75% for body copy. */
.why-choose {
    padding: 64px 40px;
    background: var(--v2-primary);
}

@media (min-width: 1024px) {
    .why-choose {
        padding: 80px 40px;
    }
}

.why-choose-header {
    max-width: 900px;
    margin: 0 auto 48px;
    text-align: center;
}

.why-choose-heading {
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 24px;
    color: hsl(40, 33%, 96%);
    line-height: 1.25;
    margin: 0;
}

@media (min-width: 640px) {
    .why-choose-heading {
        font-size: 30px;
    }
}

.why-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .why-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .why-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.why-card {
    padding: 24px;
    border-radius: 12px;
    background: rgba(252, 250, 244, 0.1);
    background: hsla(40, 33%, 96%, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-align: center;

    /* Fade-in-up on scroll-into-view (JS toggles .is-visible). Same pattern as How It Works. */
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
    transition-delay: var(--card-delay, 0s);
}

.why-card.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .why-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.why-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 12px;
    background: rgba(252, 250, 244, 0.15);
    background: hsla(40, 33%, 96%, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.why-card-icon svg {
    width: 24px;
    height: 24px;
    color: hsl(40, 33%, 96%);
}

.why-card h3 {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 16px;
    color: hsl(40, 33%, 96%);
    margin: 0 0 8px;
}

.why-card p {
    font-family: var(--v2-font);
    font-size: 14px;
    line-height: 1.625;
    color: rgba(252, 250, 244, 0.75);
    color: hsla(40, 33%, 96%, 0.75);
    margin: 0;
}

/* ============================================
   PARTNERS ROW (banner carousel)
   Class names avoid "ad"/"advert" to dodge content-blockers.
   ============================================ */
.partners-row {
    padding: 56px 16px;
    background: var(--v2-bg);
    position: relative;
}

.partners-row > .container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.partners-row-heading {
    font-family: var(--v2-font);
    font-size: 18px;
    font-weight: 600;
    color: var(--v2-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: center;
    margin: 0 0 28px;
}

.partners-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0 8px;
    /* Avoid layout shift while images load */
    min-height: 80px;
}
.partners-track::-webkit-scrollbar {
    display: none;
}

.partners-slide {
    flex: 0 0 auto;
    scroll-snap-align: center;
    display: block;
    border-radius: 12px;
    overflow: hidden;
}

.partners-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* Desktop track: 1-up wide banners. Slide width = scrollport width so the
   next/prior slide never bleeds in regardless of image aspect — the .partners-slide
   img uses object-fit: contain, so narrower banners are letterboxed cleanly inside
   their slide rather than allowing the carousel to reveal neighbours. */
.partners-track-desktop .partners-slide {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 6 / 1;
}

/* Mobile track: tighter portrait banners shown on small screens */
.partners-track-mobile {
    display: none;
}
.partners-track-mobile .partners-slide {
    width: 280px;
    aspect-ratio: 16 / 9;
}

@media (max-width: 768px) {
    .partners-track-desktop {
        display: none;
    }
    .partners-track-mobile {
        display: flex;
    }
    .partners-row {
        padding: 40px 12px;
    }
}

.partners-arrows {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.partners-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--v2-border);
    background: #fff;
    color: var(--v2-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.partners-arrow svg {
    width: 18px;
    height: 18px;
    display: block;
}

.partners-arrow:hover {
    background: var(--v2-primary);
    color: #fff;
    border-color: var(--v2-primary);
}

@media (max-width: 768px) {
    .partners-arrows {
        display: none;
    }
}

/* ============================================
   NEWSLETTER V2 SECTION
   ============================================ */
.newsletter-v2 {
    padding: 80px 40px;
    background: var(--v2-bg);
}

.newsletter-card {
    /* max-width: 860px; */
    margin: 0 auto;
    background: var(--v2-bg-card);
    border: 1px solid var(--v2-border);
    border-radius: 16px;
    padding: 56px 48px;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.newsletter-icon {
    width: 48px;
    height: 48px;
    background: #f0ebe0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.newsletter-icon svg {
    width: 24px;
    height: 24px;
    color: var(--v2-accent);
}

.newsletter-heading {
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 28px;
    color: var(--v2-fg);
    margin-bottom: 8px;
}

.newsletter-subtitle {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 15px;
    color: var(--v2-muted);
    margin-bottom: 28px;
}

/* 3-col grid: row 1 = selects + email, row 2 = Turnstile widget, row 3 = Subscribe.
   The Turnstile widget (~300x65) doesn't fit inline with the form fields without
   crushing them ("Select bre…" truncation), so it gets its own row. */
.newsletter-form-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    align-items: center;
}

.newsletter-form-v2 .cf-turnstile {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    min-height: 65px;
    margin-top: 4px;
}

.newsletter-form-v2 .newsletter-submit-btn {
    grid-column: 1 / -1;
    justify-self: center;
    min-width: 200px;
    padding: 12px 40px;
    margin-top: 4px;
}

.newsletter-select,
.newsletter-email {
    font-family: var(--v2-font) !important;
    font-size: 14px;
    color: var(--v2-fg) !important;
    border: 1px solid var(--v2-border);
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--v2-bg);
    outline: none;
    width: 100%;
    min-width: 0;
}

/* Custom chevron — strips native arrow and replaces with v2-muted SVG */
.newsletter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 36px;
    cursor: pointer;
}

.newsletter-select:focus,
.newsletter-email:focus {
    border-color: var(--v2-primary);
}

.newsletter-select:disabled {
    color: var(--v2-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.newsletter-email::placeholder {
    color: var(--v2-muted);
}

.newsletter-submit-btn {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background: var(--v2-primary);
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    /* flex-shrink: 0; */
}

.newsletter-submit-btn:hover {
    background: var(--v2-primary-hover);
}

/* Newsletter result alert — sits between the Turnstile widget and the Submit
   button. Spans the full form-row width regardless of which grid column it
   lands in. Hidden until the AJAX handler populates it (or until a server
   redirect flashes a session message). */
.newsletter-form-v2 .newsletter-message {
    grid-column: 1 / -1;
    font-family: var(--v2-font);
    font-size: 14px;
    line-height: 1.4;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    margin: 0;
    text-align: left;
    animation: newsletter-message-in 0.18s ease-out;
}

.newsletter-form-v2 .newsletter-message[hidden] {
    display: none;
}

.newsletter-form-v2 .newsletter-message--success {
    background: hsl(147 33% 95%);
    color: hsl(147 33% 18%);
    border-color: hsl(147 33% 70%);
}

.newsletter-form-v2 .newsletter-message--error {
    background: hsl(0 70% 96%);
    color: hsl(0 60% 30%);
    border-color: hsl(0 70% 80%);
}

@keyframes newsletter-message-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .newsletter-form-v2 .newsletter-message {
        animation: none;
    }
}

/* ============================================
   FOOTER V2
   ============================================ */
.footer-v2 {
    background: #fff;
    border-top: 1px solid #eee;
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand .footer-logo img {
    height: 32px;
    width: auto;
    margin-bottom: 16px;
}

.footer-tagline {
    font-family: var(--v2-font);
    font-weight: 300;
    font-size: 14px;
    line-height: 1.6;
    color: var(--v2-muted);
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--v2-muted);
    background: hsl(var(--v2-secondary));
    transition:
        color 0.18s ease,
        background 0.18s ease;
}

.footer-social a:hover {
    color: #fff;
    background: var(--v2-primary);
}

.footer-social a svg {
    width: 16px;
    height: 16px;
}

.footer-column h4 {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 15px;
    color: var(--v2-fg);
    margin-bottom: 16px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    font-family: var(--v2-font);
    font-weight: 400;
    font-size: 14px;
    color: var(--v2-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column ul li a:hover,
.footer-column ul li a.active {
    color: var(--v2-primary);
    font-weight: 500;
}

.footer-bottom {
    border-top: 1px solid #eee;
    text-align: center;
    padding: 20px 40px;
}

.footer-bottom p {
    font-family: var(--v2-font);
    font-weight: 300;
    font-size: 13px;
    color: var(--v2-muted);
    margin: 0;
}

.footer-bottom .footer-company {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.6;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   RESPONSIVE — ADDITIONS
   ============================================ */

/* Why choose, newsletter, footer — tablet small */
@media (max-width: 868px) {
    .newsletter-card {
        padding: 40px 32px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .why-choose {
        padding: 60px 20px;
    }

    .why-choose-header {
        margin-bottom: 32px;
    }

    .newsletter-v2 {
        padding: 48px 16px;
    }

    .newsletter-card {
        padding: 32px 20px;
    }

    .newsletter-heading {
        font-size: 22px;
    }

    /* Single-column stack: each field, the Turnstile widget, and the Subscribe
       button all take a full row. */
    .newsletter-form-v2 {
        grid-template-columns: 1fr;
    }

    .newsletter-form-v2 .newsletter-submit-btn {
        justify-self: stretch;
        padding: 14px;
        min-width: 0;
    }

    /* Footer mobile */
    .footer-main {
        padding: 40px 20px 32px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-tagline {
        max-width: 100%;
    }

    .footer-bottom {
        padding: 16px 20px;
    }
}

/* Small mobile footer — 2 columns for link sections */
@media (min-width: 480px) and (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ============================================
   NARROW MOBILE (300–359px) — minimum supported width
   Adds a 1fr → minmax(0,1fr) grid containment fix for the newsletter form,
   reduces header / hero padding so logo + actions + search-icon fit at 300px,
   and tightens type-scale + card padding for legibility on tiny screens.
   Everything above 360px is untouched.
   ============================================ */
@media (max-width: 359px) {
    /* Header — shrink horizontal padding + flex gaps so logo + search icon
       + avatar fit inside a 300px viewport. Was 16px / 16px gap. */
    .header-v2 .header-top-inner {
        padding: 10px 8px;
        gap: 8px;
    }

    /* Hero — reduce 36px h1 → 26px so the two-word title doesn't crowd the
       search card below it. Tightened content padding to give the search
       card more horizontal room. */
    .hero-v2 .hero-content {
        padding: 32px 6px 48px;
    }

    .hero-v2 .hero-content h1 {
        font-size: 26px;
        line-height: 1.15;
    }

    .hero-v2 .hero-content .hero-subtitle {
        font-size: 14px;
        margin-top: 8px;
    }

    .hero-v2 .hero-search-card,
    .hero-v2 .hero-search {
        padding: 14px;
    }

    /* Section padding — squeeze featured listings / breeds / how-it-works. */
    .featured-listings,
    .browse-by-breed,
    .how-it-works,
    .why-choose {
        padding: 40px 14px;
    }

    .section-heading {
        font-size: 20px;
    }

    /* Newsletter — the critical fix. `grid-template-columns: 1fr` at <=768px
       resolves to minmax(auto, 1fr) which lets the column grow past 1fr to
       fit intrinsic-width children (the 300px Turnstile iframe). Switch to
       minmax(0, 1fr) so the column hard-caps at the container width. */
    .newsletter-v2 {
        padding: 40px 8px;
    }

    .newsletter-card {
        padding: 24px 12px;
    }

    .newsletter-heading {
        font-size: 20px;
    }

    .newsletter-form-v2 {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .newsletter-form-v2 .newsletter-submit-btn {
        padding: 12px;
        font-size: 14px;
    }

    /* Turnstile widget — when JS swaps data-size to "compact" the iframe
       renders at 150×140. Centre it in the single-column grid row.
       Reset the inherited margin-top: 4px on cf-turnstile + submit-btn so
       every form row has the same 10px grid gap (the 4px extra read as a
       "random gap" to the eye when the rest of the grid was 12px-uniform). */
    .newsletter-form-v2 .cf-turnstile {
        min-height: 140px;
        justify-content: center;
        margin-top: 0;
    }

    .newsletter-form-v2 .newsletter-submit-btn {
        margin-top: 0;
    }

    /* Footer — collapse padding so links don't crowd the edges. */
    .footer-main {
        padding: 32px 14px 24px;
    }

    .footer-bottom {
        padding: 14px;
    }

    /* Listing card overrides — the shared card already handles small viewports
       (aspect-ratio: 4/3 image), but the title / meta row needs slightly
       tighter padding so the price chip doesn't crowd the title. */
    .listing-card .listing-body {
        padding: 12px;
    }

    .listing-card .listing-title {
        font-size: 14px;
    }

    .listing-card .listing-meta {
        font-size: 12px;
    }
}

/* Verified-breeder ribbon. Mirrors the boosted ribbon's construction; see the long note
   in dogsforsale.css for why the slot is chosen in Blade rather than with :nth-child. */
.listing-verified-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 110px;
    height: 110px;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
    --ribbon-slot-1: 72px;
}

.listing-verified-ribbon span {
    position: absolute;
    top: 18px;
    right: -32px;
    transform: rotate(45deg);
    display: block;
    width: 150px;
    text-align: center;
    background: hsl(140, 50%, 46%);
    color: #fff;
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 4px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Paired with BOOSTED, the two bands touched exactly and read as a single two-tone
   wedge. The bands are rotated 45deg, so a vertical offset V yields a PERPENDICULAR
   separation of V*cos(45) = V*0.707 -- the old 28px offset gave 19.8px against a band
   ~20px tall, i.e. zero gap. Perpendicular gap G needs V = (bandHeight + G) / 0.707.

   58px here is a ~8px gap. It also needs a bigger clip box: further from the corner the
   band crosses a shorter chord, so the 110px box that suits slot 0 truncates slot 1.
   Only the slot-1 case is enlarged, so a lone VERIFIED ribbon is pixel-identical to
   what it is today. Both numbers are meant to be tuned by eye. */
.listing-verified-ribbon.ribbon-slot-1 {
    width: 140px;
    height: 140px;
}

.listing-verified-ribbon.ribbon-slot-1 span {
    top: var(--ribbon-slot-1);
}
