/* ── Section ── */
.cat-section {
    background: #f9f9f9;
}

@media (min-width: 1400px) {
    .cat-section > .container { max-width: 1500px; }
}

/* ── Header ── */
.cat-section__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.cat-section__title {
    min-width: 0;
    font-size: clamp(1.05rem, 0.9rem + 1.1vw, 1.6rem);
    font-weight: 800;
    line-height: 1.4;
    color: #1a1a1a;
    display: inline-block;
    padding-bottom: 7px;
    border-bottom: 3px solid var(--primary-color, #224229);
    margin-bottom: 0;
}

.cat-all-btn {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: .88rem;
    font-weight: 600;
    color: var(--primary-color, #224229);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    transition: border-color .25s ease;
}

.cat-all-btn:hover {
    color: var(--primary-color, #224229);
    text-decoration: none;
    border-color: var(--primary-color, #224229);
}

/* ── Swiper wrapper ── */
.cat-swiper-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-swiper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.cat-swiper .swiper-slide {
    height: auto;
}

.cat-section .swiper-wrapper.py-3 {
    padding-top: 6px !important;
    padding-bottom: 10px !important;
}

/* ── Nav arrows ── */
.cat-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color, #224229);
    background: #fff;
    color: var(--primary-color, #224229);
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, color .2s, opacity .2s;
}

.cat-nav:hover {
    background: var(--primary-color, #224229);
    color: #fff;
}

.cat-nav.swiper-button-disabled {
    opacity: .35;
    cursor: default;
}

.cat-nav.swiper-button-lock {
    display: none;
}

.cat-nav:focus-visible {
    outline: 3px solid var(--primary-color, #224229);
    outline-offset: 2px;
}

/* ── Card: the photo fills the card ── */
.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 10px 10px 14px;
    background: #fff;
    border-radius: 22px;
    border: 1px solid rgba(0, 0, 0, .07);
    box-shadow: 0 4px 18px rgba(16, 24, 16, .06);
    transition: box-shadow .3s, transform .3s, border-color .3s;
    text-decoration: none !important;
}

.cat-card:hover {
    box-shadow: 0 14px 34px rgba(16, 24, 16, .14);
    transform: translateY(-5px);
    border-color: var(--primary-color, #224229);
}

.cat-card:focus-visible {
    outline: 3px solid var(--primary-color, #224229);
    outline-offset: 3px;
}

.cat-card__img-wrap {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 16px;
    background: #f1f4f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.cat-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.cat-card:hover .cat-card__img {
    transform: scale(1.06);
}

.cat-card__placeholder {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary-color, #224229);
    opacity: .55;
}

/* ── Name ── */
.cat-card__name {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #1a1a1a;
    text-align: center;
    margin: 0;
    line-height: 1.3;
    overflow-wrap: anywhere;
    transition: color .2s;
}

.cat-card:hover .cat-card__name {
    color: var(--primary-color, #224229);
}

/* ── RTL nav arrows ── */
[dir="rtl"] .cat-nav--prev i,
[dir="rtl"] .cat-nav--next i { transform: rotate(180deg); }

/* ── Small screens ── */
@media (max-width: 575.98px) {
    .cat-section__title {
        font-size: 1.02rem;
        padding-bottom: 5px;
    }

    .cat-all-btn {
        font-size: .75rem;
        padding-bottom: 5px;
    }

    .cat-swiper-wrap {
        gap: 6px;
    }

    .cat-nav {
        display: none !important;
    }

    .cat-card {
        padding: 8px 8px 10px;
        gap: 8px;
        border-radius: 14px;
    }

    .cat-card__img-wrap {
        border-radius: 10px;
        aspect-ratio: 1 / 1;
    }

    .cat-card__name {
        font-size: .8rem;
        line-height: 1.25;
    }
}

@media (max-width: 399.98px) {
    .cat-card {
        padding: 6px 6px 8px;
    }

    .cat-card__name {
        font-size: .74rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cat-card,
    .cat-card__img { transition: none; }
    .cat-card:hover { transform: none; }
    .cat-card:hover .cat-card__img { transform: none; }
}
