/* ═══════════════════════════════════════════════
   NBC Shop Cart — одностраничная корзина + оформление
   ═══════════════════════════════════════════════ */

:root {
    --sc-navy:    #1B2356;
    --sc-navy-2:  #0E1433;
    --sc-gold:    #C49953;
    --sc-gold-l:  #D5B480;
    --sc-cream:   #FAF6F0;
    --sc-cream-d: #F0E8DA;
    --sc-text:    #2A2A2A;
    --sc-muted:   #6B6B6B;
    --sc-border:  rgba(27,35,86,.12);
    --sc-tr:      .25s ease;
}

.nbc-sc {
    background: var(--sc-cream);
    min-height: 100vh;
    padding: 40px 24px 80px;
    font-family: 'Montserrat', sans-serif;
    color: var(--sc-text);
}
.nbc-sc, .nbc-sc *, .nbc-sc *::before, .nbc-sc *::after { box-sizing: border-box; }
.nbc-sc__wrap { max-width: 1240px; margin: 0 auto; }

.nbc-sc__back {
    display: inline-flex; align-items: center;
    font-size: 13px; color: var(--sc-muted);
    text-decoration: none; margin-bottom: 14px;
    transition: color var(--sc-tr);
}
.nbc-sc__back:hover { color: var(--sc-gold); }

.nbc-sc__title {
    font-family: 'Spectral', serif;
    font-weight: 400;
    font-size: 44px;
    color: var(--sc-navy);
    margin: 0 0 32px;
    line-height: 1.1;
}

/* ═══════════════ Grid ═══════════════ */

/* Атрибут [hidden] должен гарантированно прятать элементы,
   даже если они имеют display: grid / flex. */
.nbc-sc [hidden] { display: none !important; }

.nbc-sc__grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 32px;
    align-items: start;
}
.nbc-sc__grid[hidden] { display: none !important; }

/* Левая колонка: форма (контакты/реквизиты/доставка) сверху, товары под ней */
.nbc-sc__main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Три поля в строку (Имя-Телефон-Email, Компания-ИНН-КПП) */
.nbc-sc__row3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.nbc-sc__row3 .nbc-sc__field { margin-bottom: 0; }

/* Два поля в строку (Адрес-Комментарий на доставке) */
.nbc-sc__row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.nbc-sc__row2 .nbc-sc__field { margin-bottom: 0; }

/* Заголовок «Ваш заказ» + кнопка «Очистить» над списком товаров */
.nbc-sc__items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 12px;
}
.nbc-sc__items-header .nbc-sc__h2 {
    margin: 0;
}
.nbc-sc__clear-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(198, 40, 40, .08);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: #c62828;
    cursor: pointer;
    transition: background var(--sc-tr);
}
.nbc-sc__clear-all:hover { background: rgba(198, 40, 40, .15); }

@media (max-width: 720px) {
    .nbc-sc__row3,
    .nbc-sc__row2 { grid-template-columns: 1fr; }
}

/* Звёздочки «обязательное поле» — крупнее, красные, не жирные */
.nbc-sc__field span em.req,
.nbc-sc__field .req {
    color: #C0392B;
    font-style: normal;
    font-weight: 400;
    font-size: 15px;
    margin-left: 2px;
    vertical-align: -1px;
    line-height: 1;
}

/* Sidebar (правая колонка) остаётся sticky с summary */
.nbc-sc__side {
    position: sticky;
    top: 24px;
}

@media (max-width: 960px) {
    .nbc-sc__grid { grid-template-columns: 1fr; }
    .nbc-sc__side { position: static; }
}

/* ═══════════════ Items ═══════════════ */

.nbc-sc__items {
    background: #fff;
    border-radius: 16px;
    padding: 8px 24px;
    box-shadow: 0 2px 18px rgba(27,35,86,.05);
}

.nbc-sc__item {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--sc-border);
}
.nbc-sc__item:last-child { border-bottom: none; }

.nbc-sc__item-img {
    width: 88px; height: 88px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--sc-cream-d);
    flex-shrink: 0;
}
.nbc-sc__item-img img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.nbc-sc__item-info { min-width: 0; }
.nbc-sc__item-name {
    font-family: 'Spectral', serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--sc-navy);
    margin: 0 0 4px;
    text-decoration: none;
    display: block;
}
.nbc-sc__item-name:hover { color: var(--sc-gold); }
.nbc-sc__item-meta {
    font-size: 12px;
    color: var(--sc-muted);
    margin: 4px 0 10px;
    line-height: 1.4;
}

