/*
 * Product short / full description: rich text saved by the admin editor (Quill 2).
 *
 * Quill 2 stores EVERY list as <ol>; the real type is on each item:
 *   <ol><li data-list="bullet"><span class="ql-ui"></span>Item</li></ol>
 *   <ol><li data-list="ordered"><span class="ql-ui"></span>Step</li></ol>
 * and nested items as flat siblings with class="ql-indent-N" (N = level).
 * Without Quill's stylesheet the browser numbers every item, so bullet lists
 * showed up as 1., 2., 3. and nested items were not indented.
 *
 * These rules draw the marker in the empty .ql-ui span, the same way Quill's
 * own editor CSS does. They only match items that carry data-list, so plain
 * <ul>/<ol> lists (older content, other editors) keep the theme's styling.
 * Scoped to .ub-rich-text (the description containers on the product page).
 */

/* An <ol> that holds Quill items: the item draws its own marker. */
.ub-rich-text ol:has(> li[data-list]) {
    padding-left: 0;
    list-style: none;
}

/* Every <ol> restarts its numbering (a heading/paragraph ends a list). */
.ub-rich-text ol {
    counter-reset: list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
}

.ub-rich-text li[data-list] {
    list-style-type: none;
    position: relative;
    padding-left: 1.5em;
}

.ub-rich-text li[data-list] > .ql-ui {
    display: inline;
}

.ub-rich-text li[data-list] > .ql-ui::before {
    display: inline-block;
    margin-left: -1.5em;
    margin-right: 0.3em;
    width: 1.2em;
    text-align: right;
    white-space: nowrap;
}

/* Bullets: disc, then circle, then square for deeper levels. */
.ub-rich-text li[data-list="bullet"] > .ql-ui::before { content: "\2022"; }
.ub-rich-text li[data-list="bullet"].ql-indent-1 > .ql-ui::before,
.ub-rich-text li[data-list="bullet"].ql-indent-4 > .ql-ui::before,
.ub-rich-text li[data-list="bullet"].ql-indent-7 > .ql-ui::before { content: "\25E6"; }
.ub-rich-text li[data-list="bullet"].ql-indent-2 > .ql-ui::before,
.ub-rich-text li[data-list="bullet"].ql-indent-5 > .ql-ui::before,
.ub-rich-text li[data-list="bullet"].ql-indent-8 > .ql-ui::before { content: "\25AA"; }

/* Checklists (Quill supports them too). */
.ub-rich-text li[data-list="checked"] > .ql-ui::before { content: "\2611"; }
.ub-rich-text li[data-list="unchecked"] > .ql-ui::before { content: "\2610"; }

/* Numbered lists: 1. / a. / i. / 1. ... per level, like Quill. */
.ub-rich-text li[data-list] { counter-set: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; }
.ub-rich-text li[data-list="ordered"] { counter-increment: list-0; }
.ub-rich-text li[data-list="ordered"] > .ql-ui::before { content: counter(list-0, decimal) ". "; }

.ub-rich-text li[data-list].ql-indent-1 { counter-set: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; }
.ub-rich-text li[data-list="ordered"].ql-indent-1 { counter-increment: list-1; }
.ub-rich-text li[data-list="ordered"].ql-indent-1 > .ql-ui::before { content: counter(list-1, lower-alpha) ". "; }

.ub-rich-text li[data-list].ql-indent-2 { counter-set: list-3 list-4 list-5 list-6 list-7 list-8 list-9; }
.ub-rich-text li[data-list="ordered"].ql-indent-2 { counter-increment: list-2; }
.ub-rich-text li[data-list="ordered"].ql-indent-2 > .ql-ui::before { content: counter(list-2, lower-roman) ". "; }

.ub-rich-text li[data-list].ql-indent-3 { counter-set: list-4 list-5 list-6 list-7 list-8 list-9; }
.ub-rich-text li[data-list="ordered"].ql-indent-3 { counter-increment: list-3; }
.ub-rich-text li[data-list="ordered"].ql-indent-3 > .ql-ui::before { content: counter(list-3, decimal) ". "; }

.ub-rich-text li[data-list].ql-indent-4 { counter-set: list-5 list-6 list-7 list-8 list-9; }
.ub-rich-text li[data-list="ordered"].ql-indent-4 { counter-increment: list-4; }
.ub-rich-text li[data-list="ordered"].ql-indent-4 > .ql-ui::before { content: counter(list-4, lower-alpha) ". "; }

