/* Printinglife — корзина v2 (дизайн pl-cart-v2).
 * Портировано из макета Korzina.html. Шапка/футер/крошки — общие партиалы
 * сайта, поэтому их стили сюда НЕ копируются.
 * Токены, конфликтующие с глобальными (--pl-radius*), scoped на .pl-cart-v2.
 */

.pl-cart-v2 {
    --pl-brand: #fe2e46;
    --pl-brand-dark: #e61e36;
    --pl-brand-tint: #fff5f6;
    --pl-ink: #41496D;
    --pl-ink-soft: #5a6180;
    --pl-text: #1e293b;
    --pl-muted: #64748b;
    --pl-mute2: #94a3b8;
    --pl-line: #e8eaf0;
    --pl-line-soft: #f1f3f7;
    --pl-bg-soft: #f8fafc;
    --pl-bg-tint: #fff5f6;
    --pl-success: #16a34a;
    --pl-success-soft: #ecfdf5;
    --pl-page-px: 4rem;
    --pl-radius: 14px;
    --pl-radius-sm: 10px;
}
@media (max-width: 1100px) { .pl-cart-v2 { --pl-page-px: 2rem; } }
@media (max-width: 640px)  { .pl-cart-v2 { --pl-page-px: 1rem; } }

.pl-cart-v2 * { box-sizing: border-box; }
.pl-cart-v2 img { display: block; max-width: 100%; }
.pl-cart-v2 button { font-family: inherit; }

/* ========= BREADCRUMBS ========= */
/* Партиал .plc-breadcrumbs не имеет своих внешних отступов — задаём здесь,
   по тем же --pl-page-px, что и контент (иначе крошки прижаты к шапке). */
.pl-cart-crumb { padding: 1.25rem var(--pl-page-px) 0; }
.pl-cart-crumb .plc-breadcrumbs { margin: 0; }

/* ========= PAGE LAYOUT ========= */
.cart-page { padding: 1rem var(--pl-page-px) 4rem; }

.cart-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: end;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--pl-line);
    margin-bottom: 2rem;
}
@media (max-width: 800px) { .cart-head { grid-template-columns: 1fr; align-items: start; } }

.cart-head__title {
    font-size: clamp(2rem, 4vw, 2.85rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--pl-ink);
    margin: 0 0 0.65rem;
    display: flex; align-items: baseline; gap: 0.65rem; flex-wrap: wrap;
}
.cart-head__title em {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic; font-weight: 400;
    color: var(--pl-brand);
}
.cart-head__meta {
    display: flex; flex-wrap: wrap; gap: 0 1.4rem; align-items: center;
    font-size: 0.9375rem; color: var(--pl-ink-soft);
}
.cart-head__meta b { color: var(--pl-ink); font-weight: 700; }
.cart-head__meta .dot { width: 4px; height: 4px; background: var(--pl-mute2); border-radius: 50%; }

.cart-head__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cart-head__btn {
    padding: 0.7rem 1rem;
    background: #fff; color: var(--pl-ink);
    border: 1.5px solid var(--pl-line);
    border-radius: var(--pl-radius-sm);
    font-weight: 600; font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.45rem;
    transition: all 160ms ease;
    text-decoration: none;
}
.cart-head__btn:hover { border-color: var(--pl-ink); color: var(--pl-brand); }
.cart-head__btn svg { width: 15px; height: 15px; }

/* ========= MAIN GRID ========= */
.cart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.75rem;
    align-items: start;
}
@media (max-width: 1100px) { .cart-grid { grid-template-columns: 1fr; } }

/* ========= ITEMS ========= */
.cart-items { display: flex; flex-direction: column; gap: 0.85rem; }

.item {
    background: #fff;
    border: 1.5px solid var(--pl-line);
    border-radius: var(--pl-radius);
    padding: 1.25rem 1.4rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, opacity 200ms ease, transform 200ms ease;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1.1rem;
    position: relative;
}
.item:hover { border-color: var(--pl-mute2); box-shadow: 0 6px 20px -10px rgba(15,23,42,0.1); }
.item.is-removing { opacity: 0; transform: translateX(24px); }

