/**
 * Qing Category Slider widget (Swiper based).
 * Slide widths / gaps are handled by Swiper; this file styles the cards,
 * arrows and pagination only.
 */

.qing-cats {
    --qing-img-h: 200px;
    --qing-img-fit: cover;
    --qing-img-pos: center center;
    --qing-img-radius: 8px;
    --qing-arrow-offset: 8px;
    position: relative;
    margin: 0 0 40px;
}

.qing-cats *,
.qing-cats *::before,
.qing-cats *::after {
    box-sizing: border-box;
}

/* ---------- Heading ---------- */
.qing-cats__title {
    margin: 0 0 16px;
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
    color: #222;
}

/* ---------- Wrapper (positioning context for arrows) ---------- */
.qing-cats__wrap {
    position: relative;
}

/* Swiper needs a clipped container; keep arrows outside of it. */
.qing-cats__swiper {
    overflow: hidden;
    width: 100%;
}

/* ---------- Card ---------- */
.qing-cats__slide {
    height: auto; /* let cards size naturally */
}

.qing-cats__item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.qing-cats__image {
    position: relative;
    width: 100%;
    height: var(--qing-img-h, 200px);
    overflow: hidden;
    border-radius: var(--qing-img-radius, 8px);
    background: #f2ede7;
}

.qing-cats__img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: var(--qing-img-fit, cover);
    object-position: var(--qing-img-pos, center center);
    border-radius: var(--qing-img-radius, 8px);
    transition: transform 0.4s ease;
}

.qing-cats--zoom .qing-cats__item:hover .qing-cats__img {
    transform: scale(1.06);
}

.qing-cats__name {
    display: block;
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: #222;
    transition: color 0.15s ease;
}

.qing-cats__count {
    display: block;
    margin-top: 3px;
    font-size: 0.875rem;
    line-height: 1.35;
    color: #6c6c6c;
}

/* ---------- Arrows ---------- */
.qing-cats__arrow {
    position: absolute;
    top: calc(var(--qing-img-h, 200px) / 2);
    transform: translateY(-50%);
    z-index: 10;
    /* Flex + line-height:0 keeps the SVG optically centred (no baseline gap). */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    line-height: 0;
    font-size: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.qing-cats--arrow-shadow .qing-cats__arrow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.qing-cats__arrow--prev {
    left: var(--qing-arrow-offset, 8px);
}

.qing-cats__arrow--next {
    right: var(--qing-arrow-offset, 8px);
}

.qing-cats__arrow svg {
    display: block;
    width: 16px;
    height: 16px;
    stroke: #222;
    pointer-events: none;
    /* The chevron glyph is visually off-centre inside its 24x24 viewBox;
       nudge each direction back to the optical centre. */
    position: relative;
}

.qing-cats__arrow--prev svg {
    left: -1px;
}

.qing-cats__arrow--next svg {
    left: 1px;
}

.qing-cats__arrow:hover {
    background-color: #fff;
    transform: translateY(-50%) scale(1.08);
}

.qing-cats__arrow:focus-visible {
    outline: 2px solid #775a97;
    outline-offset: 2px;
}

/* At the first / last slide the arrow stays visible but dimmed (default). */
.qing-cats__arrow.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.qing-cats__arrow.is-disabled:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%);
}

/* Optional: fully hide instead of dimming. */
.qing-cats__arrow.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ---------- Pagination ---------- */
.qing-cats__pagination {
    position: static;
    margin-top: 14px;
    text-align: center;
}

.qing-cats__pagination .swiper-pagination-bullet {
    background-color: #d8d8d8;
    opacity: 1;
}

.qing-cats__pagination .swiper-pagination-bullet-active {
    background-color: #775a97;
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .qing-cats__title {
        font-size: 1.25rem;
    }

    /* Arrows hidden on phones unless explicitly enabled (swipe instead). */
    .qing-cats:not(.qing-cats--arrows-mobile) .qing-cats__arrow {
        display: none;
    }
}
