/* /categories — danh mục sản phẩm (B2B) */

.cat-page {
    padding: 2.5rem 0 4rem;
    background: #f8fafc;
}

.cat-page-header {
    margin-bottom: 2rem;
}

.cat-page-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color, #0d6efd);
}

.cat-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.cat-page-header p {
    margin: 0;
    max-width: 40rem;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.55;
}

.cat-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.cat-search {
    position: relative;
    flex: 1 1 220px;
    max-width: 360px;
}

.cat-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.cat-search input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.55rem 0.85rem 0.55rem 2.25rem;
    font-size: 0.9rem;
    background: #f8fafc;
    color: #0f172a;
}

.cat-search input:focus {
    outline: none;
    border-color: var(--primary-color, #0d6efd);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 13, 110, 253), 0.12);
}

.cat-toolbar-meta {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 991.98px) {
    .cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .cat-page {
        padding: 1.5rem 0 3rem;
    }

    .cat-page-header h1 {
        font-size: 1.4rem;
    }

    .cat-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.cat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cat-card:hover {
    border-color: rgba(var(--primary-color-rgb, 13, 110, 253), 0.35);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.cat-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: linear-gradient(145deg, #e8eef7 0%, #f1f5f9 55%, #e2e8f0 100%);
    overflow: hidden;
    text-decoration: none;
}

.cat-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.cat-card:hover .cat-card-media img:not(.is-broken) {
    transform: scale(1.04);
}

.cat-card-media img.is-broken {
    display: none;
}

.cat-card-placeholder {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #0d6efd);
    opacity: 0.45;
    background: linear-gradient(145deg, #e8eef7 0%, #f1f5f9 55%, #e2e8f0 100%);
}

.cat-card-placeholder.is-visible {
    display: flex;
}

.cat-card-placeholder i {
    font-size: 2.5rem;
}

.cat-card-count {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.cat-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.1rem 1.15rem 1.2rem;
}

.cat-card-title {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.cat-card-title a {
    color: inherit;
    text-decoration: none;
}

.cat-card-title a:hover {
    color: var(--primary-color, #0d6efd);
}

.cat-card-desc {
    margin: 0 0 0.85rem;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.cat-card-children {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.75rem;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cat-chip:hover {
    background: rgba(var(--primary-color-rgb, 13, 110, 253), 0.08);
    border-color: rgba(var(--primary-color-rgb, 13, 110, 253), 0.35);
    color: var(--primary-color, #0d6efd);
}

.cat-card-footer {
    margin-top: auto;
    padding-top: 0.25rem;
}

.cat-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color, #0d6efd);
    text-decoration: none;
}

.cat-card-cta i {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.cat-card:hover .cat-card-cta i {
    transform: translateX(3px);
}

.cat-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
}

.cat-card.is-hidden {
    display: none;
}
