/* ============================================================
   VENDARA — Cart & Checkout CSS
   Подключается на /cart и /checkout
   ============================================================ */

/* ── Page header ──────────────────────────────────────────── */
.cart-page {
    padding: 28px 0 64px;
    min-height: 60vh;
}

.cart-page__title {
    font-family: var(--vd-font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--vd-ink);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.cart-page__sub {
    font-size: 13px;
    color: var(--vd-muted);
    font-weight: 600;
    margin-bottom: 28px;
}

/* ── Layout ───────────────────────────────────────────────── */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

/* ── Cart table ───────────────────────────────────────────── */
.cart-table {
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-md);
    overflow: hidden;
}

.cart-table__head {
    display: grid;
    grid-template-columns: 1fr 120px 140px 120px 40px;
    padding: 12px 20px;
    background: var(--vd-surface);
    border-bottom: 1.5px solid var(--vd-border);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--vd-muted);
    gap: 12px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr 120px 140px 120px 40px;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--vd-border);
    align-items: center;
    transition: background var(--vd-transition);
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: var(--vd-surface); }

.cart-item__product {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.cart-item__img {
    width: 72px;
    height: 72px;
    border-radius: var(--vd-radius-sm);
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    text-decoration: none;
    transition: border-color var(--vd-transition);
    overflow: hidden;
}
.cart-item__img:hover { border-color: var(--vd-brand); }
.cart-item__img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.cart-item__info { min-width: 0; }
.cart-item__brand {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--vd-brand);
    margin-bottom: 3px;
}
.cart-item__name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--vd-ink);
    line-height: 1.4;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-item__name a {
    color: inherit;
    text-decoration: none;
    transition: color var(--vd-transition);
}
.cart-item__name a:hover { color: var(--vd-brand); }
.cart-item__sku { font-size: 11px; color: var(--vd-muted); font-weight: 600; }

.cart-item__price {
    font-family: var(--vd-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--vd-ink);
}

/* Qty counter */
.cart-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    overflow: hidden;
    width: fit-content;
}
.cart-qty__btn {
    width: 34px;
    height: 34px;
    border: none;
    background: var(--vd-surface);
    color: var(--vd-text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--vd-transition), color var(--vd-transition);
    flex-shrink: 0;
    font-weight: 700;
    line-height: 1;
}
.cart-qty__btn:hover { background: var(--vd-brand-light); color: var(--vd-brand); }
.cart-qty__btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cart-qty__input {
    width: 40px;
    height: 34px;
    border: none;
    border-left: 1px solid var(--vd-border);
    border-right: 1px solid var(--vd-border);
    text-align: center;
    font-family: var(--vd-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--vd-ink);
    outline: none;
    background: var(--vd-white);
}
.cart-qty__input::-webkit-outer-spin-button,
.cart-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; }

.cart-item__sum {
    font-family: var(--vd-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--vd-ink);
    white-space: nowrap;
}

.cart-item__del {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    background: var(--vd-white);
    color: var(--vd-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--vd-transition);
    flex-shrink: 0;
}
.cart-item__del:hover {
    border-color: var(--vd-red);
    color: var(--vd-red);
    background: var(--vd-red-light);
}

/* Cart footer row */
.cart-table__foot {
    padding: 16px 20px;
    background: var(--vd-surface);
    border-top: 1.5px solid var(--vd-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cart-clear-btn {
    height: 34px;
    padding: 0 16px;
    background: transparent;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    font-family: var(--vd-font-body);
    font-size: 12px;
    font-weight: 700;
    color: var(--vd-muted);
    cursor: pointer;
    transition: all var(--vd-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.cart-clear-btn:hover { border-color: var(--vd-red); color: var(--vd-red); }

.cart-continue-btn {
    height: 34px;
    padding: 0 16px;
    background: transparent;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    font-family: var(--vd-font-body);
    font-size: 12px;
    font-weight: 700;
    color: var(--vd-text);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--vd-transition);
}
.cart-continue-btn:hover { border-color: var(--vd-brand); color: var(--vd-brand); }

/* ── Summary block ────────────────────────────────────────── */
.cart-summary {
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-md);
    overflow: hidden;
    position: sticky;
    top: 82px;
}

.cart-summary__head {
    padding: 18px 22px;
    border-bottom: 1.5px solid var(--vd-border);
    font-family: var(--vd-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--vd-ink);
}

.cart-summary__body { padding: 20px 22px; }

.summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--vd-border);
    font-size: 14px;
}
.summary-row:last-of-type { border-bottom: none; }
.summary-row:first-child { padding-top: 0; }

.summary-row__label { color: var(--vd-muted); font-weight: 600; }
.summary-row__value { font-weight: 700; color: var(--vd-ink); text-align: right; }
.summary-row__value--muted { color: var(--vd-muted); font-weight: 600; font-size: 13px; }

.summary-total {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0 0;
    margin-top: 4px;
    border-top: 2px solid var(--vd-border);
}
.summary-total__label {
    font-family: var(--vd-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--vd-ink);
}
.summary-total__sub { font-size: 11px; font-weight: 600; color: var(--vd-muted); margin-top: 3px; }
.summary-total__price {
    font-family: var(--vd-font-display);
    font-size: 22px;
    font-weight: 900;
    color: var(--vd-ink);
    white-space: nowrap;
}

.cart-summary__actions { padding: 0 22px 22px; display: flex; flex-direction: column; gap: 10px; }

.cart-checkout-btn {
    width: 100%;
    height: 50px;
    background: var(--vd-brand);
    color: #fff;
    border: none;
    border-radius: var(--vd-radius);
    font-family: var(--vd-font-body);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background var(--vd-transition), transform var(--vd-transition), box-shadow var(--vd-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.cart-checkout-btn:hover {
    background: var(--vd-brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--vd-shadow-brand);
    color: #fff;
}

.cart-invoice-btn {
    width: 100%;
    height: 42px;
    background: transparent;
    color: var(--vd-text);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius);
    font-family: var(--vd-font-body);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--vd-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.cart-invoice-btn:hover { border-color: var(--vd-brand); color: var(--vd-brand); background: var(--vd-brand-light); }

/* Warning block */
.cart-warning {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    background: #FEF9C3;
    border: 1.5px solid #FDE68A;
    border-radius: var(--vd-radius-sm);
    font-size: 12px;
    color: #92400E;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 22px 16px;
}

/* ── Empty cart ───────────────────────────────────────────── */
.cart-empty {
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-md);
    padding: 72px 40px;
    text-align: center;
}
.cart-empty__icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.cart-empty__title {
    font-family: var(--vd-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--vd-ink);
    margin-bottom: 8px;
}
.cart-empty__sub { font-size: 14px; color: var(--vd-muted); margin-bottom: 28px; line-height: 1.6; }
.cart-empty__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 28px;
    background: var(--vd-brand);
    color: #fff;
    border-radius: var(--vd-radius);
    font-family: var(--vd-font-body);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background var(--vd-transition);
}
.cart-empty__btn:hover { background: var(--vd-brand-dark); color: #fff; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cart-layout { grid-template-columns: 1fr 300px; }
}

@media (max-width: 860px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .cart-table__head { display: none; }
    .cart-item {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 10px;
    }
    .cart-item__product { grid-column: 1 / -1; }
    .cart-item__price { display: none; }
    .cart-item__sum { font-size: 17px; }
    .cart-item__del { grid-column: 2; grid-row: 2; }
}

@media (max-width: 480px) {
    .cart-page { padding: 16px 0 48px; }
    .cart-item { padding: 14px; }
    .cart-item__img { width: 56px; height: 56px; font-size: 24px; }
}
