﻿/* =========================================================
   CATEGORY PAGE – modern, compact, responsive (prefix: ct-)
   Search + A-Z (first letter) filter + sort + Load More (30)
   Tokens: --fn-* (layout.css) fallback ke saath
   ========================================================= */
.ct {
    --p: var(--fn-primary, #4f46e5);
    --p2: #7c3aed;
    --acc: var(--fn-accent, #f97316);
    --ink: var(--fn-ink, #0f172a);
    --mut: var(--fn-muted, #64748b);
    --line: var(--fn-line, #e2e8f0);
    --bg: var(--fn-bg, #f8fafc);
    background: var(--bg);
    color: var(--ink);
    min-height: 60vh;
    overflow-x: hidden;
}

    .ct *, .ct *::before, .ct *::after {
        box-sizing: border-box;
    }

    .ct [hidden] {
        display: none !important;
    }

    .ct a {
        text-decoration: none;
        color: inherit;
    }

    .ct h1, .ct h2, .ct h3, .ct p {
        margin: 0;
    }

    .ct button {
        font-family: inherit;
    }

    .ct img {
        max-width: 100%;
        display: block;
    }

.ct-wrap {
    width: 100%;
    max-width: 1400px;
    margin-inline: auto;
    padding-inline: clamp(8px, 2vw, 20px);
}

/* ---------- hero ---------- */
.ct-top {
    position: relative;
    isolation: isolate;
    color: #fff;
    padding-block: clamp(16px, 3.4vw, 32px);
    background: linear-gradient(120deg, #312e81, var(--p) 45%, var(--p2) 75%, var(--acc));
    overflow: hidden;
}

    .ct-top::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -2;
        background-image: var(--ct-bg);
        background-size: cover;
        background-position: center;
        opacity: .18;
        mix-blend-mode: overlay;
    }

    .ct-top::after {
        content: "";
        position: absolute;
        right: -60px;
        top: -80px;
        width: 280px;
        height: 280px;
        z-index: -1;
        border-radius: 50%;
        background: rgba(255, 255, 255, .12);
        filter: blur(2px);
    }

.ct-crumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: .78rem;
    color: rgba(255, 255, 255, .8);
}

    .ct-crumb a:hover {
        color: #fff;
    }

    .ct-crumb i {
        font-size: .62rem;
    }

    .ct-crumb span {
        color: #fff;
        font-weight: 700;
    }

.ct-hrow {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.ct-title {
    font-size: clamp(1.4rem, 3.6vw, 2.3rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.02em;
    color: #fff;
}

    .ct-title span {
        color: #fde68a;
    }

.ct-sub {
    margin-top: 4px;
    font-size: clamp(.82rem, 1.4vw, .95rem);
    color: rgba(255, 255, 255, .85);
}

.ct-total {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    font-size: .82rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

    .ct-total b {
        font-size: 1.05rem;
    }

/* ---------- body / panel ---------- */
.ct-body {
    padding-block: clamp(10px, 2vw, 18px) clamp(18px, 3vw, 32px);
}

.ct-panel {
    margin-top: calc(-1 * clamp(18px, 3vw, 30px));
    position: relative;
    z-index: 1;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: clamp(10px, 2vw, 16px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

/* toolbar */
.ct-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ct-search {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 12px;
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

    .ct-search:focus-within {
        background: #fff;
        border-color: var(--p);
        box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
    }

    .ct-search i {
        color: var(--mut);
        font-size: .9rem;
    }

    .ct-search input {
        flex: 1;
        min-width: 0;
        padding: 11px 0;
        border: 0;
        outline: 0;
        background: transparent;
        font: inherit;
        font-size: 16px;
        color: var(--ink);
    }

        .ct-search input::-webkit-search-cancel-button {
            cursor: pointer;
        }

.ct-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.ct-count {
    font-size: .82rem;
    color: var(--mut);
    white-space: nowrap;
}

    .ct-count b {
        color: var(--ink);
    }

.ct-select {
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: .86rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}

    .ct-select:focus {
        outline: 0;
        border-color: var(--p);
        box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
    }

/* A-Z chips */
.ct-az {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding: 2px 2px 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

    .ct-az:empty {
        display: none;
    }

    .ct-az button {
        flex: none;
        min-width: 34px;
        height: 34px;
        padding: 0 11px;
        border: 1.5px solid var(--line);
        border-radius: 10px;
        background: #fff;
        color: var(--ink);
        font-size: .82rem;
        font-weight: 700;
        cursor: pointer;
        transition: all .15s;
    }

        .ct-az button:hover:not(:disabled) {
            border-color: var(--p);
            color: var(--p);
            background: #eef2ff;
        }

        .ct-az button.is-active {
            background: linear-gradient(135deg, var(--p), var(--p2));
            border-color: transparent;
            color: #fff;
            box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
        }

        .ct-az button:disabled {
            opacity: .35;
            cursor: default;
        }

        .ct-az button:focus-visible {
            outline: 2px solid var(--p);
            outline-offset: 2px;
        }

/* grid + cards (page specific) */
.ct-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: clamp(8px, 1.4vw, 12px);
    margin-top: 12px;
}

.ct-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    animation: ctin .3s ease both;
    animation-delay: calc(var(--i, 0) * 25ms);
    transition: transform .18s, box-shadow .2s, border-color .2s;
}

    .ct-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 14px;
        bottom: 14px;
        width: 3px;
        border-radius: 0 3px 3px 0;
        background: linear-gradient(var(--p), var(--p2));
        opacity: 0;
        transition: opacity .2s;
    }

    .ct-card:hover {
        transform: translateY(-2px);
        border-color: var(--p);
        box-shadow: 0 10px 24px rgba(79, 70, 229, .14);
    }

        .ct-card:hover::before {
            opacity: 1;
        }

    .ct-card:focus-visible {
        outline: 2px solid var(--p);
        outline-offset: 2px;
    }

.ct-ico {
    width: 56px;
    height: 56px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    overflow: hidden;
}

    .ct-ico img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.ct-ph {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--p);
    font-size: 1.4rem;
    font-weight: 800;
}

.ct-info {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 1px;
}

.ct-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ct-items {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    margin-top: 2px;
    padding: 2px 9px;
    border-radius: 99px;
    background: #fff7ed;
    color: #c2410c;
    font-size: .72rem;
    font-weight: 700;
}

.ct-go {
    width: 28px;
    height: 28px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg);
    color: var(--mut);
    font-size: .72rem;
    transition: background .2s, color .2s, transform .2s;
}

.ct-card:hover .ct-go {
    background: var(--p);
    color: #fff;
    transform: translateX(2px);
}

@keyframes ctin {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* empty + more */
.ct-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: clamp(28px, 6vw, 56px) 12px;
    text-align: center;
    color: var(--mut);
}

    .ct-empty i {
        font-size: 2.4rem;
        opacity: .55;
    }

    .ct-empty h3 {
        font-size: 1.05rem;
        color: var(--ink);
    }

    .ct-empty p {
        font-size: .88rem;
    }

.ct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 22px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--p), var(--p2));
    color: #fff !important;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s;
}

    .ct-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
    }

    .ct-btn.is-line {
        background: #fff;
        color: var(--p) !important;
        border: 1.5px solid var(--line);
    }

        .ct-btn.is-line:hover {
            background: #eef2ff;
            border-color: var(--p);
            box-shadow: none;
        }

.ct-more {
    display: grid;
    justify-items: center;
    gap: 6px;
    margin-top: 14px;
}

    .ct-more small {
        color: var(--mut);
        font-size: .76rem;
    }

@keyframes ctin {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 640px) {
    .ct-tools {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .ct-select {
        flex: none;
    }

    .ct-panel {
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ct-card {
        animation: none !important;
        transition: none !important;
    }
}
