body {
    margin: 0;
    font-family: Arial, sans-serif;
}

fieldset {
    border: none;
    display: flex;
    flex-wrap: wrap;
}

.filter {
    padding: 10px 10px 0px 0;
    min-width: 200px;
    max-width: 200px;
}

.animals-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

.animal-card {
    width: 100%;
    cursor: pointer;
}

.animal-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    container-type: size;
}

.animal-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.animal-card__image:hover .animal-card__photo {
    transform: scale(1.05);
}

.animal-card__overlay {
    position: absolute;
    height: auto;
    z-index: 1;
    pointer-events: none;
}

.animal-card__foster-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    width: 82cqw;
    height: 42cqh;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 36% 100%, 0 100%);
    z-index: 2;
    pointer-events: none;
}

.animal-card__overlay--foster {
    top: 30cqh;
    left: -24cqw;
    width: 88cqw;
    max-width: none;
    transform: rotate(-32deg);
    transform-origin: top left;
}

.animal-card__overlay--fospice {
    width: min(58%, 200px);
    top: 8px;
    left: 0;
}

.animal-card__overlay--adoption-fee {
    width: min(38%, 130px);
    bottom: 16px;
    right: 16px;
}

.animal-card h3 {
    margin: 8px 0 0 0;
    font-size: 16px;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background: #f0f0f0;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Tablet (3 columns) */
@media (max-width: 1024px) {
    .animals-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 15px;
    }

    .animal-card h3 {
        font-size: 15px;
    }
}

/* Small tablet / large phone (2 columns) */
@media (max-width: 768px) {
    .animals-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .animal-card h3 {
        font-size: 14px;
    }

    .pagination button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .page-info {
        font-size: 13px;
        width: 100%;
        margin-top: 8px;
    }
}

/* Mobile (1 column) */
@media (max-width: 480px) {
    .animals-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
        max-height: none;
    }

    .animal-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .animal-card h3 {
        font-size: 16px;
    }

    .pagination {
        padding: 15px 10px;
    }

    .pagination button {
        padding: 10px 16px;
    }
}

