/* ── Summary / Buy-box ─────────────────────────────────────────── */

.mg-summary {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 26px;
    padding: 22px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
    position: sticky;
    top: 96px;
}

/* 1. Название */
.mg-summary__title {
    font-size: 32px;
    line-height: 1.12;
    letter-spacing: -.05em;
    margin: 0 0 10px;
}

/* 2. Код товара + статус наличия */
.mg-summary__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.mg-summary__sku {
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

.mg-summary__stock {
    font-size: 13px;
    font-weight: 800;
}

.mg-summary__stock--in {
    color: #15803d;
}

.mg-summary__stock--out {
    color: #b45309;
}

/* 3. Бейджи характеристик */
.mg-summary__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.mg-badge {
    height: 24px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    color: #374151;
    border-radius: 999px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.mg-badge--red {
    background: #f8eeee;
    border-color: rgba(130, 1, 0, .18);
    color: #820100;
}

.mg-badge--blue {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.mg-badge--default {
    background: #fff;
}

/* 4. Цена */
.mg-summary__price {
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -.04em;
    font-weight: 700;
    margin-bottom: 16px;
}

.mg-summary__price del {
    display: block;
    color: #9ca3af;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 4px;
}

.mg-summary__price ins {
    text-decoration: none;
}

.mg-summary__prices {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.mg-summary__prices > .mg-summary__price {
    margin-bottom: 0;
}

.mg-summary__price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
}

.mg-summary__price-row span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.mg-summary__price-row strong {
    color: #111827;
    font-size: 22px;
    line-height: 1;
    white-space: nowrap;
}

.mg-summary__price-row--partner {
    border-color: rgba(130, 1, 0, .22);
    background: #fff7f7;
}

.mg-summary__price-row--partner span,
.mg-summary__price-row--partner strong {
    color: #820100;
}

/* Короткое описание */
.mg-summary__short {
    margin-bottom: 14px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* 5. Форма покупки */
.mg-summary__buy {
    margin: 0 0 10px;
}

/* Количество */
.mg-summary__qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mg-summary__qty-label {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
}

.mg-qty {
    height: 36px;
    display: inline-flex;
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    overflow: hidden;
    background: #fff;
}

.mg-qty button {
    width: 32px;
    border: 0;
    background: #fff;
    color: #6b7280;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.mg-qty input {
    width: 46px;
    border: 0;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-weight: 850;
    font-size: 14px;
    outline: 0;
}

/* Кнопка В корзину — полная ширина */
.mg-summary__cart-btn {
    width: 100%;
    height: 52px;
    font-size: 15px;
    font-weight: 800;
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 7. Действия — 3 равные кнопки */
.mg-summary__actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.mg-summary__actions .mg-btn {
    height: 42px;
    padding: 0 6px;
    font-size: 13px;
}

.mg-summary__actions [data-mg-favorite-toggle],
.mg-summary__actions [data-mg-compare-toggle],
.mg-summary__actions a.compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 42px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    color: #111827;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.mg-summary__actions [data-mg-favorite-toggle]:hover,
.mg-summary__actions [data-mg-compare-toggle]:hover,
.mg-summary__actions a.compare:hover {
    border-color: rgba(130, 1, 0, .35);
    color: #820100;
}

.mg-summary__actions [data-mg-favorite-toggle].added,
.mg-summary__actions [data-mg-compare-toggle].added,
.mg-summary__actions a.compare.added {
    color: #820100;
    border-color: rgba(130, 1, 0, .4);
}

/* ── Кнопки общие ────────────────────────────────────────────────── */

.mg-btn {
    height: 42px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    border-radius: 13px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 750;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: .16s ease;
    text-decoration: none;
}

.mg-btn:hover {
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.mg-btn--primary {
    background: #820100;
    border-color: #820100;
    color: #fff;
    box-shadow: 0 10px 22px rgba(130, 1, 0, .14);
}

.mg-btn--primary:hover {
    background: #6f0100;
    border-color: #6f0100;
}

.mg-btn--soft {
    background: #f8eeee;
    border-color: rgba(130, 1, 0, .14);
    color: #820100;
}

/* ── Service icons ───────────────────────────────────────────────── */

.mg-product-services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
    padding: 16px 0px;
    border-top: 1px solid var(--line);
}

.mg-product-service {
    border-radius: 14px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mg-product-service__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #f8eeee;
    color: #820100;
    display: grid;
    place-items: center;
}

.mg-product-service__icon--blue {
    background: #eff6ff;
    color: #2563eb;
}

.mg-product-service__icon--grey {
    background: #f1f5f9;
    color: #475569;
}

.mg-product-service b {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
}

.mg-product-service small {
    display: block;
    color: #6b7280;
    font-size: 10px;
}

/* Доставка / Оплата */
.mg-product-compat-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

/* "Не уверены" — красная левая полоска */
.mg-product-compat {
    border: 1px solid #e5e7eb;
    border-left: 3px solid #820100;
    border-radius: 0 12px 12px 0;
    background: #fff;
    padding: 12px 14px;
}

.mg-product-compat b {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 4px;
}

.mg-product-compat p {
    margin: 0;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}

/* ── Legacy compat ─────────────────────────────────────────────── */
.mg-p-btn {
    height: 42px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    border-radius: 13px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
    transition: .16s ease;
    text-decoration: none;
}

.mg-p-btn:hover {
    border-color: #d1d5db;
}

.mg-p-btn--primary {
    background: #820100;
    border-color: #820100;
    color: #fff;
}

.mg-p-btn--soft {
    background: #f8eeee;
    border-color: rgba(130, 1, 0, .14);
    color: #820100;
}

.mg-p-icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 13px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #374151;
    transition: .15s ease;
}
