/* =====================================================
   front-page.css — front-page.php only
   ===================================================== */

/* ── MOBILE HERO SEARCH ───────────────────────────── */

.fp-mobile-hero {
    display: none;
}

@media (max-width: 1299px) {
    .fp-hero-outer,
    .fp-search-section {
        display: none !important;
    }

    .fp-mobile-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 24px 20px 16px;
        gap: 14px;
    }

    .fp-mobile-hero-title {
        font-size: 1.4rem;
        font-weight: 700;
        color: #111;
        margin: 0;
        text-align: center;
    }

    .fp-mobile-search-pill {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        max-width: 340px;
        padding: 10px 16px;
        border-radius: 50px;
        border: 1px solid #838383;
        background: #f3f3f3;
        cursor: pointer;
        transition: box-shadow 0.2s ease;
    }

    .fp-mobile-search-pill:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }

    .fp-mobile-search-pill i {
        color: #999;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .fp-mobile-search-pill input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        font-size: 16px;
        color: #333;
        min-width: 0;
    }

    .fp-mobile-search-pill input::placeholder {
        color: #999;
    }

    /* Hero stays above overlay */
    #fpMobileHero {
        position: relative;
        z-index: 900;
        background: white;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* When search overlay open: hero above overlay */
    body.search-pill-open #fpMobileHero {
        z-index: 10000;
    }

    /* When nav menu open: hero below overlay, not clickable */
    body.nav-open #fpMobileHero {
        z-index: 0;
        pointer-events: none;
    }

    /* Overlay in pill-mode: hides its own search header, starts below hero */
    #searchOverlay.fp-pill-mode .search-header {
        display: none !important;
    }

    #searchOverlay.fp-pill-mode {
        padding-top: 140px;
    }

    /* Close button — fixed to viewport, outside any transformed ancestor */
    #fpPillClose {
        display: none;
        position: fixed;
        top: 16px;
        right: 16px;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 1.3rem;
        color: #555;
        z-index: 20000;
        padding: 6px;
        line-height: 1;
    }

    #fpPillClose.visible {
        display: block;
    }
}

/* ── HERO IMAGE (constrained to category width) ───── */

.fp-hero-outer {
    padding: 32px 20px 0;
}

.fp-hero-wrap {
    max-width: 1100px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    height: 400px;
    position: relative;
}

.fp-hero-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fp-hero-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    pointer-events: none;
}

.fp-hero-text {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 2;
    color: #fff;
    text-align: center;
}

.fp-hero-text h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.fp-hero-text p {
    font-size: 1.05rem;
    margin: 0;
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
    text-align: center;
    line-height: 1.8;
}

/* ── SEARCH (below image, same width) ─────────────── */

.fp-search-section {
    position: relative;
    margin-top: -50px;
    padding: 0 20px 40px;
    z-index: 10;
}

/* While the hero search is open, lift the bar + dropdown above the
   dimmed backdrop (#searchBackdrop, z-index 998) so only the rest dims. */
body.fp-search-open .fp-search-section {
    z-index: 9999;
}

.fp-search-title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.fp-search-outer {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
}

.fp-open .fp-search-outer {
    padding: 0;
}

.fp-search-bar-wrap {
    position: relative;
    width: 100%;
}

/* Search bar */
.fp-search-bar {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.95rem;
    border-radius: 50px;
    border: none;
    background: #ffffff;
    color: #333;
    transition: border-color 0.2s;
    gap: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

.fp-search-icon {
    color: #999;
    font-size: 1.2rem;
    flex-shrink: 0;
}

#fp-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
    min-width: 0;
    font-weight: 400;
    color: #222;
}

#fp-search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.fp-search-submit {
    background: transparent;
    color: #999;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s;
}

.fp-search-submit:hover {
    color: #666;
}

/* Dropdown panel — absolute, positioned below bar */
.fp-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 9998;
    overflow-y: auto;
    max-height: 0;
    padding: 0;
    transition: max-height 0.15s ease-out;
    pointer-events: none;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

.fp-open .fp-search-dropdown {
    max-height: 80vh;
    padding: 8px 0 12px;
    pointer-events: auto;
    border-radius: 0 0 10px 10px;
    border-top: 1px solid #838383;
}

.fp-open .fp-search-bar {
    border-radius: 10px 10px 0 0;
    border: none;
    background: #fff;
}