.search-box {
    /* Match SlimSelect's default styling */
    border: 1px solid #dcdee2;
    border-radius: 4px;
    padding: 9px 40px 9px 12px;
    /* SlimSelect has more right padding for the arrow */
    font-size: 16px;
    line-height: 1.4;
    height: 38px;
    /* Explicit height to match SlimSelect */
    background-color: #ffffff;
    color: #8d8d8d;
    font-family: inherit;
    box-sizing: border-box;
    min-width: 200px;
    max-width: 200px;

    /* Smooth transitions */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus {
    outline: none;
    box-shadow: 0 0 5px #5897fb;
}

.search-box:hover:not(:focus):not(:disabled) {
    border-color: #b8bbc1;
}

.search-box:disabled {
    background-color: #f8f8f8;
    color: #a0a4a8;
    cursor: not-allowed;
}

.search-box::placeholder {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 5px 7px 5px 7px;
    margin: auto 0px auto 0px;
    line-height: 1em;
    color: #8d8d8d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-single {
    color: #8d8d8d;
}

.loading-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading {
    font-size: 10px;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    text-indent: -9999em;
    animation: mulShdSpin 1.1s infinite ease;
    transform: translateZ(0);
}

.animal-detail {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    font-family: Roboto, Arial, sans-serif;
    color: #333;
}

.animal-detail__back {
    display: inline-block;
    margin-bottom: 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.animal-detail__back:hover {
    text-decoration: underline;
}

.animal-detail__gallery {
    margin-bottom: 28px;
}

.animal-detail__gallery-main {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.animal-detail__photo-slot {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.animal-detail__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.animal-detail__photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
}

.animal-detail__thumbnails {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.animal-detail__thumbnail {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    background: none;
}

.animal-detail__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.animal-detail__thumbnail--active {
    border-color: #666;
}

.animal-detail__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 32px;
    align-items: start;
    margin-bottom: 28px;
}

.animal-detail__name {
    margin: 0 0 18px 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.animal-detail__facts {
    margin: 0;
}

.animal-detail__fact {
    margin: 0 0 14px 0;
}

.animal-detail__fact:last-child {
    margin-bottom: 0;
}

.animal-detail__fact dt {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.animal-detail__fact dd {
    margin: 0;
    font-size: 15px;
    color: #333;
}

.animal-detail__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.animal-detail__cta {
    display: block;
    padding: 14px 18px;
    border-radius: 2px;
    text-align: center;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    box-sizing: border-box;
}

.animal-detail__cta--adopt {
    background: #8d8d8d;
    color: #fff;
}

.animal-detail__cta--adopt:hover {
    background: #777;
}

.animal-detail__cta--donate {
    background: #8dc641;
    color: #fff;
}

.animal-detail__cta--donate:hover {
    background: #7cb535;
}

.animal-detail__cta--sponsor {
    background: #5b9bd5;
    color: #fff;
}

.animal-detail__cta--sponsor:hover {
    background: #4a8ac4;
}

.animal-detail__social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-top: 10px;
    padding-top: 4px;
}

.animal-detail__social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.animal-detail__social-button:hover {
    transform: scale(1.08);
    opacity: 0.9;
}

.animal-detail__social-button svg {
    width: 28px;
    height: 28px;
    display: block;
}

.animal-detail__social-button--copied {
    transform: scale(1.02);
}

.animal-detail__attributes {
    margin-bottom: 28px;
}

.animal-detail__section-title {
    margin: 0 0 14px 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.animal-detail__attribute-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.animal-detail__attribute-list li {
    position: relative;
    padding: 7px 14px 7px 18px;
    background: #e3e3e3;
    font-size: 13px;
    line-height: 1.3;
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}

.animal-detail__description {
    margin-top: 8px;
}

.animal-detail__description-body {
    line-height: 1.65;
    color: #333;
    font-size: 15px;
    white-space: pre-wrap;
}

.animal-detail__description-body p {
    margin: 0 0 1em 0;
}

.animal-detail__description-empty {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.animal-detail__error {
    color: #666;
    font-size: 16px;
}

@media (max-width: 768px) {
    .animal-detail {
        padding: 16px 16px 32px;
    }

    .animal-detail__gallery-main {
        grid-template-columns: 1fr;
    }

    .animal-detail__thumbnails {
        justify-content: flex-start;
    }

    .animal-detail__header {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .animal-detail__name {
        font-size: 24px;
    }

    .animal-detail__actions {
        width: 100%;
    }
}

@keyframes mulShdSpin {

    0%,
    100% {
        box-shadow: 0em -2.6em 0em 0em #333, 1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2), 2.5em 0em 0 0em rgba(51, 51, 51, 0.2), 1.75em 1.75em 0 0em rgba(51, 51, 51, 0.2), 0em 2.5em 0 0em rgba(51, 51, 51, 0.2), -1.8em 1.8em 0 0em rgba(51, 51, 51, 0.2), -2.6em 0em 0 0em rgba(51, 51, 51, 0.5), -1.8em -1.8em 0 0em rgba(51, 51, 51, 0.7);
    }

    12.5% {
        box-shadow: 0em -2.6em 0em 0em rgba(51, 51, 51, 0.7), 1.8em -1.8em 0 0em #333, 2.5em 0em 0 0em rgba(51, 51, 51, 0.2), 1.75em 1.75em 0 0em rgba(51, 51, 51, 0.2), 0em 2.5em 0 0em rgba(51, 51, 51, 0.2), -1.8em 1.8em 0 0em rgba(51, 51, 51, 0.2), -2.6em 0em 0 0em rgba(51, 51, 51, 0.2), -1.8em -1.8em 0 0em rgba(51, 51, 51, 0.5);
    }

    25% {
        box-shadow: 0em -2.6em 0em 0em rgba(51, 51, 51, 0.5), 1.8em -1.8em 0 0em rgba(51, 51, 51, 0.7), 2.5em 0em 0 0em #333, 1.75em 1.75em 0 0em rgba(51, 51, 51, 0.2), 0em 2.5em 0 0em rgba(51, 51, 51, 0.2), -1.8em 1.8em 0 0em rgba(51, 51, 51, 0.2), -2.6em 0em 0 0em rgba(51, 51, 51, 0.2), -1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2);
    }

    37.5% {
        box-shadow: 0em -2.6em 0em 0em rgba(51, 51, 51, 0.2), 1.8em -1.8em 0 0em rgba(51, 51, 51, 0.5), 2.5em 0em 0 0em rgba(51, 51, 51, 0.7), 1.75em 1.75em 0 0em #333, 0em 2.5em 0 0em rgba(51, 51, 51, 0.2), -1.8em 1.8em 0 0em rgba(51, 51, 51, 0.2), -2.6em 0em 0 0em rgba(51, 51, 51, 0.2), -1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2);
    }

    50% {
        box-shadow: 0em -2.6em 0em 0em rgba(51, 51, 51, 0.2), 1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2), 2.5em 0em 0 0em rgba(51, 51, 51, 0.5), 1.75em 1.75em 0 0em rgba(51, 51, 51, 0.7), 0em 2.5em 0 0em #333, -1.8em 1.8em 0 0em rgba(51, 51, 51, 0.2), -2.6em 0em 0 0em rgba(51, 51, 51, 0.2), -1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2);
    }

    62.5% {
        box-shadow: 0em -2.6em 0em 0em rgba(51, 51, 51, 0.2), 1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2), 2.5em 0em 0 0em rgba(51, 51, 51, 0.2), 1.75em 1.75em 0 0em rgba(51, 51, 51, 0.5), 0em 2.5em 0 0em rgba(51, 51, 51, 0.7), -1.8em 1.8em 0 0em #333, -2.6em 0em 0 0em rgba(51, 51, 51, 0.2), -1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2);
    }

    75% {
        box-shadow: 0em -2.6em 0em 0em rgba(51, 51, 51, 0.2), 1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2), 2.5em 0em 0 0em rgba(51, 51, 51, 0.2), 1.75em 1.75em 0 0em rgba(51, 51, 51, 0.2), 0em 2.5em 0 0em rgba(51, 51, 51, 0.5), -1.8em 1.8em 0 0em rgba(51, 51, 51, 0.7), -2.6em 0em 0 0em #333, -1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2);
    }

    87.5% {
        box-shadow: 0em -2.6em 0em 0em rgba(51, 51, 51, 0.2), 1.8em -1.8em 0 0em rgba(51, 51, 51, 0.2), 2.5em 0em 0 0em rgba(51, 51, 51, 0.2), 1.75em 1.75em 0 0em rgba(51, 51, 51, 0.2), 0em 2.5em 0 0em rgba(51, 51, 51, 0.2), -1.8em 1.8em 0 0em rgba(51, 51, 51, 0.5), -2.6em 0em 0 0em rgba(51, 51, 51, 0.7), -1.8em -1.8em 0 0em #333;
    }
}