/* ==========================================================================
   THE DESCRIPTION'S CONTENTS (pdp-toc.js): the store blog's contents button and sheet
   (blog.less, .tc-tocfab / .tc-tocsheet) on the product page. A round white button at the
   left (the chat button keeps the right), a ring in the store's colour for how far the reader
   is; the list a sheet from the bottom on a phone, a side panel on a wide screen. One text
   size, the section being read set apart by weight and a soft fill.
   ========================================================================== */
.tc-pdptoc-fab {
    position: fixed;
    left: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 980;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 0 0 .5px rgba(0, 0, 0, .08), 0 4px 16px rgba(0, 0, 0, .12);
    color: #1F2430;
    cursor: pointer;
    opacity: 0;
    transform: scale(.8);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

/* a phone reading the text in the product sheet (_PdpmSheets, z-index 2000): over the sheet, low at the left */
.tc-pdptoc-fab--sheet {
    z-index: 2010;
    bottom: calc(20px + env(safe-area-inset-bottom));
}

.tc-pdptoc-fab.is-shown {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.tc-pdptoc-fab.is-shown:active {
    transform: scale(.94);
}

.tc-pdptoc-fab:focus-visible {
    outline: 2px solid #1F2430;
    outline-offset: 3px;
}

@media (min-width: 960px) {
    .tc-pdptoc-fab {
        left: 28px;
        bottom: 28px;
    }
}

.tc-pdptoc-fab__icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.tc-pdptoc-fab__ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg) scaleY(-1);
    pointer-events: none;
}

.tc-pdptoc-fab__ring circle {
    fill: none;
    stroke: var(--tc-pdptoc-accent, #1F2430);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: calc(var(--tc-done, 0) * 1) 100;
    transition: stroke-dasharray .2s;
}

.tc-pdptoc {
    position: fixed;
    inset: 0;
    z-index: 2020;
    visibility: hidden;
    transition: visibility 0s .3s;
}

.tc-pdptoc.is-open {
    visibility: visible;
    transition: none;
}

.tc-pdptoc__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 21, 28, .45);
    opacity: 0;
    transition: opacity .25s;
}

.tc-pdptoc.is-open .tc-pdptoc__backdrop {
    opacity: 1;
}

.tc-pdptoc__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    max-height: 72vh;
    padding: 6px 0 calc(12px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    background: #FFF;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .12);
    direction: rtl;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.tc-pdptoc.is-open .tc-pdptoc__panel {
    transform: none;
}

/* a wide screen: a panel at the left side, over the page */
@media (min-width: 960px) {
    .tc-pdptoc__panel {
        top: 0;
        right: auto;
        width: 360px;
        max-height: none;
        padding-bottom: 12px;
        border-radius: 0 20px 20px 0;
        box-shadow: 8px 0 32px rgba(0, 0, 0, .12);
        transform: translateX(-100%);
    }
}

.tc-pdptoc__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px 12px 12px;
    border-bottom: 1px solid #EDF0F4;
}

.tc-pdptoc__title {
    margin: 0;
    color: #141A23;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
}

.tc-pdptoc__count {
    color: #6B7380;
    font-size: 15px;
}

.tc-pdptoc__close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #F3F4F6;
    color: #141A23;
    cursor: pointer;
}

.tc-pdptoc__close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.tc-pdptoc__list {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 12px 4px;
}

.tc-pdptoc__list ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: tc-desc;
}

.tc-pdptoc__list a {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #3A4250;
    font-size: 15px;
    line-height: 1.8;
    text-decoration: none;
}

.tc-pdptoc__list a:hover {
    color: #141A23;
}

.tc-pdptoc__list a.is-active {
    background: #F3F4F6;
    color: #141A23;
    font-weight: 600;
}

.tc-pdptoc__list li:not(.tc-pdptoc__sub) > a::before {
    counter-increment: tc-desc;
    content: counter(tc-desc, persian);
    flex: none;
    min-width: 18px;
    color: #8A94A3;
    font-weight: 600;
}

.tc-pdptoc__list a.is-active::before {
    color: var(--tc-pdptoc-accent, #1F2430);
}

.tc-pdptoc__list .tc-pdptoc__sub a {
    padding-right: 42px;
    color: #6B7380;
}

@media (prefers-reduced-motion: reduce) {
    .tc-pdptoc-fab,
    .tc-pdptoc__panel,
    .tc-pdptoc__backdrop {
        transition: none;
    }
}

@media print {
    .tc-pdptoc-fab,
    .tc-pdptoc {
        display: none;
    }
}
