/* =========================================================
   NEXENG Category Pages v1
   Archivo: /assets/css/nexeng-categories-v1.css
   Requiere Core UI v1 + Pages v1.
   ========================================================= */

.nx-category-page .nx-page-hero {
    min-height: 330px;
    display: grid;
    align-items: center;
    overflow: hidden;
}

.nx-category-page .nx-page-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1020px;
}

.nx-category-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.nx-category-meta-row .nx-chip {
    min-height: 32px;
}

.nx-category-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.nx-category-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.nx-category-toolbar {
    margin-bottom: 18px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.nx-category-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nx-category-search {
    position: relative;
    min-width: min(420px, 100%);
    flex: 1 1 280px;
}

.nx-category-search input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--nx-border);
    border-radius: 999px;
    padding: 0 44px 0 16px;
    color: var(--nx-text);
    background: rgba(255,255,255,.92);
    outline: none;
}

.nx-category-search span {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nx-blue-strong);
    font-weight: 950;
}

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

.nx-cat-app-card {
    min-height: 286px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.nx-cat-app-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 0%, rgba(0,174,239,.10), transparent 36%);
    opacity: 0;
    transition: opacity .18s var(--nx-ease);
    pointer-events: none;
}

.nx-cat-app-card:hover::before {
    opacity: 1;
}

.nx-cat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.nx-cat-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0,143,211,.16);
    border-radius: 19px;
    color: var(--nx-blue-strong);
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.95), transparent 28%),
        linear-gradient(135deg, #eef8ff, #d9efff);
    box-shadow: 0 12px 28px rgba(8,103,216,.10);
}

.nx-cat-icon svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nx-cat-badges {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.nx-cat-app-card h2 {
    margin: 0 0 8px;
    color: var(--nx-navy);
    font-size: 1.22rem;
    line-height: 1.16;
    letter-spacing: -.04em;
}

.nx-cat-desc {
    margin: 0;
    color: var(--nx-muted);
    font-size: .94rem;
    line-height: 1.48;
}

.nx-cat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.nx-cat-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(90deg, transparent, rgba(0,143,211,.20), transparent) border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nx-cat-footer small {
    color: var(--nx-muted);
    font-weight: 850;
}

.nx-cat-open {
    min-height: 40px;
    min-width: 92px;
    border-radius: 13px;
    padding: 0 14px;
}

.nx-category-side {
    position: sticky;
    top: 104px;
}

.nx-category-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.nx-category-list a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    border: 1px solid var(--nx-border);
    border-radius: 15px;
    color: var(--nx-soft);
    background: rgba(255,255,255,.72);
    font-weight: 900;
    transition: transform .18s var(--nx-ease), border-color .18s var(--nx-ease), box-shadow .18s var(--nx-ease), background .18s var(--nx-ease);
}

.nx-category-list a:hover,
.nx-category-list a.is-active {
    transform: translateY(-1px);
    border-color: rgba(8,103,216,.24);
    color: var(--nx-blue-strong);
    background: #f2f9ff;
    box-shadow: var(--nx-shadow-mini);
}

.nx-category-list small {
    min-width: 30px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--nx-blue-strong);
    background: rgba(0,143,211,.09);
    font-size: .72rem;
}

.nx-category-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.nx-category-overview-card {
    min-height: 210px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.nx-category-overview-card h2 {
    margin: 12px 0 8px;
    color: var(--nx-navy);
    letter-spacing: -.04em;
}

.nx-category-overview-card p {
    margin: 0;
    color: var(--nx-muted);
}

.nx-category-overview-card .nx-btn {
    margin-top: auto;
}

.nx-empty-category {
    padding: 34px;
    text-align: center;
}

.nx-empty-category h2 {
    margin: 0 0 8px;
    color: var(--nx-navy);
    letter-spacing: -.04em;
}

.nx-empty-category p {
    margin: 0 auto 18px;
    max-width: 620px;
    color: var(--nx-muted);
}

/* Dark mode */
body.nx-theme-dark .nx-category-search input,
body.nx-theme-dark .nx-category-list a {
    background: rgba(13,34,55,.92);
    border-color: rgba(125,211,252,.20);
    color: #f3fbff;
}

body.nx-theme-dark .nx-category-search span,
body.nx-theme-dark .nx-category-list a:hover,
body.nx-theme-dark .nx-category-list a.is-active {
    color: #74d6ff;
}

body.nx-theme-dark .nx-category-list a:hover,
body.nx-theme-dark .nx-category-list a.is-active {
    background: rgba(20,55,86,.94);
    border-color: rgba(94,203,255,.30);
}

body.nx-theme-dark .nx-category-list small {
    color: #74d6ff;
    background: rgba(94,203,255,.12);
}

body.nx-theme-dark .nx-cat-app-card {
    background:
        radial-gradient(circle at 18% 0%, rgba(0,174,239,.11), transparent 32%),
        linear-gradient(180deg, #102a43 0%, #0c2238 55%, #0b1d31 100%);
    border-color: rgba(125,211,252,.22);
}

body.nx-theme-dark .nx-cat-icon {
    background:
        radial-gradient(circle at 30% 22%, rgba(125,211,252,.16), transparent 28%),
        linear-gradient(135deg, rgba(21,65,99,.98), rgba(13,45,72,.98));
    border-color: rgba(125,211,252,.28);
    color: #65d5ff;
}

body.nx-theme-dark .nx-cat-app-card h2,
body.nx-theme-dark .nx-category-overview-card h2,
body.nx-theme-dark .nx-empty-category h2 {
    color: #f3fbff;
}

body.nx-theme-dark .nx-cat-desc,
body.nx-theme-dark .nx-empty-category p,
body.nx-theme-dark .nx-category-overview-card p {
    color: #b6c7d8;
}

body.nx-theme-dark .nx-cat-footer {
    background:
        linear-gradient(rgba(12,34,56,0), rgba(12,34,56,0)) padding-box,
        linear-gradient(90deg, transparent, rgba(125,211,252,.24), transparent) border-box;
}

body.nx-theme-dark .nx-cat-footer small {
    color: #a9bdd2;
}

/* Responsive */
@media (max-width: 1180px) {
    .nx-category-layout {
        grid-template-columns: 1fr;
    }

    .nx-category-side {
        position: relative;
        top: auto;
    }

    .nx-category-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .nx-category-grid {
        grid-template-columns: 1fr;
    }

    .nx-category-toolbar {
        align-items: stretch;
    }

    .nx-category-toolbar-left,
    .nx-category-search {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .nx-category-page .nx-page-hero {
        min-height: 0;
    }

    .nx-category-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .nx-category-actions .nx-btn {
        width: 100%;
    }

    .nx-category-overview-grid {
        grid-template-columns: 1fr;
    }

    .nx-cat-app-card {
        min-height: 0;
        padding: 18px;
    }

    .nx-cat-card-top {
        align-items: center;
    }

    .nx-cat-footer {
        flex-wrap: wrap;
    }

    .nx-cat-open {
        width: 100%;
    }
}
