/* ═══════════════════════════════════════════════════════════════════
   cart.css — корзина, промокод.
   ═══════════════════════════════════════════════════════════════════ */

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-cart-bg);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}
.cart-overlay.active { opacity: 1; visibility: visible; }

.cart-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--bg-surface);
    z-index: 1001;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    padding: 30px 24px;
    box-shadow: -10px 0 30px var(--shadow-color);
    border-left: 1px solid var(--border);
}
.cart-panel.active { right: 0; }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.cart-header h2 { font-size: var(--text-2xl); }

.close-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 32px;
    line-height: 1;
    padding: 4px;
}
.close-btn:hover { color: var(--text-main); }

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.cart-item-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.cart-item-title {
    font-weight: var(--fw-medium);
    font-size: var(--text-base);
    color: var(--text-main);
    overflow-wrap: break-word;
    line-height: 1.5;
}
.cart-item-price { color: var(--text-muted); font-size: var(--text-sm); }
.remove-item {
    color: var(--accent);
    background: none;
    font-size: var(--text-xs);
    font-weight: var(--fw-medium);
    padding: 4px;
    flex-shrink: 0;
}
.cart-footer { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 20px; }
.discount-row {
    display: flex;
    justify-content: space-between;
    color: var(--accent);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    margin-bottom: 12px;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}
.cart-total span:first-child { font-family: var(--font-heading); font-size: var(--text-xl); }
.cart-total span:last-child {
    font-family: var(--font-body);
    font-size: var(--text-xl);
    font-weight: var(--fw-semibold);
}
.checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: var(--white-on-accent);
    font-size: var(--text-base);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.checkout-btn:hover {
    background: var(--accent-hover);
}

.cart-promo-block { margin-bottom: 16px; }
.cart-promo-row { display: flex; gap: 8px; }
.cart-promo-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    text-transform: uppercase;
    min-width: 0;
    letter-spacing: 0.04em;
}
.cart-promo-input::placeholder {
    text-transform: none;
    letter-spacing: 0;
    color: var(--placeholder-color);
}
.cart-promo-input:focus { border-color: var(--accent); }
.cart-promo-apply {
    padding: 10px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: var(--font-body);
}
.cart-promo-apply:hover { border-color: var(--accent); color: var(--accent); }
.cart-promo-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px dashed rgba(var(--accent-rgb), 0.3);
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    word-break: break-word;
    gap: 8px;
}
.cart-promo-remove {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.cart-promo-remove:hover { opacity: 0.7; }