/* ── Cart Page ─────────────────────────────────────────────────────────────── */

.wishly-cart {
    padding: var(--w-space-12) 0 var(--w-space-16);
    min-height: calc(100vh - var(--w-header-height));
}

.wishly-cart__header {
    text-align: center;
    margin-bottom: var(--w-space-10);
}

.wishly-cart__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: var(--w-space-3);
}

.wishly-cart__subtitle {
    color: var(--w-text-secondary);
    font-size: var(--w-text-lg);
}

/* ── Two-column layout ─────────────────────────────────────────────────────── */

.wishly-cart__layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: var(--w-space-8);
    align-items: start;
}

@media (max-width: 900px) {
    .wishly-cart__layout {
        grid-template-columns: 1fr;
    }
}

/* ── Cart items ────────────────────────────────────────────────────────────── */

.wishly-cart-item {
    display: flex;
    align-items: center;
    gap: var(--w-space-4);
    padding: var(--w-space-4);
    background: var(--w-bg-glass);
    border: 1px solid var(--w-border-primary);
    border-radius: var(--w-radius-lg);
    margin-bottom: var(--w-space-3);
    transition: border-color var(--w-transition-fast);
}

.wishly-cart-item:hover {
    border-color: rgba(124, 58, 237, 0.3);
}

.wishly-cart-item__image {
    width: 80px;
    height: 80px;
    border-radius: var(--w-radius-lg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wishly-cart-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--w-space-1);
}

.wishly-cart-item__name {
    font-size: var(--w-text-base);
    font-weight: 600;
    color: var(--w-text-primary);
    margin: var(--w-space-1) 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wishly-cart-item__stats {
    display: flex;
    gap: var(--w-space-3);
    font-size: var(--w-text-xs);
    color: var(--w-text-secondary);
    flex-wrap: wrap;
}

.wishly-cart-item__remove {
    color: var(--w-text-tertiary);
    border: 1px solid var(--w-border-primary);
    background: transparent;
    flex-shrink: 0;
    transition: all var(--w-transition-fast);
}

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

/* Skeleton item */
.wishly-cart-item--skeleton {
    display: flex;
    align-items: center;
    gap: var(--w-space-4);
    padding: var(--w-space-4);
    border: 1px solid var(--w-border-primary);
    border-radius: var(--w-radius-lg);
    margin-bottom: var(--w-space-3);
}

.wishly-cart-item__image-skeleton {
    width: 80px;
    height: 80px;
    border-radius: var(--w-radius-lg);
    flex-shrink: 0;
}

/* ── XP preview bar ────────────────────────────────────────────────────────── */

.wishly-cart__xp-preview {
    display: flex;
    align-items: center;
    gap: var(--w-space-2);
    padding: var(--w-space-4) var(--w-space-5);
    background: var(--w-accent-light);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--w-radius-lg);
    margin-top: var(--w-space-4);
    font-size: var(--w-text-sm);
    color: var(--w-text-secondary);
}

.wishly-cart__xp-preview strong {
    color: var(--w-text-primary);
}

/* ── Empty state ───────────────────────────────────────────────────────────── */

.wishly-cart__empty {
    text-align: center;
    padding: var(--w-space-16) 0;
}

.wishly-cart__empty-icon {
    font-size: 4rem;
    margin-bottom: var(--w-space-4);
}

.wishly-cart__empty-title {
    font-size: var(--w-text-xl);
    font-weight: 700;
    margin-bottom: var(--w-space-2);
}

.wishly-cart__empty-text {
    color: var(--w-text-secondary);
    margin-bottom: var(--w-space-6);
}

/* ── Form card (sticky right column) ──────────────────────────────────────── */

.wishly-cart__form-card {
    padding: var(--w-space-6);
    position: sticky;
    top: calc(var(--w-header-height) + var(--w-space-6));
}

.wishly-cart__form-header {
    text-align: center;
    margin-bottom: var(--w-space-6);
}

.wishly-cart__form-icon {
    font-size: 2.5rem;
    margin-bottom: var(--w-space-3);
}

.wishly-cart__form-title {
    font-size: var(--w-text-xl);
    font-weight: 800;
    margin-bottom: var(--w-space-2);
}

.wishly-cart__form-subtitle {
    font-size: var(--w-text-sm);
    color: var(--w-text-secondary);
}

/* ── Success state ─────────────────────────────────────────────────────────── */

.wishly-cart__success {
    text-align: center;
    padding: var(--w-space-12) var(--w-space-8);
    max-width: 600px;
    margin: var(--w-space-8) auto;
}

.wishly-cart__success-stats {
    color: var(--w-text-secondary);
    font-size: var(--w-text-sm);
    margin-bottom: var(--w-space-6);
}

.wishly-cart__codes-grid {
    display: flex;
    flex-direction: column;
    gap: var(--w-space-3);
    text-align: left;
    margin-top: var(--w-space-4);
}

.wishly-cart__code-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--w-space-4);
    padding: var(--w-space-3) var(--w-space-4);
    background: var(--w-bg-tertiary);
    border-radius: var(--w-radius-lg);
    flex-wrap: wrap;
}

.wishly-cart__code-name {
    font-size: var(--w-text-sm);
    color: var(--w-text-secondary);
    flex: 1;
}

.wishly-cart__code-val {
    font-family: monospace;
    font-size: var(--w-text-sm);
    color: var(--w-accent);
    text-decoration: none;
}

.wishly-cart__code-val:hover {
    text-decoration: underline;
}

/* ── Nav cart icon ─────────────────────────────────────────────────────────── */

.wishly-nav__cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--w-radius-lg);
    color: var(--w-text-secondary);
    transition: all var(--w-transition-fast);
    flex-shrink: 0;
}

.wishly-nav__cart:hover {
    background: var(--w-bg-glass);
    color: var(--w-text-primary);
}

.wishly-nav__cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--w-gradient-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--w-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* ── "Add to Wish Cart" button ─────────────────────────────────────────────── */

.wishly-cart-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--w-space-1);
    padding: var(--w-space-2) var(--w-space-3);
    font-size: var(--w-text-xs);
    font-weight: 600;
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: var(--w-radius-lg);
    background: var(--w-accent-light);
    color: #a78bfa;
    cursor: pointer;
    transition: all var(--w-transition-fast);
    white-space: nowrap;
    font-family: inherit;
}

.wishly-cart-add-btn:hover {
    background: rgba(124, 58, 237, 0.22);
    border-color: rgba(124, 58, 237, 0.6);
    color: #c4b5fd;
}

.wishly-cart-add-btn.wishly-cart-btn--added {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.wishly-cart-add-btn.wishly-cart-btn--added:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.6);
}

/* ── Product card cart action row (browse grid) ────────────────────────────── */

.wishly-product-card-wrap {
    display: flex;
    flex-direction: column;
}

.wishly-product-card-wrap .wishly-product-card {
    flex: 1;
}

.wishly-product-card__cart-action {
    display: flex;
    justify-content: stretch;
    padding: var(--w-space-2) 0 var(--w-space-1);
}

.wishly-product-card__cart-action .wishly-cart-add-btn {
    width: 100%;
    justify-content: center;
    padding: var(--w-space-2) var(--w-space-4);
}