/* Hide scrollbar but keep functionality */
.fp-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.fp-search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.fp-search-dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.fp-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Section label: "Recently Viewed" */
.fp-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 10px 20px 6px;
    margin: 0;
}

/* Items inside dropdown */
#fp-search-dropdown .zoo-card {
    padding: 14px 20px;
    gap: 16px;
    border-radius: 0;
    align-items: center;
}

#fp-search-dropdown .zoo-card:hover {
    background: #f9f9f9;
}

#fp-search-dropdown .zoo-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

#fp-search-dropdown .near-me-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
}

#fp-search-dropdown .zoo-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px;
}

#fp-search-dropdown .zoo-location {
    font-size: 13px;
    color: #666;
    margin: 0 0 6px;
}

#fp-search-dropdown .zoo-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

#fp-search-dropdown .rating {
    font-size: 13px;
    margin: 0;
}

#fp-search-dropdown .zoo-name {
    font-size: 16px;
}

/* ── CATEGORIES ───────────────────────────────────── */

.fp-categories {
    padding: 48px 20px;
    background: #fff;
}

.fp-categories-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.fp-cat-box {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    display: block;
    aspect-ratio: 1 / 1;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.fp-cat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.fp-cat-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fp-cat-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 55%);
}

.fp-cat-label {
    position: absolute;
    bottom: 14px;
    left: 16px;
    z-index: 2;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

@media (max-width: 600px) {
    .fp-categories-inner {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* ── ZOO ROW SECTION ──────────────────────────────── */

.fp-zoo-row {
    padding: 40px 0 48px;
    background: #fff;
}

.fp-zoo-row-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.fp-row-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fp-row-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: #111;
}

.fp-row-title-link {
    color: #111;
    text-decoration: none !important;
    cursor: pointer;
}

.fp-row-header:hover .fp-has-link .fp-row-title-link {
    color: #1a7a3c;
}


.fp-country-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #1a7a3c;
    background: #e8f5ed;
    border-radius: 50px;
    padding: 2px 10px;
    vertical-align: middle;
    white-space: nowrap;
}

.fp-see-all {
    margin-left: auto;
    font-size: 0.9rem;
    color: #1a7a3c;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.fp-see-all:hover {
    text-decoration: underline;
}

/* ── SCROLLABLE TRACK ─────────────────────────────── */

.fp-scroll-container {
    position: relative;
}

.fp-scroll-track {
    display: flex;
    gap: 16px;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background: #fff;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    user-select: none;
}

.fp-scroll-track.fp-dragging {
    scroll-snap-type: none;
}

.fp-scroll-track::-webkit-scrollbar {
    display: none;
}

.fp-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: #222;
    border: 1.5px solid #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 10;
    transition: box-shadow 0.15s, opacity 0.2s;
}

.fp-scroll-arrow:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.fp-scroll-left  { left:  -22px; top: 75px; transform: none; }
.fp-scroll-right { right: -22px; top: 75px; transform: none; }

.fp-scroll-arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

/* ── ZOO CARD ─────────────────────────────────────── */

.fp-zoo-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fp-zoo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}

.fp-zoo-card-img {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.fp-zoo-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.fp-zoo-card:hover .fp-zoo-card-img img {
    transform: scale(1.05);
}

.fp-zoo-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fp-zoo-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fp-zoo-card-loc {
    font-size: 0.78rem;
    color: #6b7a8d;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-zoo-card-rating {
    font-size: 0.82rem;
    color: #555;
    margin: 0;
    font-weight: 600;
}

.fp-zoo-card-reviews {
    color: #888;
    font-weight: 400;
}

.fp-empty {
    color: #999;
    font-size: 0.9rem;
    padding: 20px 0;
}

/* Mobile-only title shown above active chip — hidden on desktop */
.fp-animal-mobile-title { display: none; }

/* Hide mobile-only close button on desktop */
#fpPillClose { display: none; }

/* ── FIND ZOOS BY ANIMAL ──────────────────────────── */

.fp-animal-section {
    background: #ffffff;
    padding: 28px 28px;
    min-height: auto;
    box-sizing: border-box;
    transition: min-height 0.3s ease;
    margin: 40px auto;
    max-width: 1400px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fp-animal-section.fp-no-results {
    min-height: auto;
}

.fp-animal-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.fp-animal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.fp-animal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: #111;
}

/* Country filter */
.fp-country-filter {
    position: relative;
    flex-shrink: 0;
}

.fp-country-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 50px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: border-color 0.15s;
}

