/* ============================================
   CART — корзина
   ============================================ */

.cart-page { padding: 140px 0 100px; min-height: 60vh; }

.cart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 16px;
}

.cart-head h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cart-continue {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.cart-continue:hover { color: var(--accent); }

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.cart-items { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.cart-item:hover { border-color: var(--border-hover); }

.cart-item-image {
    width: 80px; height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.cart-item-image svg { width: 36px; height: 36px; color: var(--accent); opacity: 0.6; }

.cart-item-image img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.cart-item-info { min-width: 0; }

.cart-item-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.cart-item-brand {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.cart-item-qty button {
    width: 28px; height: 28px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    line-height: 1;
}

.cart-item-qty button:hover { background: var(--accent-glow); color: var(--accent); }

.cart-item-qty span {
    min-width: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.cart-item-remove {
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.cart-item-remove:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
}

.cart-summary {
    position: sticky;
    top: 100px;
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.cart-summary h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
    padding: 8px 0;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    margin: 12px 0 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
}

.cart-summary-total strong {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.cart-summary-total strong::after {
    content: ' ₽';
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 2px;
}

.cart-checkout {
    width: 100%;
    justify-content: center;
    padding: 14px;
}

.cart-empty { text-align: center; padding: 60px 20px; }

.cart-empty-icon {
    display: inline-grid;
    place-items: center;
    width: 96px; height: 96px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 50%;
    margin-bottom: 24px;
}

.cart-empty h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.cart-empty p {
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* Preserve fallback visibility even when the image layout uses display:block. */
.product-detail-image [hidden], .cart-item-image [hidden] { display: none !important; }
.photo-unavailable { display: grid; place-items: center; width: 100%; height: 100%; }
