/* ============================================================
   CART.CSS — корзина и кабинет покупателя
   Палитра темы: #3ca5a9, #2b5876, фоны #f4f5f6, границы #eef2f3
   ============================================================ */

.cart-page {
    background: #f4f5f6;
    min-height: 80vh;
    padding: 56px 0 64px;
}
.cart-page__inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

.cart-head { margin-bottom: 22px; }
.cart-head__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.cart-head__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 9px 16px;
    border: 1px solid #dfe4e6;
    border-radius: 12px;
    background: #fff;
    font-size: 13.5px;
    font-weight: 600;
    color: #2b5876;
    text-decoration: none;
    transition: border-color .15s, color .15s, background .15s;
}
.cart-head__back:hover {
    border-color: #3ca5a9;
    color: #3ca5a9;
    background: rgba(60,165,169,.05);
}
.cart-head__back-name {
    font-weight: 700;
    color: #3ca5a9;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-head__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    color: #1f2937;
    margin: 0 0 6px;
}
.cart-head__subtitle { font-size: 14px; color: #6b7280; margin: 0; }
.cart-head__subtitle strong { color: #2b5876; }

/* ---------- Пустая корзина ---------- */
.cart-empty {
    background: #fff;
    border-radius: 16px;
    padding: 56px 24px;
    text-align: center;
    box-shadow: 0 8px 26px rgba(17,40,45,.05);
}
.cart-empty__icon { font-size: 44px; margin-bottom: 12px; }
.cart-empty__title { font-family: 'Montserrat', sans-serif; font-size: 19px; color: #1f2937; margin-bottom: 6px; }
.cart-empty__text { font-size: 14px; color: #6b7280; margin-bottom: 20px; }

/* ---------- Раскладка ---------- */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    align-items: start;
}

/* ---------- Строки корзины ---------- */
.cart-lines {
    background: #fff;
    border: 1px solid #eef2f3;
    border-radius: 16px;
    overflow: hidden;
}
.cart-line {
    display: grid;
    grid-template-columns: 64px 1fr auto 110px 40px;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eef2f3;
}
.cart-line:last-child { border-bottom: none; }
.cart-line__thumb {
    width: 64px; height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: #f4f5f6;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.cart-line__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-line__thumb-ph { font-size: 22px; opacity: .4; }

.cart-line__body { min-width: 0; }
.cart-line__title {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: #2b5876;
    text-decoration: none;
    margin-bottom: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cart-line__title:hover { color: #3ca5a9; }
.cart-line__size { font-size: 12.5px; color: #6b7280; margin-bottom: 2px; }
.cart-line__price { font-size: 12.5px; color: #9ca3af; }

.cart-line__qty { display: inline-flex; align-items: center; gap: 4px; }
.cart-qty__btn {
    width: 30px; height: 30px;
    border: 1px solid #eef2f3;
    border-radius: 9px;
    background: #f4f5f6;
    color: #374151;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: .15s;
}
.cart-qty__btn:hover { border-color: #3ca5a9; color: #3ca5a9; }
.cart-line__qty-input {
    width: 46px;
    height: 30px;
    box-sizing: border-box;
    border: 1px solid #eef2f3;
    border-radius: 9px;
    background: #fff;
    text-align: center;
    font-family: inherit;
    font-size: 13.5px;
    color: #1f2937;
}
.cart-line__qty-input:focus { outline: none; border-color: #3ca5a9; }

.cart-line__total { font-size: 14.5px; font-weight: 700; color: #1f2937; text-align: right; white-space: nowrap; }

.cart-line__remove {
    width: 34px; height: 34px;
    border: none;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: .15s;
}
.cart-line__remove:hover { background: #fef2f2; }

/* ---------- Сводка ---------- */
.cart-summary {
    position: sticky;
    top: 96px;
    background: #fff;
    border: 1px solid #eef2f3;
    border-radius: 16px;
    padding: 20px;
}
.cart-summary__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    color: #1f2937;
    margin: 0 0 14px;
}
.cart-summary__row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13.5px; color: #4b5563;
    padding: 7px 0;
    border-bottom: 1px dashed #eef2f3;
}
.cart-summary__row--total {
    font-size: 15px;
    color: #1f2937;
    border-bottom: none;
    padding-top: 10px;
}
.cart-summary__row--total strong { font-size: 19px; color: #2b5876; }
.cart-summary__note {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
    margin: 12px 0 16px;
}

/* ---------- Форма ---------- */
.cart-form__field { display: block; margin-bottom: 12px; }
.cart-form__field > span {
    display: block;
    font-size: 12.5px;
    color: #6b7280;
    margin-bottom: 5px;
}
.cart-form__field input,
.cart-form__field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #eef2f3;
    border-radius: 12px;
    background: #f4f5f6;
    font-family: inherit;
    font-size: 14px;
    color: #1f2937;
}
.cart-form__field input:focus,
.cart-form__field textarea:focus {
    outline: none;
    background: #fff;
    border-color: #3ca5a9;
    box-shadow: 0 0 0 2px rgba(60,165,169,.15);
}
.cart-form__note { font-size: 11.5px; color: #9ca3af; margin: 10px 0 0; line-height: 1.45; }

/* ---------- Кнопки ---------- */
.cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: .15s;
}
.cart-btn--primary {
    background: #3ca5a9;
    color: #fff;
    box-shadow: 0 6px 18px rgba(60,165,169,.22);
}
.cart-btn--primary:hover { background: #2f8f93; }
.cart-btn--primary:disabled { opacity: .65; cursor: default; box-shadow: none; }
.cart-btn--block { width: 100%; margin-top: 6px; }

/* ---------- Спиннер (белый, в стиле темы) ---------- */
.cart-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 7px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cartSpin .7s linear infinite;
}
@keyframes cartSpin {
    to { transform: rotate(360deg); }
}

/* ---------- Статус ---------- */
.cart-status { margin-top: 10px; font-size: 13px; line-height: 1.45; }
.cart-status.is-ok    { color: #10b981; }
.cart-status.is-error { color: #ef4444; }

/* ---------- Иконка корзины в навбаре (после «Новости») ---------- */
.header__nav-cart { display: flex; align-items: center; }
.header__nav-link--cart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    text-decoration: none;
    transition: background .15s;
}
.header__nav-link--cart:hover { background: rgba(255, 255, 255, .26); }
.header__nav-link--cart .om-icon { stroke: #fff; }
.header__cart-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #fff;
    color: #2b5876;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.header__cart-count:empty { display: none; }

/* ---------- Счётчик в дропдауне ----------
   Корзина использует .header__unread-badge из header.css (как «Заявки»),
   отдельный стиль не нужен. */

/* ---------- Кабинет покупателя ---------- */
.buyer-cabinet__order {
    background: #fff;
    border: 1px solid #eef2f3;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 14px;
}
.buyer-cabinet__order-head {
    display: flex; flex-wrap: wrap; gap: 10px;
    justify-content: space-between; align-items: baseline;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f3;
}
.buyer-cabinet__order-num { font-family: 'Montserrat', sans-serif; font-size: 16px; color: #1f2937; }
.buyer-cabinet__order-meta { font-size: 12.5px; color: #6b7280; }
.buyer-cabinet__order-items { font-size: 13.5px; color: #374151; }
.buyer-cabinet__order-item {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed #f4f5f6;
}
.buyer-cabinet__order-item:last-child { border-bottom: none; }
.buyer-cabinet__order-total {
    display: flex; justify-content: space-between;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid #eef2f3;
    font-size: 14.5px; font-weight: 700; color: #2b5876;
}
.buyer-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
}
.buyer-badge--new    { background: rgba(60,165,169,.14); color: #2b7c80; }
.buyer-badge--done   { background: #d1fae5; color: #065f46; }
.buyer-badge--unpaid { background: #fef3c7; color: #92400e; }
.buyer-badge--paid   { background: #d1fae5; color: #065f46; }

/* ---------- Адаптив ---------- */
@media (max-width: 980px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
}
@media (max-width: 640px) {
    .cart-page { padding: 72px 0 44px; }
    .cart-line { grid-template-columns: 56px 1fr 34px; grid-template-areas: 'thumb body remove' 'qty qty total'; row-gap: 10px; }
    .cart-line__thumb { grid-area: thumb; width: 56px; height: 56px; }
    .cart-line__body  { grid-area: body; }
    .cart-line__qty   { grid-area: qty; }
    .cart-line__total { grid-area: total; }
    .cart-line__remove { grid-area: remove; }
}

/* ---------- Промокод в корзине ---------- */
.cart-promo { margin: 14px 0 4px; }
.cart-promo__row { display: flex; gap: 8px; }
.cart-promo__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #eef2f3;
    border-radius: 12px;
    background: #f4f5f6;
    font-family: inherit;
    font-size: 13.5px;
    text-transform: uppercase;
}
.cart-promo__input:focus {
    outline: none;
    background: #fff;
    border-color: #3ca5a9;
    box-shadow: 0 0 0 2px rgba(60,165,169,.15);
}
.cart-promo__btn {
    flex: 0 0 auto;
    padding: 10px 16px;
    border: 1px solid #3ca5a9;
    border-radius: 12px;
    background: transparent;
    color: #3ca5a9;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
}
.cart-promo__btn:hover { background: rgba(60,165,169,.08); }
.cart-promo__btn:disabled { opacity: .6; cursor: default; }
.cart-promo__msg { font-size: 12px; margin-top: 6px; line-height: 1.4; }
.cart-promo__msg.is-ok    { color: #10b981; }
.cart-promo__msg.is-error { color: #ef4444; }
.cart-promo__line {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #10b981;
    padding: 7px 0;
    border-bottom: 1px dashed #eef2f3;
}
.promo-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: #1f2937;
    margin: 0 0 6px;
}
.promo-count {
    font-size: 12.5px;
    color: #6b7280;
    font-weight: 500;
    margin-left: 6px;
}

/* Перечёркнутая цена до скидки */
.cart-summary__old {
    display: inline-block;
    margin-right: 8px;
    color: #9ca3af;
    font-weight: 500;
    font-size: 14px;
    text-decoration: line-through;
    vertical-align: middle;
}

/* ---------- Модалка успешного заказа ---------- */
.cart-success {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cart-success__overlay {
    position: absolute;
    inset: 0;
    background: rgba(17,40,45,.55);
    backdrop-filter: blur(3px);
}
.cart-success__box {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 22px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 24px 60px rgba(17,40,45,.28);
    animation: cartSuccessIn .28s ease;
}
@keyframes cartSuccessIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.cart-success__close {
    position: absolute;
    top: 10px; right: 10px;
    width: 34px; height: 34px;
    border: none;
    border-radius: 10px;
    background: #f4f5f6;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
}
.cart-success__close:hover { background: #eef2f3; color: #1f2937; }

.cart-success__emoji { font-size: 40px; margin-bottom: 8px; }
.cart-success__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 21px;
    color: #1f2937;
    margin: 0 0 6px;
}
.cart-success__subtitle { font-size: 13.5px; color: #6b7280; margin: 0 0 16px; line-height: 1.5; }

.cart-success__list { text-align: left; margin-bottom: 12px; }
.cart-success__item {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #f4f5f6;
}
.cart-success__item:last-child { border-bottom: none; }
.cart-success__item-thumb {
    width: 44px; height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f5f6;
    display: flex; align-items: center; justify-content: center;
}
.cart-success__item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-success__item-body { min-width: 0; }
.cart-success__item-title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #2b5876;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cart-success__item-meta { display: block; font-size: 12px; color: #9ca3af; }
.cart-success__item-qty { font-size: 13px; color: #6b7280; }
.cart-success__item-sum { font-size: 13.5px; font-weight: 700; color: #1f2937; }

.cart-success__total {
    font-size: 15px;
    color: #4b5563;
    padding: 12px 0;
    border-top: 1px solid #eef2f3;
    margin-bottom: 8px;
}
.cart-success__total strong { font-size: 19px; color: #2b5876; margin-left: 6px; }

.cart-success__note {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
    margin: 0 0 16px;
}
.cart-success__timer {
    font-size: 11.5px;
    color: #9ca3af;
    margin-top: 10px;
}