/* Home selections: independent of catalog card geometry. */
.hero-image.hero-carousel {
    display: flex;
    flex-direction: column;
    padding: 24px;
    justify-content: center;
}
.hero-stage {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    height: 540px;
}
.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 450ms ease;
}
.hero-slide.is-current {
    opacity: 1;
    pointer-events: auto;
}
.hero-carousel .hero-slide img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: none;
}
.hero-controls {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
}
.hero-controls[hidden] {
    /* Reserve the same space before JavaScript enables the controls. */
    display: grid;
    visibility: hidden;
}
.carousel-control {
    min-height: 44px;
    border: 1px solid #c9cfc5;
    background: transparent;
    color: #263e32;
    padding: 8px;
    cursor: pointer;
    font: inherit;
}
.carousel-control:hover {
    background: #e9ebe2;
}
.hero-counter {
    text-align: center;
    font-size: 13px;
}
.hero-dots {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}
.hero-dot {
    width: 32px;
    height: 32px;
    padding: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.hero-dot::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #536957;
    background: transparent;
}
.hero-dot[aria-current="true"]::after {
    background: #263e32;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
.home-editors {
    display: grid;
    gap: 32px;
}
.home-editor {
    border: 1px solid #d6d9d0;
    padding: 24px;
    min-width: 0;
}
.home-count {
    font-weight: 600;
}
.home-selected {
    padding: 0;
    list-style: none;
}
.home-selection-row,
.home-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #e1e3dc;
}
.home-selection-row img,
.home-result img {
    width: 64px;
    height: 72px;
    object-fit: contain;
    background: white;
}
.home-item-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}
.home-item-name small {
    display: block;
    color: #687168;
}
.home-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.home-row-actions button,
.home-result button {
    min-height: 44px;
    padding: 8px 12px;
    background: #f5f6f0;
    border: 1px solid #c9cfc5;
    color: #263e32;
    cursor: pointer;
}
.home-results {
    margin-bottom: 24px;
}
@media (max-width: 680px) {
    .hero-image.hero-carousel {
        padding: 16px;
        max-height: none;
    }
    .hero-stage {
        height: 380px;
    }
    .home-editor {
        padding: 16px;
    }
    .home-selection-row {
        flex-wrap: wrap;
    }
    .home-row-actions {
        width: 100%;
    }
    .home-result {
        flex-wrap: wrap;
    }
    .home-editor > .button {
        width: 100%;
        white-space: normal;
    }
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: none;
    }
}

/* Fixed filter slots keep cards stable when collections or scrollbars appear. */
.collection-nav,
.enamel-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 9px;
    box-sizing: border-box;
    height: 64px;
    min-height: 64px;
    margin: 0 0 8px;
    padding: 4px 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.enamel-nav {
    margin-bottom: 24px;
}
.collection-nav > span,
.enamel-nav > span {
    color: var(--muted);
    font-size: .875rem;
    min-width: 82px;
    margin-right: 0;
    flex-shrink: 0;
}
.collection-nav .chip,
.enamel-nav .chip {
    font-size: .875rem;
    white-space: nowrap;
    border-color: transparent;
    flex-shrink: 0;
}
.collection-nav-empty > span {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.4;
    white-space: normal;
}

.enamel-nav .chip.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}
.enamel-nav .chip[aria-disabled="true"] {
    cursor: default;
}
.enamel-nav .chip.is-loading {
    background: #e2e8dc;
    color: var(--ink);
    border-color: var(--green);
    box-shadow: inset 0 -3px 0 var(--green);
    cursor: progress;
}

/* Личный кабинет и история заказов */
.account-page {
    max-width: 900px;
    margin-inline: auto;
    padding-block: 48px 64px;
}

.account-page > .panel {
    margin: 24px 0 32px;
}

.account-orders .panel {
    margin: 0;
    padding: 24px;
}

.account-orders {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-block: 24px;
}

.account-order-summary h3,
.account-order-item h2 {
    overflow-wrap: anywhere;
}

.account-order-summary p,
.account-order-item p,
.account-page > .panel p {
    overflow-wrap: anywhere;
}

.catalog-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-block: 32px;
}

@media (max-width: 680px) {
    .account-orders {
        grid-template-columns: 1fr;
    }

    .account-page {
        padding-block: 32px 48px;
    }

    .site-header > .container {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-header .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .site-account {
        grid-column: 1;
        grid-row: 3;
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid var(--line);
    }
}
