/* GemOtvet — единое оформление экранов подбора.
   Подключается только на трёх страницах выбора; бизнес-логика не меняется. */

.selection-page {
    --selection-green: #064d40;
    --selection-green-hover: #0b6655;
    --selection-mint: #e5f0eb;
    --selection-cream: #fbfaf6;
    --selection-gold: #b7a27a;
    --selection-ink: #183b35;
    --selection-muted: #66736f;
    --selection-border: #d9e3de;
    width: min(100% - 2rem, 1320px);
    margin: 1.75rem auto 4rem;
    color: var(--selection-ink);
}

.selection-breadcrumb .breadcrumb {
    margin-bottom: 1.8rem;
    font-size: .9rem;
}

.selection-breadcrumb .breadcrumb a {
    color: var(--selection-green);
    text-underline-offset: 3px;
}

.selection-breadcrumb .breadcrumb-item.active {
    color: var(--selection-muted);
}

.selection-heading {
    margin-bottom: 2.25rem;
}

.selection-heading .eyebrow {
    margin: 0 0 .55rem;
    color: #8b7955;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
}

.selection-heading h1 {
    margin: 0;
    color: var(--selection-green);
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(2rem, 4vw, 3.15rem);
    font-weight: 500;
    line-height: 1.12;
}

.selection-description {
    max-width: 720px;
    margin: .75rem 0 0;
    color: var(--selection-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.selection-search-note {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    margin: 0 0 2rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--selection-border);
    border-left: 3px solid var(--selection-gold);
    border-radius: 8px;
    background: #fff;
}

.selection-search-note__icon {
    color: var(--selection-green);
    font-size: 1.6rem;
    line-height: 1;
}

.selection-search-note strong {
    color: var(--selection-green);
}

.selection-search-note p {
    margin: .2rem 0 0;
    color: var(--selection-muted);
    font-size: .9rem;
}

.selection-section {
    margin-top: 2.4rem;
}

.selection-section__heading {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    margin-bottom: 1.2rem;
}

.selection-section__step {
    display: inline-flex;
    flex: 0 0 2.15rem;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid #c9d9d2;
    border-radius: 50%;
    color: var(--selection-green);
    font-size: .75rem;
    font-weight: 700;
}

.selection-section__heading h2 {
    margin: 0;
    color: var(--selection-green);
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
    font-weight: 500;
}

.selection-section__heading p {
    margin: .25rem 0 0;
    color: var(--selection-muted);
    font-size: .9rem;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .7rem;
}

.color-card-label,
.shape-card-label,
.shape-card-link,
.stone-type-card {
    position: relative;
    min-width: 0;
    border: 1px solid var(--selection-border);
    border-radius: 9px;
    background: #fff;
    color: var(--selection-ink);
    box-shadow: 0 2px 7px rgb(14 55 45 / 4%);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}

.color-card-label {
    display: flex;
    min-height: 88px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .8rem .6rem;
    cursor: pointer;
    text-align: center;
}

.color-card-label:hover,
.shape-card-label:hover,
.shape-card-link:hover,
.stone-type-card:hover {
    transform: translateY(-2px);
    border-color: #9bb9ad;
    color: var(--selection-green);
    box-shadow: 0 8px 20px rgb(14 55 45 / 9%);
}

.color-radio-hidden,
.shape-radio-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.color-indicator {
    display: block;
    width: 30px;
    height: 30px;
    border: 2px solid rgb(15 49 42 / 12%);
    border-radius: 50%;
    box-shadow: inset 0 1px 3px rgb(0 0 0 / 8%);
}

.color-card-label__name,
.shape-card-label__name {
    color: inherit;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.35;
}

.color-card-label:has(.color-radio-hidden:checked),
.shape-card-label:has(.shape-radio-hidden:checked) {
    border-color: var(--selection-green);
    background: var(--selection-mint);
    box-shadow: 0 0 0 2px rgb(6 77 64 / 8%);
}

.color-card-label:has(.color-radio-hidden:checked)::after,
.shape-card-label:has(.shape-radio-hidden:checked)::after {
    position: absolute;
    top: .45rem;
    right: .55rem;
    color: var(--selection-green);
    content: "✓";
    font-size: .85rem;
    font-weight: 700;
}

.color-card-label:focus-within,
.shape-card-label:focus-within,
.shape-card-link:focus-visible,
.stone-type-card:focus-visible,
.selection-button:focus-visible,
.selection-home-link:focus-visible {
    outline: 3px solid rgb(183 162 122 / 65%);
    outline-offset: 3px;
}

.shape-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .9rem;
}

