/* Phase 6 only; DS tokens, shell geometry and Phase 5 card styles remain authoritative. */
body.sh-categories-enabled { background: #f7f8fa; }
.shopyli-ui .sh-category-grid, .shopyli-ui .sh-category-tree { list-style: none; margin: 0; padding: 0; }
.shopyli-ui .sh-category-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap: .5rem; }
.shopyli-ui .sh-category-grid > li, .shopyli-ui .sh-category-tree > li { min-inline-size: 0; list-style: none; }
.shopyli-ui .sh-category-tile { display: flex; align-items: center; gap: .625rem; min-block-size: 64px; padding: .625rem; border: 1px solid var(--sh-line); border-radius: var(--sh-radius-md); background: var(--sh-surface); color: var(--sh-ink); text-decoration: none; min-inline-size: 0; }
.shopyli-ui .sh-category-tile:hover { border-color: var(--sh-brand); }
.shopyli-ui .sh-category-tile[aria-current="page"] { border-color: var(--sh-brand); box-shadow: inset 0 0 0 1px var(--sh-brand); }
.shopyli-ui .sh-category-name { flex: 1; min-inline-size: 0; overflow-wrap: anywhere; white-space: normal; font-size: .9375rem; font-weight: 600; }
.shopyli-ui .sh-category-tile > .sh-icon { inline-size: 1rem; block-size: 1rem; flex: none; color: var(--sh-brand); }
.shopyli-ui .sh-category-media { position: relative; display: block; flex: none; overflow: hidden; inline-size: 2.5rem; block-size: 2.5rem; background: var(--sh-media); border-radius: .5rem; }
.shopyli-ui .sh-category-media .sh-media-fallback { color: var(--sh-brand); }
.shopyli-ui .sh-category-tree { display: grid; gap: .5rem; }
.shopyli-ui .sh-category-tree .sh-category-tree { margin-block-start: .5rem; margin-inline-start: 10px; padding-inline-start: 6px; border-inline-start: 2px solid var(--sh-line); }
.shopyli-ui .sh-category-tree .sh-category-tree .sh-category-tree .sh-category-tree { margin-inline-start: 0; padding-inline-start: 0; border: 0; }
.shopyli-ui .sh-category-tree--root > li > .sh-category-tile { background: var(--sh-brand-soft); }
.shopyli-ui .sh-category-panel { display: grid; gap: 1rem; min-inline-size: 0; }
.shopyli-ui #sh-shell-categories { inline-size: min(100%,640px); max-inline-size: 100%; max-block-size: calc(100dvh - env(safe-area-inset-top,0px)); }
.shopyli-ui #sh-shell-categories .sh-dialog-inner { padding: 20px 16px; }
.shopyli-ui #sh-shell-categories .sh-dialog-header { gap: 12px; }
.shopyli-ui #sh-shell-categories .sh-dialog-header h2 { min-inline-size: 0; }
.shopyli-ui #sh-shell-categories [data-sh-shell-close] { flex: none; inline-size: 44px; block-size: 44px; padding: 10px; }
.shopyli-ui #sh-shell-categories [data-sh-shell-close] .sh-icon { inline-size: 24px; block-size: 24px; }
.shopyli-ui .sh-category-panel .sh-category-tile { gap: 10px; padding: 10px; }
.shopyli-ui .sh-category-panel .sh-category-media { inline-size: 40px; block-size: 40px; }
.shopyli-ui .sh-category-panel .sh-category-tile > .sh-icon { inline-size: 16px; block-size: 16px; }
.shopyli-ui .sh-category-panel .sh-category-all { padding: 12px; gap: 8px; }
.shopyli-ui .sh-category-panel .sh-category-all > .sh-icon { inline-size: 20px; block-size: 20px; }
.shopyli-ui .sh-category-all { justify-self: start; white-space: normal; }
.shopyli-ui.sh-category-page { display: grid; gap: 1.5rem; min-inline-size: 0; }
.sh-category-page :is(h1,h2,h3,p,a,span) { overflow-wrap: anywhere; }
.sh-category-page h1 { font-size: clamp(1.65rem,5vw,2.3rem); line-height: 1.25; }
.sh-category-page h2 { font-size: 1.125rem; margin-block-end: .75rem; }
.sh-category-page .sh-category-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr)); }
.sh-category-page .sh-category-heading { display: grid; gap: .5rem; }
.sh-category-page .sh-category-heading--term { display: flex; align-items: flex-start; gap: 1rem; }
.sh-category-page .sh-category-heading--term > div { min-inline-size: 0; }
.sh-category-page .sh-category-eyebrow { color: var(--sh-brand); font-size: .875rem; font-weight: 700; }
.sh-category-page .sh-category-media--heading { inline-size: 4rem; block-size: 4rem; }
.sh-category-page .sh-category-description { margin-block-start: .625rem; max-inline-size: 65ch; color: var(--sh-muted); }
.sh-category-page .sh-category-description :is(img,video,iframe) { max-inline-size: 100%; height: auto; }
.sh-category-page .sh-category-context { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.sh-category-page .sh-category-context a { display: inline-flex; align-items: center; gap: .5rem; min-block-size: 44px; min-inline-size: 44px; color: var(--sh-brand-hover); text-decoration: none; }
.sh-category-page .sh-category-back .sh-icon { transform: rotate(180deg); flex: none; }
.sh-category-page[dir="rtl"] .sh-category-back .sh-icon { transform: none; }
.shopyli-ui .sh-category-state { display: grid; gap: .75rem; padding: 1rem; margin-block: .5rem; }
.shopyli-ui .sh-category-state > .sh-icon { color: var(--sh-brand); }
.shopyli-ui .sh-category-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.sh-category-page .sh-category-shop { justify-self: start; }
.sh-category-page .sh-category-pagination { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: 1.25rem; }
.sh-category-page .sh-category-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 44px; min-block-size: 44px; padding: .4rem .75rem; border: 1px solid var(--sh-line); border-radius: var(--sh-radius-sm); color: var(--sh-ink); text-decoration: none; background: var(--sh-surface); }
.sh-category-page .sh-category-pagination .current { background: var(--sh-brand); border-color: var(--sh-brand); color: var(--sh-on-color); }
.sh-home .sh-home-category-section .sh-category-name { font-size: .8125rem; }
.sh-category-page:lang(ar), .sh-category-page:lang(ar) :is(a,button,h1,h2,h3,p,span) { font-family: var(--sh-font-ar) !important; letter-spacing: 0; }
@media (min-width: 760px) {
 .shopyli-ui #sh-shell-categories { max-block-size: calc(100dvh - 10rem); }
 .sh-category-page > nav > .sh-category-tree--root { grid-template-columns: repeat(auto-fit,minmax(min(100%,18rem),1fr)); align-items: start; gap: 1rem; }
}