.fp-country-btn:hover,
.fp-country-btn.fp-hovered,
.fp-country-btn.fp-open {
    border-color: #1a7a3c;
    color: #1a7a3c;
}

.fp-country-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.fp-country-btn.fp-open .fp-country-chevron {
    transform: rotate(180deg);
}

.fp-country-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 220px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14);
    z-index: 300;
    overflow: hidden;
}

.fp-country-dropdown.fp-open {
    display: block;
}

.fp-country-detect {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a7a3c;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.fp-country-detect:hover {
    background: #f5f5f5;
}

.fp-country-list {
    max-height: 240px;
    overflow-y: auto;
}

.fp-country-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 16px;
    font-size: 0.88rem;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.1s;
}

.fp-country-item:hover {
    background: #f5f5f5;
}

.fp-country-item.active {
    font-weight: 700;
    color: #1a7a3c;
    background: #f0faf3;
}

/* Per-section row country filter wrapper */
.fp-row-filter {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

/* Animal search field */
.fp-animal-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 50px;
    border: 1px solid #ddd;
    background: #fff;
    width: 220px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.fp-animal-search-icon {
    color: #999;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.fp-animal-search-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.88rem;
    background: transparent;
    color: #333;
    min-width: 0;
}

.fp-animal-search-wrap input::placeholder {
    color: #aaa;
}

.fp-animal-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14);
    z-index: 200;
    display: none;
    overflow: hidden;
}

.fp-animal-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: #222;
    transition: background 0.1s;
}

.fp-animal-dropdown-item:hover {
    background: #f5f5f5;
}

.fp-animal-dropdown-item img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Animal body wrapper */
.fp-animal-body {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* Animal chips */
.fp-animal-chips {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px 16px;
    flex: 1 1 100%;
    min-width: 0;
    transition: flex-basis 0.35s ease, max-width 0.35s ease;
}

.fp-animal-body.fp-has-active .fp-animal-chips {
    flex: 0 0 140px;
    max-width: 140px;
    grid-template-columns: 1fr;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .fp-animal-chips { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
    .fp-animal-chips { grid-template-columns: repeat(3, 1fr); }
}

.fp-animal-chip.fp-chip-hiding {
    opacity: 0;
    transform: scale(0.75);
    pointer-events: none;
}

.fp-animal-chip.fp-chip-gone {
    display: none;
}

.fp-animal-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.22s ease, transform 0.22s ease;
    gap: 10px;
    padding: 8px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s;
}

.fp-animal-chip-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid transparent;
    background: #1a1a1a;
    transition: border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.fp-animal-chip-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.fp-animal-chip span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
    max-width: 110px;
    display: block;
}

.fp-animal-chip:hover .fp-animal-chip-img {
    border-color: #1a7a3c;
}

.fp-animal-chip:hover span {
    color: #1a7a3c;
}

.fp-animal-chip.active .fp-animal-chip-img {
    border-color: #1a7a3c;
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(26,122,60,0.22);
}

.fp-animal-chip.active span {
    color: #1a7a3c;
    font-weight: 700;
}

/* Zoo loading dots */
.fp-zoo-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 40px 20px;
}

.fp-zoo-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    animation: fp-dot-pulse 1.2s ease-in-out infinite;
}

.fp-zoo-loading span:nth-child(2) { animation-delay: 0.2s; }
.fp-zoo-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes fp-dot-pulse {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1; }
}

/* Zoo results next to active chip */
.fp-animal-zoos {
    flex: 0 0 0;
    min-width: 0;
    max-width: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: flex-basis 0.35s ease, max-width 0.35s ease, opacity 0.25s ease, max-height 0.35s ease;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
  
}

.fp-animal-zoos.fp-visible {
    flex: 1 1 auto;
    max-width: 100%;
    max-height: 500px;
    opacity: 1;
    overflow: visible;
}

.fp-animal-zoos-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 16px;
}

.fp-animal-zoos-title a,
.fp-animal-mobile-title a {
    color: #111;
    text-decoration: none !important;
}

.fp-animal-zoos-title a:hover,
.fp-animal-mobile-title a:hover {
    color: #1a7a3c;
    text-decoration: none !important;
}