.ub-rich-text li[data-list].ql-indent-5 { counter-set: list-6 list-7 list-8 list-9; }
.ub-rich-text li[data-list="ordered"].ql-indent-5 { counter-increment: list-5; }
.ub-rich-text li[data-list="ordered"].ql-indent-5 > .ql-ui::before { content: counter(list-5, lower-roman) ". "; }

.ub-rich-text li[data-list].ql-indent-6 { counter-set: list-7 list-8 list-9; }
.ub-rich-text li[data-list="ordered"].ql-indent-6 { counter-increment: list-6; }
.ub-rich-text li[data-list="ordered"].ql-indent-6 > .ql-ui::before { content: counter(list-6, decimal) ". "; }

.ub-rich-text li[data-list].ql-indent-7 { counter-set: list-8 list-9; }
.ub-rich-text li[data-list="ordered"].ql-indent-7 { counter-increment: list-7; }
.ub-rich-text li[data-list="ordered"].ql-indent-7 > .ql-ui::before { content: counter(list-7, lower-alpha) ". "; }

.ub-rich-text li[data-list].ql-indent-8 { counter-set: list-9; }
.ub-rich-text li[data-list="ordered"].ql-indent-8 { counter-increment: list-8; }
.ub-rich-text li[data-list="ordered"].ql-indent-8 > .ql-ui::before { content: counter(list-8, lower-roman) ". "; }

/* Indent levels (lists and paragraphs). */
.ub-rich-text .ql-indent-1 { padding-left: 3em; }
.ub-rich-text .ql-indent-2 { padding-left: 6em; }
.ub-rich-text .ql-indent-3 { padding-left: 9em; }
.ub-rich-text .ql-indent-4 { padding-left: 12em; }
.ub-rich-text .ql-indent-5 { padding-left: 15em; }
.ub-rich-text .ql-indent-6 { padding-left: 18em; }
.ub-rich-text .ql-indent-7 { padding-left: 21em; }
.ub-rich-text .ql-indent-8 { padding-left: 24em; }
.ub-rich-text li[data-list].ql-indent-1 { padding-left: 4.5em; }
.ub-rich-text li[data-list].ql-indent-2 { padding-left: 7.5em; }
.ub-rich-text li[data-list].ql-indent-3 { padding-left: 10.5em; }
.ub-rich-text li[data-list].ql-indent-4 { padding-left: 13.5em; }
.ub-rich-text li[data-list].ql-indent-5 { padding-left: 16.5em; }
.ub-rich-text li[data-list].ql-indent-6 { padding-left: 19.5em; }
.ub-rich-text li[data-list].ql-indent-7 { padding-left: 22.5em; }
.ub-rich-text li[data-list].ql-indent-8 { padding-left: 25.5em; }

/* Phones: deep indents would push text off screen; use a smaller step. */
@media (max-width: 575.98px) {
    .ub-rich-text .ql-indent-1 { padding-left: 1.5em; }
    .ub-rich-text .ql-indent-2 { padding-left: 3em; }
    .ub-rich-text .ql-indent-3 { padding-left: 4.5em; }
    .ub-rich-text .ql-indent-4,
    .ub-rich-text .ql-indent-5,
    .ub-rich-text .ql-indent-6,
    .ub-rich-text .ql-indent-7,
    .ub-rich-text .ql-indent-8 { padding-left: 6em; }
    .ub-rich-text li[data-list].ql-indent-1 { padding-left: 3em; }
    .ub-rich-text li[data-list].ql-indent-2 { padding-left: 4.5em; }
    .ub-rich-text li[data-list].ql-indent-3 { padding-left: 6em; }
    .ub-rich-text li[data-list].ql-indent-4,
    .ub-rich-text li[data-list].ql-indent-5,
    .ub-rich-text li[data-list].ql-indent-6,
    .ub-rich-text li[data-list].ql-indent-7,
    .ub-rich-text li[data-list].ql-indent-8 { padding-left: 7.5em; }
}

/* Alignment set in the editor. */
.ub-rich-text .ql-align-center { text-align: center; }
.ub-rich-text .ql-align-right { text-align: right; }
.ub-rich-text .ql-align-justify { text-align: justify; }
