/* ═════════════════════════════════════════════════════════════
   Sidebar Categories List — variant styles
   Applied via [data-cats-style="X"] on .home-categories-list
   HTML structure: ul > li > a > (img, .hc-name, i.has-sub)
                   li > ul.category-dropdown > li > a
   ═════════════════════════════════════════════════════════════ */

.home-categories-list[data-cats-style] {
    --hc-accent: var(--app-color, #6366f1);
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative;
    overflow: visible !important;
    float: none !important;
    width: 100%;
    box-shadow: none;
}
.home-categories-list[data-cats-style] > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    float: none !important;
    width: 100%;
    box-sizing: border-box;
}
/* The anchor is the flex row */
.home-categories-list[data-cats-style] > li > a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-decoration: none !important;
    color: inherit;
    box-sizing: border-box;
    padding: 11px 16px;
}
/* Icon at start */
.home-categories-list[data-cats-style] > li > a > img {
    width: 26px !important;
    height: 26px !important;
    object-fit: cover;
    border-radius: 6px;
    flex: 0 0 26px;
    background: #f3f4f6;
    padding: 3px;
    margin: 0 !important;
    box-sizing: border-box;
}
/* Name fills remaining space */
.home-categories-list[data-cats-style] > li > a > .hc-name {
    flex: 1 1 auto !important;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Arrow guaranteed at end */
.home-categories-list[data-cats-style] > li > a > i.has-sub {
    flex: 0 0 auto;
    font-size: 13px;
    opacity: .6;
    margin: 0 !important;
    margin-inline-start: auto !important;
    transition: transform .18s, opacity .18s;
}
.home-categories-list[data-cats-style] > li:hover > a > i.has-sub { opacity: 1; transform: translateX(-3px); }
[dir="ltr"] .home-categories-list[data-cats-style] > li:hover > a > i.has-sub { transform: translateX(3px); }

/* ── Header (categories title) ── */
.home-categories-list[data-cats-style] > li.hc-header > a {
    background: var(--hc-accent);
    color: #fff !important;
    padding: 13px 16px;
    font-weight: 800;
    font-size: 15px;
    justify-content: center;
}
.home-categories-list[data-cats-style] > li.hc-header > a > .hc-header-icon {
    font-size: 15px;
    color: #fff;
    margin: 0 !important;
    flex: 0 0 auto;
}
.home-categories-list[data-cats-style] > li.hc-header > a > .hc-name {
    flex: 0 0 auto !important;
    color: #fff !important;
}

/* ── Show-all row ── */
.home-categories-list[data-cats-style] > li.hc-showall > a {
    justify-content: center;
    color: var(--hc-accent);
    font-weight: 700;
    font-size: 13px;
}
.home-categories-list[data-cats-style] > li.hc-showall > a > i {
    margin: 0 !important;
    color: var(--hc-accent);
    font-size: 14px;
    flex: 0 0 auto;
}
.home-categories-list[data-cats-style] > li.hc-showall > a > .hc-name {
    flex: 0 0 auto !important;
}
.home-categories-list[data-cats-style] > li.hc-showall:hover > a {
    background: color-mix(in srgb, var(--hc-accent) 8%, transparent);
}

/* ══════════════════════════════════════
   Variant 1: CLASSIC
   ══════════════════════════════════════ */
.home-categories-list[data-cats-style="classic"] {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.home-categories-list[data-cats-style="classic"] > li:not(.hc-header) > a {
    border-top: 1px solid #f3f4f6 !important;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    transition: background .12s, color .12s;
}
.home-categories-list[data-cats-style="classic"] > li.hc-header > a { border-radius: 10px 10px 0 0; border-top: none !important; }
.home-categories-list[data-cats-style="classic"] > li:not(.hc-header):hover > a { background: color-mix(in srgb, var(--hc-accent) 6%, transparent); color: var(--hc-accent); }
.home-categories-list[data-cats-style="classic"] > li:not(.hc-header):hover > a > i.has-sub { color: var(--hc-accent); }

/* ══════════════════════════════════════
   Variant 2: CARDS
   ══════════════════════════════════════ */
.home-categories-list[data-cats-style="cards"] { background: transparent; padding: 4px !important; }
.home-categories-list[data-cats-style="cards"] > li { margin-bottom: 8px !important; }
.home-categories-list[data-cats-style="cards"] > li:last-child { margin-bottom: 0 !important; }
.home-categories-list[data-cats-style="cards"] > li:not(.hc-header) > a {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    transition: all .15s;
}
.home-categories-list[data-cats-style="cards"] > li:not(.hc-header) > a > img { background: color-mix(in srgb, var(--hc-accent) 10%, #f9fafb); }
.home-categories-list[data-cats-style="cards"] > li:not(.hc-header):hover > a { border-color: var(--hc-accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.04); }
.home-categories-list[data-cats-style="cards"] > li.hc-header > a { border-radius: 10px; }
.home-categories-list[data-cats-style="cards"] > li.hc-showall > a { background: #fff; border: 1px dashed color-mix(in srgb, var(--hc-accent) 40%, transparent); border-radius: 10px; }

/* ══════════════════════════════════════
   Variant 3: TILES — 2-column grid
   ══════════════════════════════════════ */
.home-categories-list[data-cats-style="tiles"] { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; background: transparent; padding: 4px !important; }
.home-categories-list[data-cats-style="tiles"] > li { width: auto; }
.home-categories-list[data-cats-style="tiles"] > li:not(.hc-header):not(.hc-showall) > a {
    flex-direction: column;
    text-align: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 8px;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: all .15s;
}
.home-categories-list[data-cats-style="tiles"] > li:not(.hc-header):not(.hc-showall) > a > img { width: 48px !important; height: 48px !important; flex: 0 0 48px; border-radius: 50%; background: color-mix(in srgb, var(--hc-accent) 10%, transparent); padding: 10px; }
.home-categories-list[data-cats-style="tiles"] > li:not(.hc-header):not(.hc-showall) > a > .hc-name { flex: 0 0 auto !important; }
.home-categories-list[data-cats-style="tiles"] > li:not(.hc-header):not(.hc-showall) > a > i.has-sub { display: none; }
.home-categories-list[data-cats-style="tiles"] > li:not(.hc-header):not(.hc-showall):hover > a { border-color: var(--hc-accent); background: color-mix(in srgb, var(--hc-accent) 4%, transparent); }
.home-categories-list[data-cats-style="tiles"] > li.hc-header { grid-column: 1 / -1; }
.home-categories-list[data-cats-style="tiles"] > li.hc-showall { grid-column: 1 / -1; }
.home-categories-list[data-cats-style="tiles"] > li.hc-header > a { border-radius: 10px; }
.home-categories-list[data-cats-style="tiles"] > li.hc-showall > a { background: #fff; border: 1px dashed color-mix(in srgb, var(--hc-accent) 40%, transparent); border-radius: 10px; }

/* ══════════════════════════════════════
   Variant 4: COMPACT — dense text-only
   ══════════════════════════════════════ */
.home-categories-list[data-cats-style="compact"] { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; }
.home-categories-list[data-cats-style="compact"] > li:not(.hc-header) > a {
    padding: 9px 16px;
    font-size: 13px;
    color: #374151;
    border-top: 1px solid #f3f4f6 !important;
}
.home-categories-list[data-cats-style="compact"] > li:not(.hc-header) > a > img { display: none; }
.home-categories-list[data-cats-style="compact"] > li.hc-header > a { border-radius: 8px 8px 0 0; padding: 11px 16px; font-size: 14px; border-top: none !important; }
.home-categories-list[data-cats-style="compact"] > li:not(.hc-header):hover > a { background: color-mix(in srgb, var(--hc-accent) 8%, transparent); color: var(--hc-accent); }

/* ══════════════════════════════════════
   Variant 5: CIRCLES
   ══════════════════════════════════════ */
.home-categories-list[data-cats-style="circles"] { background: transparent; padding: 4px !important; }
.home-categories-list[data-cats-style="circles"] > li { margin-bottom: 4px !important; }
.home-categories-list[data-cats-style="circles"] > li:not(.hc-header) > a {
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    border: 1px solid transparent;
    transition: all .12s;
}
.home-categories-list[data-cats-style="circles"] > li:not(.hc-header) > a > img { width: 40px !important; height: 40px !important; flex: 0 0 40px; border-radius: 50%; background: color-mix(in srgb, var(--hc-accent) 12%, transparent); border: 1.5px solid color-mix(in srgb, var(--hc-accent) 30%, transparent); padding: 5px; }
.home-categories-list[data-cats-style="circles"] > li:not(.hc-header):hover > a { background: color-mix(in srgb, var(--hc-accent) 6%, transparent); color: var(--hc-accent); border-color: color-mix(in srgb, var(--hc-accent) 20%, transparent); }
.home-categories-list[data-cats-style="circles"] > li:not(.hc-header):hover > a > img { background: var(--hc-accent); border-color: var(--hc-accent); }
.home-categories-list[data-cats-style="circles"] > li.hc-header > a { border-radius: 10px; }

/* ══════════════════════════════════════
   Variant 6: BOXED
   ══════════════════════════════════════ */
.home-categories-list[data-cats-style="boxed"] { border: 2px solid var(--hc-accent); border-radius: 12px; background: #fff; }
.home-categories-list[data-cats-style="boxed"] > li:not(.hc-header) > a {
    padding: 11px 16px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    border-top: 1px solid #f3f4f6 !important;
}
.home-categories-list[data-cats-style="boxed"] > li.hc-header > a { border-radius: 10px 10px 0 0; padding: 14px 16px; font-size: 15px; border-top: none !important; }
.home-categories-list[data-cats-style="boxed"] > li:not(.hc-header):hover > a { background: color-mix(in srgb, var(--hc-accent) 8%, transparent); color: var(--hc-accent); }
.home-categories-list[data-cats-style="boxed"] > li:not(.hc-header):hover > a > i.has-sub { color: var(--hc-accent); }

/* ══════════════════════════════════════
   Sub-dropdown — Flies OUT of parent li
   Arabic (RTL): appears on the LEFT
   English (LTR): appears on the RIGHT
   ══════════════════════════════════════ */
.home-categories-list[data-cats-style] .category-dropdown {
    display: none !important;
    position: absolute !important;
    top: 0 !important;
    bottom: auto !important;
    inset-inline-start: 100% !important;
    inset-inline-end: auto !important;
    margin: 0 !important;
    width: 340px !important;
    max-height: 420px;
    overflow-y: auto;
    background: #fff !important;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(0,0,0,.15);
    padding: 8px !important;
    z-index: 999;
    box-sizing: border-box;
    list-style: none !important;
    /* Visual gap built into the box via inline-start border — mouse crossing it still counts as hovering the dropdown */
    border-inline-start: 10px solid transparent !important;
}
/* Bridge pseudo on the parent li — extends into the dropdown zone so hover never breaks */
.home-categories-list[data-cats-style] > li.hc-item::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-start: 100%;
    width: 12px;
    background: transparent;
    pointer-events: auto;
}
.home-categories-list[data-cats-style] > li:hover > .category-dropdown { display: block !important; }
.home-categories-list[data-cats-style] .category-dropdown > li {
    display: block !important;
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
}
.home-categories-list[data-cats-style] .category-dropdown > li > a {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px !important;
    text-decoration: none !important;
    color: #374151 !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    width: 100%;
    box-sizing: border-box;
}
.home-categories-list[data-cats-style] .category-dropdown > li > a > img {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px;
    border-radius: 4px;
    object-fit: cover;
    background: #f3f4f6;
    padding: 2px;
}
.home-categories-list[data-cats-style] .category-dropdown > li > a > .hc-name {
    flex: 1 1 auto !important;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-categories-list[data-cats-style] .category-dropdown > li:hover > a {
    background: color-mix(in srgb, var(--hc-accent) 10%, transparent) !important;
    color: var(--hc-accent) !important;
}
