/* =====================================================================
 * TIOB category items & listings – hika_category_tpl 2.0.0
 * Items sit inside listing_div.php's card (.hikashop_subcontainer).
 * .tcc--card (img_title) .tcc--img .tcc--title .tcc--desc .tcc--pane (+fade/slideh/slidev)
 * .tcc--row (list) .tcc-table (table)
 * ===================================================================== */
.tcc, .tcc-listing {
	--k-pri: var(--hk-pri, #4f46e5);
	--k-pri-2: var(--hk-pri-2, #6366f1);
	--k-pri-l: var(--hk-pri-l, #eef2ff);
	--k-pri-b: var(--hk-pri-b, #c7d2fe);
	--k-ink: var(--hk-ink, #0f172a);
	--k-txt2: var(--hk-txt2, #475569);
	--k-mut: var(--hk-mut, #64748b);
	--k-line: var(--hk-line, #e5e7eb);
	--k-bg: var(--hk-bg, #f8fafc);
	--k-card: var(--hk-card, #fff);
	--k-r: var(--hk-r, 16px);
	--k-sh: var(--hk-sh, 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06));
	--k-sh-h: var(--hk-sh-h, 0 2px 4px rgba(15, 23, 42, .05), 0 16px 40px rgba(79, 70, 229, .12));
	--k-ease: var(--hk-ease, cubic-bezier(.2, .7, .2, 1));
}
.tcc { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%; direction: rtl; text-align: right; color: var(--k-ink); line-height: 1.6; }
.tcc *, .tcc *::before, .tcc *::after { box-sizing: border-box; }
.tcc a { text-decoration: none; }
.tcc .tcc-ic, .tcc-listing .tcc-ic { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tcc .tcc-media { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: linear-gradient(135deg, var(--k-pri-l), var(--k-bg)); flex: none; }
.tcc .tcc-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--k-ease); }
.hikashop_subcontainer:hover .tcc .tcc-media img, .tcc:hover .tcc-media img { transform: scale(1.06); }
.tcc .tcc-noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--k-pri); opacity: .55; }
.tcc .tcc-noimg .tcc-ic { width: 40%; height: 40%; max-width: 64px; max-height: 64px; stroke-width: 1.3; }

.tcc .tcc-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px; flex: 1; }
.tcc .tcc-body--c { align-items: center; text-align: center; }
.tcc .tcc-name { margin: 0; font-size: 14px; font-weight: 800; line-height: 1.6; }
.tcc .tcc-name a { color: var(--k-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s; }
.tcc .tcc-name a:hover { color: var(--k-pri); }
.tcc .tcc-count { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 1px 9px; border-radius: 999px; background: var(--k-pri-l); color: var(--k-pri); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tcc .tcc-body--c .tcc-count { align-self: center; }
.tcc .tcc-count .tcc-ic { width: 12px; height: 12px; }
.tcc .tcc-count--light { background: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(4px); }
.tcc .tcc-desc { margin: 0; color: var(--k-txt2); font-size: 12.5px; line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcc .tcc-more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; color: var(--k-pri); font-size: 12.5px; font-weight: 800; }
.tcc .tcc-more .tcc-ic { transition: transform .2s; }
.tcc .tcc-more:hover .tcc-ic { transform: translateX(-3px); }

/* img: name on the picture */
.tcc--img .tcc-media { aspect-ratio: 4 / 5; height: 100%; }
.tcc--img .tcc-media::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(0deg, color-mix(in srgb, var(--k-ink) 85%, transparent), transparent); }
.tcc--img .tcc-cap { position: absolute; inset: auto 0 0; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px; }
.tcc--img .tcc-cap b { color: #fff; font-size: 14px; font-weight: 800; line-height: 1.55; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }

/* title: icon tile */
.tcc--title { justify-content: center; }
.tcc--title .tcc-tile { display: flex; align-items: center; gap: 10px; padding: 12px; height: 100%; color: var(--k-ink); }
.tcc--title .tcc-tile__ic { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: linear-gradient(135deg, var(--k-pri), var(--k-pri-2)); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--k-pri) 30%, transparent); }
.tcc--title .tcc-tile__ic .tcc-ic { width: 20px; height: 20px; }
.tcc--title .tcc-tile__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tcc--title .tcc-tile__txt b { font-size: 13.5px; font-weight: 800; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcc .tcc-go { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--k-bg); color: var(--k-mut); transition: background .2s, color .2s, transform .2s; }
.tcc--title .tcc-tile:hover .tcc-go, .tcc--row:hover .tcc-go { background: var(--k-pri); color: #fff; transform: translateX(-2px); }
.hkc-mode-title .hikashop_subcontainer:hover .tcc-tile b { color: var(--k-pri); }

/* desc */
.tcc--desc .tcc-media { aspect-ratio: 16 / 10; }

/* pane */
.tcc--pane { overflow: hidden; }
.tcc--pane .tcc-label { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 12px 12px; text-align: center; flex: 1; }
.tcc--pane .tcc-label .tcc-count { align-self: center; }
.tcc--pane .tcc-pane { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; background: linear-gradient(0deg, var(--k-card) 58%, color-mix(in srgb, var(--k-card) 40%, transparent)); opacity: 0; transform: translateY(20px); transition: opacity .3s var(--k-ease), transform .35s var(--k-ease); pointer-events: none; }
.tcc--pane .tcc-pane__in { display: flex; flex-direction: column; gap: 7px; width: 100%; padding: 14px; }
.tcc--pane:hover .tcc-pane, .tcc--pane:focus-within .tcc-pane { opacity: 1; transform: none; pointer-events: auto; }
.tcc--pane.tcc--fade .tcc-pane { transform: none; }
.tcc--pane.tcc--slideh .tcc-pane { opacity: 1; transform: translateX(-100%); }
.tcc--pane.tcc--slidev .tcc-pane { opacity: 1; transform: translateY(100%); }
.tcc--pane.tcc--slideh:hover .tcc-pane, .tcc--pane.tcc--slidev:hover .tcc-pane { transform: none; }

/* listing_div sub-category chips look the same in every mode */
.hk-catgrid-wrap .hikashop_subcontainer:has(.tcc) { height: 100%; }

/* ---------- list ---------- */
.tcc-rows { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.tcc--row { flex-direction: row; align-items: center; gap: 14px; height: auto; padding: 12px; margin: 0; background: var(--k-card); border: 1px solid var(--k-line); border-radius: var(--k-r); box-shadow: var(--k-sh); transition: border-color .25s, box-shadow .25s, transform .25s; }
.tcc--row:hover { border-color: var(--k-pri-b); box-shadow: var(--k-sh-h); transform: translateY(-2px); }
.tcc--row .tcc-media { width: 96px; border-radius: 12px; }
.tcc--row .tcc-body { padding: 0; gap: 6px; }
.tcc--row .tcc-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tcc--row .tcc-name { font-size: 15.5px; }
.tcc--row .tcc-desc { -webkit-line-clamp: 2; }
.tcc .tcc-kids, .tcc-listing .tcc-kids { display: flex; flex-wrap: wrap; gap: 5px; }
.tcc .tcc-kids a, .tcc-listing .tcc-kids a { padding: 2px 9px; border-radius: 999px; background: var(--k-bg); box-shadow: inset 0 0 0 1px var(--k-line); color: var(--k-txt2); font-size: 11.5px; text-decoration: none; transition: background .2s, color .2s; }
.tcc .tcc-kids a:hover, .tcc-listing .tcc-kids a:hover { background: var(--k-pri); color: #fff; box-shadow: none; }

/* ---------- table ---------- */
.tcc-table-wrap { overflow-x: auto; border: 1px solid var(--k-line); border-radius: var(--k-r); background: var(--k-card); box-shadow: var(--k-sh); }
.tcc-table { width: 100%; border-collapse: collapse; direction: rtl; font-size: 13.5px; }
.tcc-table th { padding: 12px 14px; background: var(--k-bg); color: var(--k-mut); font-size: 12px; font-weight: 800; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--k-line); }
.tcc-table td { padding: 12px 14px; border-bottom: 1px solid var(--k-line); vertical-align: middle; color: var(--k-txt2); }
.tcc-table tbody tr:last-child td { border-bottom: 0; }
.tcc-table tbody tr:hover { background: var(--k-bg); }
.tcc-table .tcc-td-name__in { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.tcc-table .tcc-media { position: relative; display: block; width: 56px; aspect-ratio: 1 / 1; flex: none; overflow: hidden; border-radius: 10px; background: linear-gradient(135deg, var(--k-pri-l), var(--k-bg)); }
.tcc-table .tcc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcc-table .tcc-noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--k-pri); opacity: .55; }
.tcc-table .tcc-noimg .tcc-ic { width: 24px; height: 24px; }
.tcc-table .tcc-name { margin: 0; font-size: 14px; font-weight: 800; }
.tcc-table .tcc-name a { color: var(--k-ink); text-decoration: none; }
.tcc-table .tcc-name a:hover { color: var(--k-pri); }
.tcc-table .tcc-desc { margin: 2px 0 0; color: var(--k-mut); font-size: 12px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tcc-table b { color: var(--k-ink); }
.tcc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; background: var(--k-pri-l); color: var(--k-pri); font-weight: 800; font-size: 12.5px; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.tcc-btn:hover { background: var(--k-pri); color: #fff; }
.tcc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tcc-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; border: 1px dashed var(--k-line); border-radius: var(--k-r); color: var(--k-mut); direction: rtl; }
.tcc-empty .tcc-ic { width: 38px; height: 38px; }
.tcc-empty p { margin: 0; font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
	.tcc .tcc-body { padding: 8px 8px 10px; gap: 4px; }
	.tcc .tcc-name { font-size: 12.5px; }
	.tcc .tcc-count { font-size: 10px; padding: 0 7px; }
	.tcc .tcc-desc { font-size: 11.5px; -webkit-line-clamp: 2; }
	.tcc--desc .tcc-more { display: none; }
	.tcc--img .tcc-cap { padding: 8px; }
	.tcc--img .tcc-cap b { font-size: 12px; }
	.tcc--title .tcc-tile { padding: 8px; gap: 8px; flex-direction: column; text-align: center; }
	.tcc--title .tcc-tile__txt { align-items: center; }
	.tcc--title .tcc-tile__txt b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12px; }
	.tcc--title .tcc-go { display: none; }
	.tcc--pane .tcc-pane { display: none; }
	.tcc--row { align-items: flex-start; gap: 10px; padding: 10px; }
	.tcc--row .tcc-media { width: 72px; }
	.tcc--row .tcc-name { font-size: 14px; }
	.tcc--row .tcc-go { display: none; }
	.tcc-table-wrap { border: 0; background: none; box-shadow: none; }
	.tcc-table thead { display: none; }
	.tcc-table, .tcc-table tbody { display: block; }
	.tcc-table tbody { display: grid; gap: 10px; }
	.tcc-table tr { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border: 1px solid var(--k-line); border-radius: 14px; background: var(--k-card); }
	.tcc-table td { display: block; padding: 0; border: 0; }
	.tcc-table td.tcc-td-name, .tcc-table td[data-label="زیردسته‌ها"] { grid-column: 1 / -1; }
	.tcc-table .tcc-td-name__in { min-width: 0; }
	.tcc-table td[data-label]::before { content: attr(data-label) ": "; color: var(--k-mut); font-size: 11px; }
}
@media (hover: none) {
	.tcc--pane .tcc-pane { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.tcc, .tcc *, .tcc-listing * { transition: none !important; }
}

/* 2.1.0: compact category cards (img_title) – smaller picture and text */
.tcc--card .tcc-media { aspect-ratio: 4 / 3; }
.tcc--card .tcc-body { gap: 4px; padding: 9px 10px 11px; }
.tcc--card .tcc-name { font-size: 13.5px; line-height: 1.55; }
.tcc--card .tcc-count { font-size: 11px; padding: 0 8px; }
.tcc--card .tcc-subs, .tcc--card .tcc-kids { gap: 3px; }
@container (max-width: 540px) {
	.tcc--card .tcc-body { padding: 6px 6px 8px; gap: 3px; }
	.tcc--card .tcc-name { font-size: 12px; }
	.tcc--card .tcc-count { font-size: 10px; }
}
@media (max-width: 540px) {
	.tcc--card .tcc-body { padding: 6px 6px 8px; gap: 3px; }
	.tcc--card .tcc-name { font-size: 12px; }
	.tcc--card .tcc-count { font-size: 10px; padding: 0 6px; }
	.tcc--card .tcc-kids, .tcc--card .tcc-subs { display: none; }
}