.nbc-sc__item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nbc-sc__qty {
    display: inline-flex;
    align-items: center;
    background: var(--sc-cream);
    border-radius: 100px;
    padding: 2px;
}
.nbc-sc__qty button {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--sc-navy);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--sc-tr);
}
.nbc-sc__qty button:hover { background: var(--sc-gold); color: #fff; }
.nbc-sc__qty span {
    min-width: 30px; text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.nbc-sc__item-remove {
    background: transparent;
    border: none;
    color: var(--sc-muted);
    cursor: pointer;
    padding: 6px;
    transition: color var(--sc-tr);
}
.nbc-sc__item-remove:hover { color: #c0392b; }
.nbc-sc__item-remove svg { width: 18px; height: 18px; }

.nbc-sc__item-price {
    text-align: right;
    min-width: 100px;
}
.nbc-sc__item-total {
    font-family: 'Spectral', serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--sc-navy);
    white-space: nowrap;
}
.nbc-sc__item-unit {
    font-size: 11px;
    color: var(--sc-muted);
    margin-top: 4px;
}

/* ═══════════════ Side: form + summary ═══════════════ */

.nbc-sc__side {
    display: grid;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.nbc-sc__form,
.nbc-sc__summary {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 18px rgba(27,35,86,.05);
}

.nbc-sc__h2 {
    font-family: 'Spectral', serif;
    font-weight: 500;
    font-size: 20px;
    color: var(--sc-navy);
    margin: 0 0 16px;
}
.nbc-sc__h2--mt { margin-top: 20px; }

.nbc-sc__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.nbc-sc__field span {
    font-size: 11px;
    color: var(--sc-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 500;
}
.nbc-sc__field input,
.nbc-sc__field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--sc-border);
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--sc-text);
    background: var(--sc-cream);
    transition: all var(--sc-tr);
    box-sizing: border-box;
    resize: vertical;
}
.nbc-sc__field input:focus,
.nbc-sc__field textarea:focus {
    outline: none;
    border-color: var(--sc-gold);
    background: #fff;
}

.nbc-sc__row2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

.nbc-sc__error {
    padding: 10px 14px;
    background: #FDECEA;
    border-radius: 10px;
    color: #b4271f;
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.5;
}

/* ═══════════════ Summary ═══════════════ */

.nbc-sc__line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    font-size: 14px;
    color: var(--sc-text);
}
.nbc-sc__line--discount span:last-child { color: #c0392b; }
.nbc-sc__line > span:first-child { color: var(--sc-muted); }

.nbc-sc__total {
    font-family: 'Spectral', serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--sc-navy);
    border-top: 1px solid var(--sc-border);
    margin-top: 8px;
    padding-top: 14px;
}
.nbc-sc__total > span:first-child { color: var(--sc-navy); font-family: 'Spectral', serif; }

.nbc-sc__vat-inline {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    color: var(--sc-muted);
    text-align: right;
    margin: -2px 0 6px;
}
.nbc-sc__vat-inline .nbcScVat { color: var(--sc-text); font-weight: 500; }

.nbc-sc__promo { margin: 12px 0; }
.nbc-sc__promo-toggle {
    background: none;
    border: none;
    color: var(--sc-gold);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}
.nbc-sc__promo-wrap {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.nbc-sc__promo-wrap input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--sc-border);
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    background: var(--sc-cream);
    box-sizing: border-box;
}
.nbc-sc__promo-wrap button {
    padding: 10px 18px;
    background: var(--sc-navy);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    transition: background var(--sc-tr);
}
.nbc-sc__promo-wrap button:hover { background: var(--sc-gold); }
.nbc-sc__promo-msg {
    margin-top: 8px;
    font-size: 12px;
    min-height: 16px;
}
.nbc-sc__promo-msg.error { color: #c0392b; }
.nbc-sc__promo-msg.ok    { color: #0f7a3d; }
.nbc-sc__promo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.nbc-sc__promo-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 12px;
    border-radius: 100px;
    background: var(--sc-cream-d);
    color: var(--sc-navy);
    font-size: 12px;
}
.nbc-sc__promo-chip button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--sc-muted);
    padding: 0;
    font-size: 16px;
    line-height: 1;
}
.nbc-sc__promo-chip button:hover { color: #c0392b; }

.nbc-sc__pay {
    width: 100%;
    padding: 16px 22px;
    background: var(--sc-navy);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--sc-tr);
    margin-top: 10px;
}
.nbc-sc__pay:hover { background: var(--sc-gold); }
.nbc-sc__pay:disabled { opacity: .6; cursor: not-allowed; }

a.nbc-sc__pay,
a.nbc-sc__pay--link {
    display: block;
    text-align: center;
    text-decoration: none;
    color: #fff !important;
}
a.nbc-sc__pay:hover,
a.nbc-sc__pay--link:hover { color: #fff !important; }

.nbc-sc__hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--sc-muted);
    text-align: center;
}

/* ═══════════════ Empty ═══════════════ */

.nbc-sc__empty {
    text-align: center;
    padding: 100px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 18px rgba(27,35,86,.05);
}
.nbc-sc__empty p {
    font-family: 'Spectral', serif;
    font-size: 28px;
    color: var(--sc-muted);
    margin: 0 0 22px;
}
.nbc-sc__empty-btn {
    display: inline-block;
    padding: 14px 28px;
    background: var(--sc-gold);
    color: #fff;
    border-radius: 100px;
    text-decoration: none;
    font-size: 14px;
    transition: background var(--sc-tr);
}
.nbc-sc__empty-btn:hover { background: var(--sc-navy); color: #fff; }

/* ═══════════════ Адаптив ═══════════════ */

@media (max-width: 960px) {
    .nbc-sc__grid { grid-template-columns: 1fr; }
    .nbc-sc__side { position: static; }
    .nbc-sc__title { font-size: 32px; margin-bottom: 22px; }
}
@media (max-width: 560px) {
    .nbc-sc { padding: 24px 14px 60px; }
    .nbc-sc__items { padding: 0 16px; }
    .nbc-sc__item {
        grid-template-columns: 72px 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
    }
    .nbc-sc__item-img { width: 72px; height: 72px; }
    .nbc-sc__item-price {
        grid-column: 1 / -1;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 4px;
        border-top: 1px dashed var(--sc-border);
        margin-top: 4px;
    }
    .nbc-sc__form, .nbc-sc__summary { padding: 18px 16px; }
}