.shape-card-label,
.shape-card-link {
    display: flex;
    min-height: 174px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: .8rem .75rem .95rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.shape-img-container {
    display: flex;
    width: 100%;
    height: 112px;
    align-items: center;
    justify-content: center;
    margin-bottom: .65rem;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #fbfcfa 100%);
}

.shape-img-container img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .2s ease;
}

.shape-card-label:hover .shape-img-container img,
.shape-card-link:hover .shape-img-container img {
    transform: scale(1.05);
}

.shape-card-label__name {
    display: block;
    margin-top: auto;
}

.shape-card-link__arrow {
    position: absolute;
    right: .65rem;
    bottom: .55rem;
    color: var(--selection-gold);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
}

.shape-card-link:hover .shape-card-link__arrow {
    transform: translateX(2px);
    opacity: 1;
}

.selection-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--selection-border);
}

.selection-actions--standalone {
    margin-top: 2.5rem;
}

.selection-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    padding: .7rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.selection-button--primary {
    border-color: var(--selection-green);
    background: var(--selection-green);
    color: #fff;
}

.selection-button--primary:hover {
    border-color: var(--selection-green-hover);
    background: var(--selection-green-hover);
    color: #fff;
    transform: translateY(-1px);
}

.selection-button--secondary {
    border-color: #aabdb5;
    background: transparent;
    color: var(--selection-green);
}

.selection-button--secondary:hover {
    border-color: var(--selection-green);
    background: var(--selection-mint);
    color: var(--selection-green);
}

.selection-home-link {
    margin-left: .25rem;
    padding: .5rem .3rem;
    color: var(--selection-muted);
    font-size: .92rem;
    text-decoration: none;
}

.selection-home-link:hover {
    color: var(--selection-green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.stone-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
    gap: .85rem;
}

.stone-type-card {
    display: flex;
    min-height: 92px;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.25rem;
    text-decoration: none;
}

.stone-type-card__index {
    color: var(--selection-gold);
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.1rem;
}

.stone-type-card__name {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

.stone-type-card__arrow {
    color: var(--selection-green);
    font-size: 1.2rem;
    transition: transform .18s ease;
}

.stone-type-card:hover .stone-type-card__arrow {
    transform: translateX(3px);
}

.selection-empty {
    color: var(--selection-muted);
}

.color-bg-colorless {
    background-color: #fff;
    background-image: linear-gradient(45deg, #e7ece9 25%, transparent 25%), linear-gradient(-45deg, #e7ece9 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e7ece9 75%), linear-gradient(-45deg, transparent 75%, #e7ece9 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}
.color-bg-yellow { background-color: #fff1bf; border-color: #f2dc8b; }
.color-bg-pink { background-color: #f3cbd0; border-color: #eab0b8; }
.color-bg-blue { background-color: #bfeaf1; border-color: #9adbe5; }
.color-bg-green { background-color: #c5ded4; border-color: #a8cbbb; }
.color-bg-red { background-color: #d83a4b; border-color: #bd2637; }
.color-bg-purple { background-color: #d9cbea; border-color: #c2b0dc; }
.color-bg-black { background-color: #292e30; border-color: #111719; }

@media (max-width: 991.98px) {
    .shape-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .selection-page { width: min(100% - 1.5rem, 1320px); }
}

@media (max-width: 767.98px) {
    .selection-page { margin-top: 1.2rem; margin-bottom: 2.5rem; }
    .selection-heading { margin-bottom: 1.7rem; }
    .shape-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
    .shape-card-label, .shape-card-link { min-height: 150px; padding: .6rem; }
    .shape-img-container { height: 92px; }
    .selection-section { margin-top: 1.8rem; }
}

@media (max-width: 479.98px) {
    .shape-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .color-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .selection-actions { align-items: stretch; flex-direction: column; }
    .selection-button { width: 100%; }
    .selection-home-link { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
    .selection-page *,
    .selection-page *::before,
    .selection-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* Progressive disclosure: show the shape step after a color is selected. */
.selection-step-hint {
    margin: .8rem 0 0;
    color: var(--selection-muted);
    font-size: .88rem;
}

.selection-reveal {
    max-height: 1200px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height .25s ease, opacity .2s ease, transform .25s ease, margin .25s ease;
}

.selection-reveal.is-collapsed {
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.selection-reveal--no-transition {
    transition: none !important;
}

.selection-step-hint[hidden] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .selection-reveal {
        transition: none;
    }
}