.item__visual {
    width: 100px; height: 100px;
    background: var(--pl-bg-soft);
    border-radius: var(--pl-radius-sm);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    flex-shrink: 0;
}
.item__visual img { width: 100%; height: 100%; object-fit: contain; }
.item__visual--empty { color: var(--pl-mute2); font-size: 0.72rem; text-align: center; padding: 0.5rem; }

.item__body { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.item__row1 { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; }
.item__title-wrap { min-width: 0; }
.item__title {
    margin: 0;
    font-size: 1.0625rem; font-weight: 700;
    color: var(--pl-ink); letter-spacing: -0.01em; line-height: 1.3;
    text-decoration: none; display: block;
}
a.item__title:hover { color: var(--pl-brand); }
.item__sub { font-size: 0.8125rem; color: var(--pl-muted); margin-top: 0.25rem; }
.item__sub b { color: var(--pl-ink-soft); font-weight: 600; }
.item__close {
    width: 32px; height: 32px;
    border: 0; background: transparent;
    color: var(--pl-mute2); cursor: pointer;
    border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 160ms;
}
.item__close:hover { background: var(--pl-bg-tint); color: var(--pl-brand); }
.item__close svg { width: 16px; height: 16px; }

/* Imprint card */
.imprint {
    background: var(--pl-bg-soft);
    border: 1px solid var(--pl-line-soft);
    border-radius: var(--pl-radius-sm);
    padding: 0.85rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.5rem;
    align-items: start;
}
.imprint__head {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px dashed var(--pl-line);
    padding-bottom: 0.55rem; margin-bottom: 0.15rem;
}
.imprint__title {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.72rem; font-weight: 700;
    color: var(--pl-brand);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.imprint__title svg { width: 14px; height: 14px; }
.imprint__field { min-width: 0; }
.imprint__label {
    display: block;
    font-size: 0.68rem; font-weight: 700;
    color: var(--pl-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
}
.imprint__value { font-size: 0.875rem; color: var(--pl-ink); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
@media (max-width: 700px) { .imprint { grid-template-columns: 1fr 1fr; } }

.imprint--none {
    background: transparent;
    border: 1.5px dashed var(--pl-line);
    padding: 0.85rem 1rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.85rem; flex-wrap: wrap;
}
.imprint--none .imprint__title { color: var(--pl-muted); }
.imprint--none p { margin: 0; font-size: 0.8125rem; color: var(--pl-ink-soft); line-height: 1.35; }

/* Footer of item */
.item__foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.25rem; flex-wrap: wrap;
}
@media (max-width: 700px) { .item__foot { gap: 0.75rem; } }

.qty-stepper {
    display: inline-flex; align-items: stretch;
    background: #fff;
    border: 1.5px solid var(--pl-line);
    border-radius: var(--pl-radius-sm);
    overflow: hidden; height: 44px;
}
.qty-stepper button { width: 38px; border: 0; background: transparent; color: var(--pl-ink); font-size: 1.1rem; cursor: pointer; padding: 0; }
.qty-stepper button:hover { background: var(--pl-bg-soft); color: var(--pl-brand); }
.qty-stepper input {
    width: 64px; border: 0; outline: none; text-align: center;
    font-size: 0.95rem; font-weight: 700; color: var(--pl-ink);
    background: transparent; font-family: inherit;
    border-left: 1.5px solid var(--pl-line);
    border-right: 1.5px solid var(--pl-line);
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input[type=number] { -moz-appearance: textfield; }
.qty-presets { display: flex; gap: 0.35rem; margin-left: 0.6rem; }
.qty-preset {
    padding: 0 0.65rem; height: 44px;
    background: var(--pl-bg-soft); color: var(--pl-ink-soft);
    border: 0; border-radius: 8px;
    font-size: 0.78rem; font-weight: 600; cursor: pointer;
    transition: all 140ms;
}
.qty-preset:hover { background: var(--pl-ink); color: #fff; }
.item__qty-wrap { display: flex; align-items: center; flex-wrap: wrap; }

.item__price { text-align: right; }
.item__price .--unit {
    display: block;
    font-size: 0.72rem; font-weight: 700;
    color: var(--pl-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}
.item__price .--unit b { color: var(--pl-ink); font-size: 0.875rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.item__price .--sum { font-size: 1.4rem; font-weight: 800; color: var(--pl-ink); letter-spacing: -0.015em; line-height: 1; }
.item__price .--sum em { font-style: normal; color: var(--pl-brand); }
.item__price .--setup { margin-top: 0.4rem; font-size: 0.75rem; color: var(--pl-muted); }

.item__tools {
    grid-column: 2 / -1;
    margin-top: 0.65rem; padding-top: 0.85rem;
    border-top: 1px solid var(--pl-line-soft);
    display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.item__tool {
    padding: 0.35rem 0.65rem;
    background: transparent; border: 0;
    color: var(--pl-ink-soft);
    font-size: 0.75rem; font-weight: 600;
    cursor: pointer; border-radius: 6px;
    display: inline-flex; align-items: center; gap: 0.3rem;
    transition: all 140ms;
}
.item__tool:hover { background: var(--pl-bg-soft); color: var(--pl-brand); }
.item__tool svg { width: 13px; height: 13px; }
.item__tool.--danger:hover { color: var(--pl-brand); background: var(--pl-bg-tint); }

@media (max-width: 700px) {
    .item { padding: 1rem; gap: 0.85rem; }
    .item__tools { grid-column: 1 / -1; }
}

/* ========= ADD-MORE ROW ========= */
.add-more {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--pl-bg-soft);
    border: 1.5px dashed var(--pl-line);
    border-radius: var(--pl-radius);
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.add-more__txt { font-size: 0.9375rem; color: var(--pl-ink-soft); }
.add-more__txt b { color: var(--pl-ink); font-weight: 700; }
.add-more a {
    padding: 0.75rem 1.25rem;
    background: var(--pl-ink); color: #fff;
    border-radius: var(--pl-radius-sm);
    font-weight: 700; font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.add-more a:hover { background: var(--pl-brand); }
.add-more a svg { width: 14px; height: 14px; }

/* ========= CHECKOUT CARD (сводка + форма + итог + CTA в одном блоке) ========= */
.summary-wrap { position: sticky; top: 96px; align-self: start; }
@media (max-width: 1100px) { .summary-wrap { position: static; } }

.checkout-card {
    background: #fff;
    border: 1.5px solid var(--pl-line);
    border-radius: var(--pl-radius);
    overflow: hidden;
}
.checkout-card__head { padding: 1.25rem 1.5rem 0.9rem; border-bottom: 1px solid var(--pl-line-soft); }
.checkout-card__title { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--pl-ink); letter-spacing: -0.015em; }
.checkout-card__sub { margin: 0.3rem 0 0; font-size: 0.8125rem; color: var(--pl-muted); line-height: 1.45; }
.checkout-card__form { padding: 1.1rem 1.5rem 1.5rem; }

.summary__lines { padding: 1rem 1.5rem 0.85rem; display: flex; flex-direction: column; gap: 0.65rem; border-bottom: 1px solid var(--pl-line-soft); }
.summary__line { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 0.9375rem; }
.summary__line .--label { color: var(--pl-ink-soft); }
.summary__line .--label small { display: block; color: var(--pl-muted); font-size: 0.72rem; margin-top: 1px; }
.summary__line .--value { color: var(--pl-ink); font-weight: 700; text-align: right; white-space: nowrap; }
/* Итог — внутри формы, прямо над кнопкой: однозначно видно, что CTA ниже */
.checkout-total {
    margin: 1rem 0 0.85rem;
    padding: 0.95rem 1.1rem;
    background: var(--pl-bg-soft);
    border: 1px solid var(--pl-line);
    border-radius: var(--pl-radius-sm);
    display: flex; justify-content: space-between; align-items: center;
}
.checkout-total__label { font-size: 0.9rem; font-weight: 600; color: var(--pl-ink-soft); }
.checkout-total__value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; color: var(--pl-ink); line-height: 1; }
.checkout-total__value em { font-style: normal; color: var(--pl-brand); margin-left: 0.1em; }

.form-tabs { display: flex; gap: 0; margin-bottom: 1rem; background: var(--pl-bg-soft); border-radius: 9px; padding: 3px; }
.form-tab {
    flex: 1; padding: 0.55rem 0.85rem;
    background: transparent; border: 0;
    font-size: 0.8125rem; font-weight: 700;
    color: var(--pl-ink-soft); cursor: pointer; border-radius: 7px;
}
.form-tab.is-active { background: #fff; color: var(--pl-ink); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.7rem; }
.field__label {
    font-size: 0.7rem; font-weight: 700;
    color: var(--pl-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    display: flex; justify-content: space-between; align-items: baseline;
}
.field__label .req { color: var(--pl-brand); }
.field__label small { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--pl-muted); font-size: 0.7rem; }
.field input, .field textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1.5px solid var(--pl-line);
    border-radius: 9px;
    font-size: 0.9rem; font-family: inherit;
    color: var(--pl-text); background: #fff;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input::placeholder, .field textarea::placeholder { color: #a8aec0; font-weight: 400; opacity: 1; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pl-ink); box-shadow: 0 0 0 3px rgba(65,73,109,0.08); }
.field.is-invalid input { border-color: var(--pl-brand); background: #fff7f7; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 460px) { .field-row { grid-template-columns: 1fr; } }

.consent {
    margin-top: 0.85rem;
    display: flex; align-items: flex-start; gap: 0.55rem;
    font-size: 0.78rem; color: var(--pl-ink-soft); line-height: 1.45;
    cursor: pointer;
}
.consent input { margin-top: 1px; accent-color: var(--pl-brand); width: 16px; height: 16px; flex-shrink: 0; }
.consent a { color: var(--pl-brand); text-decoration: none; }

.submit-btn {
    width: 100%; margin-top: 0.85rem;
    padding: 1.05rem 1.4rem;
    background: var(--pl-brand); color: #fff;
    border: 0; border-radius: var(--pl-radius-sm);
    font-size: 0.9375rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 8px 22px -6px rgba(254,46,70,0.4);
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: all 180ms;
}
.submit-btn:hover { background: var(--pl-brand-dark); transform: translateY(-1px); box-shadow: 0 12px 28px -6px rgba(254,46,70,0.5); }
.submit-btn:disabled { opacity: 0.7; cursor: progress; transform: none; }
.submit-btn svg { width: 16px; height: 16px; }
.submit-note { margin-top: 0.6rem; font-size: 0.72rem; color: var(--pl-muted); text-align: center; line-height: 1.4; }
.submit-status { margin-top: 0.6rem; font-size: 0.82rem; padding: 0.6rem 0.75rem; border-radius: 8px; }
.submit-status.is-error { background: #fef2f2; color: #b91c1c; }

/* ========= CROSS-SELL (каталожные карточки .plc-product) ========= */
.crosssell { margin-top: 3rem; }
.crosssell h2 { margin: 0 0 1.5rem; font-size: 1.4rem; font-weight: 800; color: var(--pl-ink); letter-spacing: -0.015em; }
.crosssell h2 em { font-family: Georgia, serif; font-style: italic; color: var(--pl-brand); }
/* Тот же партиал, что в каталоге. Запас снизу — под выезжающие на hover
   actions у .plc-product (см. printinglife-catalog.css). */
.crosssell__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem 0;
    padding-bottom: 120px;
}
@media (max-width: 1100px) { .crosssell__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .crosssell__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 80px; } }

/* ========= EMPTY / DONE ========= */
.cart-empty, .cart-done {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 4rem var(--pl-page-px) 5rem;
}
.cart-empty__icon, .cart-done__check {
    width: 76px; height: 76px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; margin-bottom: 1.25rem;
}
.cart-empty__icon { background: var(--pl-bg-tint); color: var(--pl-brand); }
.cart-done__check { background: var(--pl-success-soft); color: var(--pl-success); }
.cart-empty__icon svg, .cart-done__check svg { width: 38px; height: 38px; }
.cart-empty h1, .cart-done h1 { font-size: 1.6rem; color: var(--pl-ink); margin: 0 0 0.6rem; font-weight: 800; }
.cart-empty p, .cart-done p { color: var(--pl-muted); max-width: 520px; line-height: 1.55; margin: 0 0 1.5rem; }
.cart-empty__actions { display: flex; gap: 0.65rem; flex-wrap: wrap; justify-content: center; }
.cart-empty__btn {
    padding: 0.85rem 1.4rem;
    border-radius: var(--pl-radius-sm);
    font-weight: 700; font-size: 0.9rem; text-decoration: none;
    border: 1.5px solid var(--pl-line); color: var(--pl-ink);
    display: inline-flex; align-items: center; gap: 0.45rem;
    transition: all 160ms;
}
.cart-empty__btn:hover { border-color: var(--pl-ink); color: var(--pl-brand); }
.cart-empty__btn--primary { background: var(--pl-brand); color: #fff; border-color: var(--pl-brand); }
.cart-empty__btn--primary:hover { background: var(--pl-brand-dark); color: #fff; }

/* ========= SKELETON ========= */
.cart-skel-head, .cart-skel-item, .cart-skel-summary {
    background: linear-gradient(90deg, var(--pl-line-soft), var(--pl-bg-soft), var(--pl-line-soft));
    background-size: 200% 100%;
    animation: plCartShimmer 1.6s linear infinite;
    border-radius: var(--pl-radius);
}
.cart-skel-head { height: 90px; margin-bottom: 2rem; }
.cart-skel-item { height: 160px; margin-bottom: 0.85rem; }
.cart-skel-summary { height: 520px; }
@keyframes plCartShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========= TOAST ========= */
.toast {
    position: fixed; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.85rem 1.25rem;
    background: var(--pl-ink); color: #fff;
    border-radius: 10px;
    font-size: 0.875rem; font-weight: 600;
    box-shadow: 0 14px 36px -10px rgba(15,23,42,0.5);
    opacity: 0; pointer-events: none;
    transition: all 240ms ease;
    z-index: 300;
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 16px; height: 16px; color: var(--pl-brand); }

/* ========= MOBILE BOTTOM BAR ========= */
.mobile-bar {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--pl-line);
    padding: 0.75rem 1rem;
    z-index: 90;
    box-shadow: 0 -10px 30px -10px rgba(15,23,42,0.15);
    align-items: center; gap: 0.85rem;
}
.mobile-bar__total { flex: 1; }
.mobile-bar__total small { display: block; font-size: 0.7rem; color: var(--pl-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.mobile-bar__total b { font-size: 1.25rem; font-weight: 800; color: var(--pl-ink); }
.mobile-bar button {
    padding: 0.85rem 1.4rem;
    background: var(--pl-brand); color: #fff;
    border: 0; border-radius: 10px;
    font-weight: 700; font-size: 0.875rem; cursor: pointer;
}
@media (max-width: 1100px) {
    .mobile-bar:not([hidden]) { display: flex; }
    .pl-cart-v2 { padding-bottom: 90px; }
}

/* [hidden] устойчиво к display:flex/grid выше */
.pl-cart-v2 [hidden] { display: none !important; }