.fp-animal-zoos-title a:hover {
    text-decoration: underline !important;
}

/* ── FLYING SEARCH FLOATER ────────────────────────── */

.fp-search-floater {
    position: fixed;
    display: none;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 50px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    z-index: 1001;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: auto;
}

.fp-floater-text {
    color: #aaa;
    font-size: 1rem;
    overflow: hidden;
}

/* ── MOBILE (≤768px) ──────────────────────────────── */

@media (max-width: 768px) {

    /* Hero */
    .fp-hero-outer {
        padding: 16px 12px 0;
    }

    .fp-hero-wrap {
        height: 260px;
        border-radius: 14px;
    }

    .fp-hero-text {
        top: 20px;
        right: 0;
        left: 0;
        padding: 0 16px;
        text-align: center;
    }

    .fp-hero-text h1 {
        font-size: 1.75rem;
    }

    /* Search section */
    .fp-search-section {
        margin-top: -80px;
        padding: 0 12px 28px;
    }

    .fp-search-outer {
        padding: 12px;
    }

    /* Animal section */
    .fp-animal-section {
        padding: 20px 16px;
        margin: 20px 0;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .fp-animal-inner {
        padding: 0;
    }

    .fp-animal-header {
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 10px;
        margin-bottom: 16px;
    }

    .fp-animal-title {
        text-align: center;
        flex-basis: 100%;
        margin-bottom: 8px;
        order: -1;
    }

    .fp-animal-search-wrap {
        flex: 1;
        min-width: 160px;
    }

    .fp-country-filter {
        flex: 0 0 auto;
    }

    /* Animal body: stack vertically, stretch so chips fill full width */
    .fp-animal-body {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    /* Chips: single-row horizontal scroll */
    .fp-animal-body .fp-animal-chips {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        margin-bottom: 20px;
    }

    .fp-animal-body .fp-animal-chip {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    /* Match single-zoo gallery-item mobile size */
    .fp-animal-chip-img {
        width: 64px;
        height: 64px;
    }

    .fp-animal-chip span {
        font-size: 0.72rem;
        max-width: 80px;
    }

    /* Mobile title above chip+zoos row — hidden by default, shown when not empty */
    .fp-animal-mobile-title {
        display: none;
        font-size: 1rem;
        font-weight: 700;
        color: #111;
        line-height: 1.3;
        margin: 0 0 14px;
    }
    .fp-animal-mobile-title:not(:empty) {
        display: block;
    }
    /* Desktop: always hidden */
    .fp-animal-mobile-title a {
        color: #111;
        text-decoration: none;
    }
    .fp-animal-mobile-title a:hover {
        text-decoration: underline;
    }

    /* Active state: chip left, zoos right, side-by-side */
    .fp-animal-body.fp-has-active {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    /* Active chip column: natural width, no scroll */
    .fp-animal-body.fp-has-active .fp-animal-chips {
        overflow-x: visible;
        flex: 0 0 auto;
        margin-bottom: 0;
        scroll-snap-type: none;
    }

    /* Zoo list fills remaining space beside the chip */
    .fp-animal-body.fp-has-active .fp-animal-zoos.fp-visible {
        flex: 1;
        min-width: 0;
        max-width: 100%;
        width: auto;
    }

    /* Zoo list inside animal section: touch scroll, no arrows */
    .fp-animal-zoos .fp-scroll-track {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .fp-animal-zoos .fp-scroll-arrow {
        display: none;
    }

    /* Narrower cards so next card peeks into view */
    .fp-animal-zoos .fp-zoo-card {
        flex: 0 0 160px;
    }
    .fp-animal-zoos .fp-zoo-card-img {
        height: 110px;
    }

    /* Hide the original h3 title inside fp-animal-zoos on mobile (shown above instead) */
    .fp-animal-zoos .fp-animal-zoos-title {
        display: none;
    }

    /* Zoo row sections */
    .fp-zoo-row {
        padding: 24px 0 28px;
    }

    /* Reduce zoo row header title size on mobile */
    .fp-zoo-row .fp-row-header h2 {
        font-size: 1.05rem;
    }

    /* Enable native touch-scroll on mobile for zoo rows, hide their arrow buttons */
    .fp-zoo-row .fp-scroll-track {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fp-zoo-row .fp-scroll-arrow {
        display: none;
    }
}
