/* ============================================================
   Guides — index page (redesign)
   Scoped to .storefront-autoreg, tokens from autoreg-theme.css,
   motion vars from mod/css/main.css (--dm-reveal-*).
   ============================================================ */

.storefront-autoreg .guides-page {
    padding: 30px 0 80px;
    background: var(--autoreg-bg);
}

.storefront-autoreg .guides-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 26px;
    color: var(--autoreg-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.storefront-autoreg .guides-breadcrumb a {
    color: inherit;
}

.storefront-autoreg .guides-breadcrumb a:hover {
    color: var(--autoreg-text);
}

.storefront-autoreg .guides-layout {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.storefront-autoreg .guides-main {
    min-width: 0;
}

/* ---------- Sidebar ---------- */

.storefront-autoreg .guides-aside {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.storefront-autoreg .guides-search {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--autoreg-border);
    border-radius: var(--autoreg-radius-m);
    background: var(--autoreg-surface);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.storefront-autoreg .guides-search:focus-within {
    border-color: rgba(143, 244, 81, 0.45);
    box-shadow: 0 0 0 3px var(--autoreg-focus-ring);
}

.storefront-autoreg .guides-search i {
    font-size: 13px;
    color: #9b9b9b;
    transform: scale(1);
    transform-origin: center;
    transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.storefront-autoreg .guides-search.is-searching i {
    color: #5a9e2d;
    animation: guides-search-pulse 560ms ease-in-out infinite alternate;
}

.storefront-autoreg .guides-search input {
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--autoreg-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
}

.storefront-autoreg .guides-nav__label {
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8ebee;
    color: var(--autoreg-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
}

.storefront-autoreg .guides-nav__list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.storefront-autoreg .guides-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 -10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.storefront-autoreg .guides-nav__item:hover {
    box-shadow: inset 0 0 0 999px rgba(17, 17, 17, 0.035);
    color: var(--autoreg-text);
}

.storefront-autoreg .guides-nav__item.is-active {
    background: var(--autoreg-accent-tint);
    color: #143a07;
    font-weight: 800;
}

.storefront-autoreg .guides-nav__item--divide {
    margin-bottom: 9px;
}

.storefront-autoreg .guides-nav__icon {
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f4f6f9;
}

.storefront-autoreg .guides-nav__item.is-active .guides-nav__icon {
    background: var(--autoreg-surface);
}

.storefront-autoreg .guides-nav__icon img {
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.storefront-autoreg .guides-nav__icon i {
    font-size: 13px;
    color: #143a07;
}

.storefront-autoreg .guides-nav__title {
    flex: 1 1 auto;
    min-width: 0;
}

.storefront-autoreg .guides-nav__count {
    color: #b4bcc7;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.storefront-autoreg .guides-nav__item.is-active .guides-nav__count {
    color: #143a07;
    font-weight: 800;
}

.storefront-autoreg .guides-support {
    padding-top: 20px;
    border-top: 1px solid #e8ebee;
}

.storefront-autoreg .guides-support__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.storefront-autoreg .guides-support__text {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
}

.storefront-autoreg .guides-support__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    margin-top: 14px;
    padding: 0 16px;
    border-radius: var(--autoreg-radius-m);
    background: var(--autoreg-accent);
    color: #000;
    font-size: 13px;
    font-weight: 700;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.storefront-autoreg .guides-support__btn:hover {
    background: var(--autoreg-accent-soft);
    color: #000;
    transform: translateY(-1px);
}

.storefront-autoreg .guides-support__btn i {
    font-size: 11px;
}

/* ---------- Page head ---------- */

.storefront-autoreg .guides-head {
    padding-bottom: 26px;
    border-bottom: 1px solid #eef0f3;
}

.storefront-autoreg .guides-head h1 {
    max-width: 26ch;
    margin: 0;
    font-size: clamp(28px, 2.8vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.16;
}

.storefront-autoreg .guides-head p {
    max-width: 70ch;
    margin: 14px 0 0;
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    text-wrap: pretty;
}

/* ---------- Section head ---------- */

.storefront-autoreg .guides-section {
    padding-top: 32px;
}

.storefront-autoreg .guides-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 4px;
}

.storefront-autoreg .guides-section__title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.storefront-autoreg .guides-section__title h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.storefront-autoreg .guides-section__icon {
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--autoreg-radius-m);
    background: #f4f6f9;
}

.storefront-autoreg .guides-section__icon img {
    width: 19px;
    height: 19px;
    object-fit: contain;
}

.storefront-autoreg .guides-section__count {
    color: var(--autoreg-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.storefront-autoreg .guides-section__note {
    max-width: 74ch;
    margin: 0 0 6px;
    color: var(--autoreg-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
}

/* ---------- List ---------- */

.storefront-autoreg .guides-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.storefront-autoreg .guide-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    padding: 24px 26px;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    background: var(--autoreg-surface);
    color: inherit;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.storefront-autoreg .guide-row--has-thumb {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.storefront-autoreg .guide-row__thumb {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: var(--autoreg-radius-m);
    background: #f5f5f5;
    object-fit: cover;
    object-position: center;
    transition: transform 0.16s ease, background-color 0.16s ease;
}

.storefront-autoreg .guide-row:hover .guide-row__thumb,
.storefront-autoreg .guide-row:focus-visible .guide-row__thumb {
    transform: scale(1.04);
    background: var(--autoreg-accent-tint);
}

.storefront-autoreg .guide-row__thumb[hidden] {
    display: none !important;
}

.storefront-autoreg .guide-row__content {
    min-width: 0;
}

.storefront-autoreg .guide-row[hidden],
.storefront-autoreg .guides-empty[hidden],
.storefront-autoreg .guides-section__icon[hidden] {
    display: none;
}

.storefront-autoreg .guides-nav__item:focus-visible,
.storefront-autoreg .guides-support__btn:focus-visible,
.storefront-autoreg .guide-row:focus-visible {
    outline: 3px solid var(--autoreg-focus-ring);
    outline-offset: 2px;
}

.storefront-autoreg .guide-row:hover {
    border-color: #c9e9ab;
    background: #fcfffa;
    box-shadow: inset 3px 0 0 var(--autoreg-accent);
}

.storefront-autoreg .guide-row__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--autoreg-muted);
    font-size: 12px;
    font-weight: 600;
}

.storefront-autoreg .guide-row__meta i {
    margin-right: 6px;
    font-size: 11px;
}

.storefront-autoreg .guide-row__dot {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: #dde3ea;
}

.storefront-autoreg .guide-row__date {
    color: #b4bcc7;
}

.storefront-autoreg .guide-row h3 {
    margin: 12px 0 0;
    color: var(--autoreg-text);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
    text-wrap: pretty;
}

.storefront-autoreg .guide-row p {
    max-width: 78ch;
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    text-wrap: pretty;
}

.storefront-autoreg .guide-row__tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.storefront-autoreg .guide-row__tag {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border: 1px solid #eef0f3;
    border-radius: var(--autoreg-radius-s);
    color: var(--autoreg-muted);
    font-size: 12px;
    font-weight: 600;
}

.storefront-autoreg .guide-row__go {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #f4f6f9;
    color: var(--autoreg-text);
    font-size: 13px;
    transition: background-color 0.16s ease;
}

.storefront-autoreg .guide-row:hover .guide-row__go {
    background: var(--autoreg-accent);
}

.storefront-autoreg .guides-empty {
    padding: 56px 0;
    border-bottom: 1px solid #e8ebee;
    text-align: center;
}

.storefront-autoreg .guides-empty p:first-child {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.storefront-autoreg .guides-empty p + p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

/* ---------- Motion (mirrors mod/css/main.css) ---------- */

.storefront-autoreg .guides-content {
    --dm-reveal-dur: 220ms;
    --dm-reveal-distance: 8px;
    --dm-reveal-blur: 3px;
}

.storefront-autoreg .guides-content.is-switching {
    pointer-events: none;
}

.storefront-autoreg .guides-section.is-resizing {
    transition: height 320ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: height;
}

@keyframes guides-document-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

html.dm-guides-enter body {
    animation: guides-document-enter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes guides-search-pulse {
    from {
        opacity: 0.48;
        transform: scale(0.88);
    }

    to {
        opacity: 1;
        transform: scale(1.08);
    }
}

/* Cascade replays on every switch: JS re-adds .is-entering and sets --dm-stagger
   per VISIBLE row (hidden rows are skipped, so nth-child can't be trusted).
   The nth-child rules below are only the no-JS / first-paint fallback. */
html.dm-guides-enter .storefront-autoreg .guides-list > *:not([hidden]),
.storefront-autoreg .guides-list.is-entering > *:not([hidden]) {
    animation: dm-motion-item-enter var(--dm-reveal-dur, 220ms) var(--dm-reveal-ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
    animation-delay: var(--dm-stagger, 0ms);
}

html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(2),
.storefront-autoreg .guides-list.is-entering > *:nth-child(2) { --dm-stagger: 30ms; }
html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(3),
.storefront-autoreg .guides-list.is-entering > *:nth-child(3) { --dm-stagger: 60ms; }
html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(4),
.storefront-autoreg .guides-list.is-entering > *:nth-child(4) { --dm-stagger: 90ms; }
html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(5),
.storefront-autoreg .guides-list.is-entering > *:nth-child(5) { --dm-stagger: 120ms; }
html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(6),
.storefront-autoreg .guides-list.is-entering > *:nth-child(6) { --dm-stagger: 150ms; }
html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(7),
.storefront-autoreg .guides-list.is-entering > *:nth-child(7) { --dm-stagger: 180ms; }
html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(8),
.storefront-autoreg .guides-list.is-entering > *:nth-child(8) { --dm-stagger: 210ms; }
html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(9),
.storefront-autoreg .guides-list.is-entering > *:nth-child(9) { --dm-stagger: 240ms; }
html.dm-guides-enter .storefront-autoreg .guides-list > *:nth-child(n + 10),
.storefront-autoreg .guides-list.is-entering > *:nth-child(n + 10) { --dm-stagger: 270ms; }

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
    .storefront-autoreg .guides-layout {
        gap: 32px;
        grid-template-columns: 228px minmax(0, 1fr);
    }
}

@media (max-width: 991px) {
    .storefront-autoreg .guides-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 26px;
    }

    .storefront-autoreg .guides-aside {
        position: static;
        top: auto;
    }

    .storefront-autoreg .guides-nav__list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .storefront-autoreg .guides-nav__item {
        width: auto;
        margin: 0;
        border: 1px solid #eef0f3;
        border-radius: 999px;
    }

    .storefront-autoreg .guides-nav__item--divide {
        margin-bottom: 0;
    }
}

@media (max-width: 575px) {
    .storefront-autoreg .guide-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 20px;
    }

    .storefront-autoreg .guide-row h3 {
        font-size: 17px;
    }

    .storefront-autoreg .guide-row__go {
        justify-self: start;
    }

    .storefront-autoreg .guide-row--has-thumb {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 18px;
    }

    .storefront-autoreg .guide-row__thumb {
        width: 56px;
        height: 56px;
        border-radius: var(--autoreg-radius-s);
    }

    .storefront-autoreg .guide-row--has-thumb .guide-row__go {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .storefront-autoreg .guides-search.is-searching i,
    html.dm-guides-enter .storefront-autoreg .guides-list > *,
    .storefront-autoreg .guides-list.is-entering > *,
    .storefront-autoreg .guides-content,
    .storefront-autoreg .guides-section.is-resizing,
    html.dm-guides-enter body {
        animation: none !important;
        transition: none !important;
        filter: none !important;
        transform: none !important;
    }

    .storefront-autoreg .guide-row__thumb {
        transition: none;
    }

    .storefront-autoreg .guide-row:hover .guide-row__thumb,
    .storefront-autoreg .guide-row:focus-visible .guide-row__thumb {
        transform: none;
    }
}

/* The storefront theme exposes dark tokens globally; these overrides keep the
   supplied light design's dividers and secondary surfaces legible in dark mode. */
[data-theme="dark"] .storefront-autoreg .guides-nav__label,
[data-theme="dark"] .storefront-autoreg .guides-support,
[data-theme="dark"] .storefront-autoreg .guides-head,
[data-theme="dark"] .storefront-autoreg .guides-empty {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .storefront-autoreg .guides-nav__item {
    color: #d6dbe3;
}

[data-theme="dark"] .storefront-autoreg .guides-nav__item:hover {
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.05);
    color: #fff;
}

[data-theme="dark"] .storefront-autoreg .guides-nav__item.is-active,
[data-theme="dark"] .storefront-autoreg .guides-nav__item.is-active .guides-nav__count,
[data-theme="dark"] .storefront-autoreg .guides-nav__icon i {
    color: #dfffd0;
}

[data-theme="dark"] .storefront-autoreg .guides-search.is-searching i {
    color: #8ff451;
}

[data-theme="dark"] .storefront-autoreg .guides-nav__icon,
[data-theme="dark"] .storefront-autoreg .guides-section__icon,
[data-theme="dark"] .storefront-autoreg .guide-row__go {
    background: #343434;
}

[data-theme="dark"] .storefront-autoreg .guides-nav__item.is-active .guides-nav__icon {
    background: #3a3a3a;
}

[data-theme="dark"] .storefront-autoreg .guides-support__text,
[data-theme="dark"] .storefront-autoreg .guides-head p,
[data-theme="dark"] .storefront-autoreg .guide-row p {
    color: #b8c0cc;
}

[data-theme="dark"] .storefront-autoreg .guide-row {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .storefront-autoreg .guide-row:hover {
    border-color: rgba(143, 244, 81, 0.45);
    background: #2d332b;
}

[data-theme="dark"] .storefront-autoreg .guide-row__dot {
    background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .storefront-autoreg .guide-row__thumb {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .storefront-autoreg .guide-row:hover .guide-row__thumb,
[data-theme="dark"] .storefront-autoreg .guide-row:focus-visible .guide-row__thumb {
    background: rgba(143, 244, 81, 0.14);
}
