/* ============================================================
   CATALOG — หน้ารวมระบบ (pages/products.php) สไตล์ Hub
   การ์ดระบบใช้ .sys-* จาก style.css (includes/system-card.php)
   ============================================================ */

/* ── HERO ── */
.ct-hero {
    --ink: color-mix(in srgb, var(--primary) 10%, #06070d);
    position: relative; overflow: hidden; isolation: isolate;
    background: var(--ink); color: rgba(255,255,255,.7);
    padding: 26px 0 44px;
}
.ct-hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ct-hero-bg::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 70% 100% at 75% 0%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 100% at 75% 0%, #000 20%, transparent 75%);
}
.ct-hero-bg::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(40% 90% at 90% 10%, color-mix(in srgb, var(--primary) 45%, transparent), transparent 70%);
    opacity: .7;
}
.ct-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; font-size: 0.82rem; }
.ct-crumb a { color: rgba(255,255,255,.55); }
.ct-crumb a:hover { color: #fff; }
.ct-crumb span { color: rgba(255,255,255,.85); }
.ct-crumb i { display: flex; color: rgba(255,255,255,.3); }

.ct-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.ct-hero-text { min-width: 0; max-width: 620px; }
.ct-cat-icon {
    display: inline-flex; width: 56px; height: 56px; padding: 8px; margin-bottom: 12px; border-radius: 16px;
    align-items: center; justify-content: center; background: #fff;
}
.ct-hero h1 { color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.3; margin-bottom: 6px; }
.ct-hero p { font-size: 1rem; line-height: 1.7; margin: 0; }

.ct-search {
    display: flex; align-items: center; gap: 10px; width: min(460px, 100%);
    padding: 6px 6px 6px 18px; border-radius: var(--radius-full);
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
    backdrop-filter: blur(8px); transition: border-color var(--transition), box-shadow var(--transition);
}
.ct-search:focus-within { border-color: color-mix(in srgb, var(--primary) 70%, #fff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.ct-search > i { display: flex; color: rgba(255,255,255,.5); }
.ct-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: 0.95rem; padding: 8px 0; }
.ct-search input::placeholder { color: rgba(255,255,255,.4); }
.ct-search .btn-primary { flex-shrink: 0; padding: 10px 22px; }

/* ── FILTER BAR (sticky) ── */
.ct-bar {
    position: sticky; top: var(--header-h); z-index: 50;
    background: color-mix(in srgb, var(--white) 92%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); box-shadow: 0 6px 20px -14px rgba(0,0,0,.25);
}
.ct-bar-inner { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.ct-cats { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.ct-cats::-webkit-scrollbar { display: none; }
.ct-chip {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
    padding: 7px 14px; border-radius: var(--radius-full);
    border: 1px solid var(--border); background: var(--white);
    color: var(--text); font-size: 0.87rem; font-weight: 600; transition: all var(--transition);
}
.ct-chip span {
    min-width: 22px; padding: 0 6px; border-radius: var(--radius-full); text-align: center;
    background: var(--bg); color: var(--text-muted); font-size: 0.72rem; line-height: 1.6;
}
.ct-chip:hover { color: var(--primary); border-color: var(--primary); }
.ct-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px var(--primary); }
.ct-chip.active span { background: rgba(255,255,255,.22); color: #fff; }

.ct-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ct-sale {
    display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: var(--radius-full);
    border: 1px solid rgba(249,115,22,.35); background: rgba(249,115,22,.06);
    color: #ea580c; font-size: 0.85rem; font-weight: 700; transition: all var(--transition);
}
.ct-sale i { display: flex; }
.ct-sale:hover { color: #ea580c; background: rgba(249,115,22,.12); }
.ct-sale.active { background: linear-gradient(135deg, #f97316, #f59e0b); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px rgba(249,115,22,.8); }
.ct-sort { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.ct-sort a {
    display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 9px;
    color: var(--text-muted); font-size: 0.8rem; font-weight: 600; white-space: nowrap; transition: all var(--transition);
}
.ct-sort a i { display: flex; }
.ct-sort a:hover { color: var(--primary); }
.ct-sort a.active { background: var(--white); color: var(--primary); box-shadow: var(--shadow-xs); }
.ct-sort-short { display: none; }

/* ── RESULTS ── */
.ct-main { background: var(--bg); padding: 26px 0 80px; min-height: 50vh; }
.ct-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; font-size: 0.9rem; color: var(--text-muted); }
.ct-summary strong { color: var(--dark); }
.ct-tag {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: var(--radius-full);
    background: var(--primary-light); color: var(--primary); font-size: 0.8rem; font-weight: 600;
}
.ct-tag i { display: flex; }
.ct-tag:hover { color: var(--primary-dark); }
.ct-tag--sale { background: rgba(249,115,22,.1); color: #ea580c; }
.ct-clear { font-size: 0.8rem; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }

.ct-empty {
    text-align: center; padding: 56px 20px; border-radius: 22px;
    background: var(--white); border: 1.5px dashed var(--border);
}
.ct-empty-ic {
    width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary); font-size: 1.8rem;
}
.ct-empty-ic i { display: flex; }
.ct-empty h2 { font-size: 1.3rem; margin-bottom: 6px; }
.ct-empty p { color: var(--text-muted); margin-bottom: 20px; }
.ct-empty .btn-primary i { display: flex; }

.ct-pages { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 40px; }
.ct-pages a {
    min-width: 42px; height: 42px; padding: 0 12px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--white); border: 1px solid var(--border); color: var(--text); font-weight: 700;
    transition: all var(--transition);
}
.ct-pages a i { display: flex; }
.ct-pages a:hover { border-color: var(--primary); color: var(--primary); }
.ct-pages a.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px var(--primary); }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {                 /* จอกลาง/มือถือ: ใช้ชื่อสั้น */
    .ct-sort-full { display: none; }
    .ct-sort-short { display: inline; }
    .ct-sort a { padding: 6px 9px; }
    .ct-sort a i { display: none; }
}
@media (max-width: 860px) {
    .ct-bar-inner { flex-direction: column; align-items: stretch; gap: 10px; }
    .ct-tools { justify-content: space-between; }
}
@media (max-width: 640px) {
    .ct-hero { padding: 18px 0 30px; }
    .ct-hero-row { gap: 18px; }
    .ct-search { width: 100%; }
    .ct-search .btn-primary { padding: 9px 16px; }
    .ct-main .container, .ct-bar .container { padding-left: 16px; padding-right: 16px; }
    .ct-bar { position: static; box-shadow: none; }   /* มือถือ: ไม่ติดบนจอ (สูง 2 แถว กินพื้นที่) */
    .ct-sale { padding: 6px 12px; font-size: 0.8rem; }
}
