/* ============================================================================
 *  Готовые наборы на витрине — карточки + модалка состава.
 *  Токены проекта (--brand, --milk, --text, --border …), mobile-first.
 * ==========================================================================*/

/* ---- сетка карточек ---- */
.rk-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 12px;
    scrollbar-width: thin;
}
.rk-grid::-webkit-scrollbar { height: 8px; }
.rk-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 8px; }

@media (min-width: 900px) {
    .rk-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        overflow: visible;
    }
}

/* ---- карточка ---- */
.rk-card {
    flex: 0 0 210px;
    scroll-snap-align: start;
    background: var(--white, #fff);
    border: 1px solid var(--border-light, #F2EFEB);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
@media (min-width: 900px) { .rk-card { flex: initial; } }
.rk-card:hover,
.rk-card:focus-visible {
    box-shadow: 0 10px 28px rgba(255,51,204,.13);
    border-color: var(--brand-ring, rgba(255,51,204,.22));
    transform: translateY(-2px);
    outline: none;
}
.rk-card--out { opacity: .62; }

.rk-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--cream, #F5F3F0);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rk-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rk-card__ph { font-size: 44px; opacity: .45; }

.rk-card__badge {
    position: absolute; top: 10px; left: 10px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 700; color: var(--white, #fff);
    background: var(--brand, #FF33CC);
}
.rk-card__badge--new { background: var(--success, #2D6B3F); }
.rk-card__badge--sale { background: var(--sale, #8B4513); }

.rk-card__body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 4px; }
.rk-card__title {
    font-size: 14.5px; font-weight: 700; line-height: 1.3;
    color: var(--graphite, #1A1A1A); margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rk-card__count { font-size: 12px; color: var(--text-3, #999); margin: 0; }
.rk-card__prices { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-top: 2px; }
.rk-card__price { font-size: 16px; font-weight: 800; color: var(--graphite, #1A1A1A); }
.rk-card__old { font-size: 12.5px; color: var(--text-3, #999); text-decoration: line-through; }
.rk-card__save { font-size: 12px; font-weight: 600; color: var(--success, #2D6B3F); }
.rk-card__part { font-size: 12px; color: var(--sale, #8B4513); font-weight: 600; }
.rk-card__out { font-size: 12px; color: var(--danger, #B84040); font-weight: 600; }

/* ---- модалка состава ---- */
.rk-overlay {
    position: fixed; inset: 0; z-index: 9200;
    background: rgba(20,12,18,.68);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: rkFade .2s ease-out;
}
@keyframes rkFade { from { opacity: 0; } to { opacity: 1; } }

.rk-modal {
    position: relative;
    width: min(560px, 100%);
    max-height: min(88vh, 100%);
    background: var(--milk, #FAFAF8);
    border-radius: 18px;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.rk-modal__close {
    position: absolute; top: 10px; right: 12px; z-index: 2;
    width: 34px; height: 34px; border: none; border-radius: 50%;
    background: rgba(255,255,255,.9); color: var(--graphite, #1A1A1A);
    font-size: 24px; line-height: 1; cursor: pointer;
}
.rk-modal__close:hover { background: var(--white, #fff); }

.rk-modal__head {
    display: flex; gap: 14px; align-items: center;
    padding: 18px 54px 16px 18px;
    background: var(--white, #fff);
    border-bottom: 1px solid var(--border-light, #F2EFEB);
}
.rk-modal__img { width: 84px; height: 84px; flex: 0 0 84px; object-fit: cover; border-radius: 12px; }
.rk-modal__title { margin: 0; font-size: 18px; font-weight: 800; color: var(--graphite, #1A1A1A); }
.rk-modal__desc { margin: 5px 0 0; font-size: 13px; color: var(--text-2, #666); line-height: 1.45; }

.rk-items { list-style: none; margin: 0; padding: 10px 18px; overflow-y: auto; flex: 1; }
.rk-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-light, #F2EFEB);
}
.rk-item:last-child { border-bottom: none; }
.rk-item--out { opacity: .55; }
.rk-item img,
.rk-item__ph { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 8px; object-fit: cover; background: var(--cream, #F5F3F0); display: block; }
.rk-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rk-item__name { font-size: 13.5px; color: var(--text, #222); line-height: 1.3; }
.rk-item__meta { font-size: 11.5px; color: var(--text-3, #999); }
.rk-item__sum { font-size: 13px; font-weight: 700; color: var(--graphite, #1A1A1A); white-space: nowrap; }

.rk-modal__foot {
    padding: 14px 18px 16px;
    background: var(--white, #fff);
    border-top: 1px solid var(--border-light, #F2EFEB);
    display: flex; flex-direction: column; gap: 11px;
}
.rk-total { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.rk-total__was { font-size: 13.5px; color: var(--text-3, #999); text-decoration: line-through; }
.rk-total__now { font-size: 21px; font-weight: 800; color: var(--graphite, #1A1A1A); }
.rk-total__save { font-size: 12.5px; font-weight: 700; color: var(--success, #2D6B3F); }

.rk-btn {
    width: 100%; padding: 14px 18px;
    border: none; border-radius: 12px;
    background: var(--brand, #FF33CC); color: var(--white, #fff);
    font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
    transition: background .18s ease;
}
.rk-btn:hover:not(:disabled) { background: var(--brand-hover, #E81FB8); }
.rk-btn:disabled { background: var(--nude, #EDE7E0); color: var(--text-3, #999); cursor: not-allowed; }

/* ---- тост ---- */
.rk-toast {
    position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
    z-index: 9500;
    max-width: calc(100vw - 32px);
    padding: 12px 20px; border-radius: 12px;
    background: var(--graphite, #1A1A1A); color: var(--white, #fff);
    font-size: 13.5px; font-weight: 600;
    opacity: 0; pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}
.rk-toast--on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
    .rk-modal__head { padding: 16px 48px 14px 14px; }
    .rk-modal__img { width: 64px; height: 64px; flex: 0 0 64px; }
    .rk-modal__title { font-size: 16.5px; }
    .rk-items { padding: 8px 14px; }
    .rk-modal__foot { padding: 12px 14px 14px; }
}

/* ---- готовые наборы на экране приветствия конструктора ---- */
.kb-ready { display: grid; grid-template-columns: 1fr; gap: 10px; text-align: left; }
@media (min-width: 620px) { .kb-ready { grid-template-columns: 1fr 1fr; } }

.kb-ready__c {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 12px;
    background: var(--white, #fff);
    border: 1px solid var(--border, #EAE6E2);
    border-radius: 14px;
    cursor: pointer; font-family: inherit; text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.kb-ready__c:hover {
    border-color: var(--brand, #FF33CC);
    box-shadow: 0 8px 22px rgba(255,51,204,.14);
    transform: translateY(-1px);
}
.kb-ready__img {
    width: 54px; height: 54px; flex: 0 0 54px;
    border-radius: 10px; overflow: hidden;
    background: var(--cream, #F5F3F0);
    display: flex; align-items: center; justify-content: center;
}
.kb-ready__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-ready__ph { font-size: 24px; opacity: .5; }
.kb-ready__b { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kb-ready__b b {
    font-size: 14px; font-weight: 700; color: var(--graphite, #1A1A1A); line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-ready__b em { font-style: normal; font-size: 12px; color: var(--text-2, #666); }
