.cart-page { padding: 48px 0; }

.cart-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
}

.cart-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 40px;
}

.cart-header h1 { font-style: italic; }

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

/* Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
}

.cart-item {
    background: var(--bg);
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    padding: 20px;
    transition: background 0.2s;
}
.cart-item:hover { background: var(--bg2); }

.cart-item-img {
    width: 100px;
    height: 130px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg3);
    flex-shrink: 0;
}
.cart-item-img img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

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

.cart-item-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
}
.cart-item-name a { color: var(--text); }
.cart-item-name a:hover { color: var(--accent); }

.cart-item-price-unit { font-size: 13px; color: var(--muted); }

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.qty-form {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.qty-btn {
    background: var(--bg3);
    border: none;
    color: var(--text);
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.qty-btn:hover { background: var(--accent); color: #0e0e0f; }

.qty-num {
    min-width: 36px;
    text-align: center;
    font-size: 14px;
    line-height: 32px;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 0 4px;
}

.cart-item-subtotal {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--text);
}

.cart-remove-btn {
    background: none;
    border: none;
    color: var(--muted2);
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.cart-remove-btn:hover { color: #c25c5c; }

/* Summary */
.cart-summary {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    position: sticky;
    top: 90px;
}

.cart-summary-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
    padding: 4px 0;
    gap: 12px;
}

.summary-row span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    color: var(--text);
}

/* Empty */
.cart-empty {
    text-align: center;
    padding: 80px 32px;
    color: var(--muted);
}

.cart-empty-icon {
    margin: 0 auto 24px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted2);
}

.cart-empty h2 {
    color: var(--muted);
    font-size: 1.6rem;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .cart-item { grid-template-columns: 80px 1fr; }
    .cart-item-controls { flex-direction: row; align-items: center; grid-column: 1/-1; }
}

.cart-buy-link {
    width: fit-content;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* Phase 4 — directly editable quantity, consistent with Estelle's themes. */
.cart-qty-input {
    width: 60px;
    min-width: 0;
    border: 0;
    border-left: 1px solid var(--border);
    background: var(--bg2);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 6px 5px;
    text-align: center;
    -moz-appearance: textfield;
}
.cart-qty-input::-webkit-inner-spin-button,
.cart-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cart-qty-input:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cart-qty-save {
    padding: 0 8px;
    border: 0;
    border-left: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
}
.cart-qty-save:hover, .cart-qty-save:focus-visible { color: var(--accent); }
.cart-account-tip { padding: 14px 18px; border: 1px solid var(--border); background: var(--bg2); color: var(--muted); margin: 0 0 24px; }
.cart-account-tip a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) {
    .qty-form { max-width: 100%; }
    .cart-qty-input { width: 44px; }
    .cart-qty-save { padding: 0 6px; }
}
