.potebasen-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.potebasen-cat-card {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.potebasen-cat-image-wrap {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f5f5;
}

.potebasen-cat-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.potebasen-cat-image-link {
    display: block;
    height: 100%;
}

.potebasen-cat-content {
    padding: 16px;
}

.potebasen-cat-name {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.potebasen-cat-name-link {
    color: inherit;
    text-decoration: none;
}

.potebasen-cat-name-link:hover,
.potebasen-cat-name-link:focus {
    text-decoration: underline;
}

.potebasen-cat-status {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.8;
}

.potebasen-cat-description {
    margin: 0;
}

.potebasen-cat-detail {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px;
}

.potebasen-cat-detail *,
.potebasen-cat-detail *::before,
.potebasen-cat-detail *::after {
    box-sizing: border-box;
}

.potebasen-cat-detail__top {
    display: grid;
    grid-template-columns: minmax(390px, 1fr) minmax(420px, 1.05fr);
    gap: 64px;
    align-items: start;
}

.potebasen-cat-detail__top--no-media {
    grid-template-columns: minmax(0, 1fr);
}

.potebasen-cat-detail__info {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    column-gap: 54px;
    row-gap: 42px;
    min-width: 0;
}

.potebasen-cat-detail__media {
    min-width: 0;
}

.potebasen-cat-detail__main-image {
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
}

.potebasen-cat-detail__main-image-img {
    width: 100%;
    max-height: 430px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.potebasen-cat-detail__gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 14px;
    min-width: 0;
}

.potebasen-cat-detail__gallery-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    background: #f5f5f5;
}

.potebasen-cat-detail__section {
    min-width: 0;
}

.potebasen-cat-detail__section h2,
.potebasen-cat-detail__description h2 {
    margin: 0 0 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #b56545;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 500;
}

.potebasen-cat-detail__facts {
    display: grid;
    gap: 8px;
    margin: 0;
}

.potebasen-cat-detail__fact {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    line-height: 1.6;
    min-width: 0;
}

.potebasen-cat-detail__fact dt {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 700;
    opacity: 0.75;
}

.potebasen-cat-detail__fact dd {
    margin: 0;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.potebasen-cat-detail__check-list {
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.potebasen-cat-detail__check-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.potebasen-cat-detail__check-list li::before {
    content: "\2713";
    color: #b56545;
    font-weight: 700;
}

.potebasen-cat-detail__description {
    min-width: 0;
    margin-top: 56px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    padding: 28px;
    background: #fffdfb;
}

.potebasen-cat-detail__text-block {
    min-width: 0;
}

.potebasen-cat-detail__text-block + .potebasen-cat-detail__text-block {
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid #ededed;
}

.potebasen-cat-detail__text-block h3 {
    margin: 14px 0 8px;
    font-size: 1rem;
    line-height: 1.3;
}

.potebasen-cat-detail__text-block:first-of-type h3 {
    margin-top: 12px;
}

.potebasen-cat-detail__text-block p {
    margin: 0 0 10px;
}

.potebasen-cat-detail__text-block p:last-child {
    margin-bottom: 0;
}

.potebasen-error,
.potebasen-empty {
    padding: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fafafa;
}

.potebasen-foster-application,
.potebasen-volunteer-application {
    max-width: 760px;
}

.potebasen-foster-application-form,
.potebasen-volunteer-application-form {
    margin: 0;
}

.potebasen-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.potebasen-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.potebasen-form-field--full {
    grid-column: 1 / -1;
}

.potebasen-form-field label {
    font-weight: 600;
}

.potebasen-form-field input[type="text"],
.potebasen-form-field input[type="email"],
.potebasen-form-field input[type="tel"],
.potebasen-form-field select,
.potebasen-form-field textarea {
    width: 100%;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
    color: inherit;
    font: inherit;
}

.potebasen-form-field textarea {
    resize: vertical;
}

.potebasen-form-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
}

.potebasen-form-field--checkbox input {
    margin-top: 0.25em;
}

.potebasen-form-fieldset {
    margin: 0;
    border: 0;
    padding: 0;
}

.potebasen-form-fieldset legend {
    margin-bottom: 6px;
    font-weight: 600;
}

.potebasen-checkbox-group {
    display: grid;
    gap: 8px;
}

.potebasen-checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
}

.potebasen-checkbox-group input {
    margin-top: 0.25em;
}

.potebasen-required,
.potebasen-form-error {
    color: #b42318;
}

.potebasen-form-error {
    font-size: 0.9rem;
}

.potebasen-form-alert,
.potebasen-success {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 8px;
}

.potebasen-form-alert {
    border: 1px solid #f3b8b2;
    background: #fff4f2;
    color: #8a1f14;
}

.potebasen-success {
    border: 1px solid #b7dfc2;
    background: #f1fbf4;
    color: #146c2e;
}

.potebasen-submit-button {
    margin-top: 20px;
    border: 0;
    border-radius: 6px;
    padding: 12px 18px;
    background: #2f6f4e;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.potebasen-submit-button:hover,
.potebasen-submit-button:focus {
    background: #255a40;
}

@media (max-width: 900px) {
    .potebasen-cat-detail {
        padding: 24px 16px;
    }

    .potebasen-cat-detail__top {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .potebasen-cat-detail__media {
        order: 1;
    }

    .potebasen-cat-detail__info {
        order: 2;
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .potebasen-cat-detail__description {
        margin-top: 34px;
        padding: 20px;
    }

    .potebasen-cat-detail__fact {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .potebasen-cat-detail__gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .potebasen-form-grid {
        grid-template-columns: 1fr;
    }
}
