/* Cart & Checkout — muted marketplace palette */

:root {
    --cc-bg: #0B0B0F;
    --cc-panel: rgba(17, 17, 20, 0.85);
    --cc-border: rgba(255, 255, 255, 0.05);
    --cc-border-hover: rgba(255, 255, 255, 0.08);
    --cc-accent: #8b7ec8;
    --cc-accent-dark: #7c6bb8;
    --cc-text-muted: #94a3b8;
    --cc-text-dim: #64748b;
}

/* Checkout/cart page background (navbar uses global site styles) */
.cc-page,
html:has(#spa-main[data-page="cart"]) {
    background-color: var(--cc-bg);
    color: #fff;
}

/* Progress bar */
.cc-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.cc-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    min-width: 4.5rem;
}

.cc-progress__dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--cc-border-hover);
    background: rgba(255, 255, 255, 0.03);
    color: var(--cc-text-dim);
    transition: all 0.2s ease;
}

.cc-progress__label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--cc-text-dim);
    text-align: center;
    white-space: nowrap;
}

.cc-progress__step.is-done .cc-progress__dot,
.cc-progress__step.is-active .cc-progress__dot {
    border-color: rgba(139, 126, 200, 0.5);
    background: rgba(139, 126, 200, 0.15);
    color: var(--cc-accent);
}

.cc-progress__step.is-active .cc-progress__dot {
    box-shadow: 0 0 0 3px rgba(139, 126, 200, 0.12);
}

.cc-progress__step.is-done .cc-progress__label,
.cc-progress__step.is-active .cc-progress__label {
    color: #cbd5e1;
}

.cc-progress__line {
    flex: 1;
    height: 1px;
    min-width: 1.5rem;
    max-width: 4rem;
    background: var(--cc-border);
    margin-bottom: 1.25rem;
}

.cc-progress__line.is-done {
    background: rgba(139, 126, 200, 0.35);
}

/* Hero strip (cart) */
.cc-hero {
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 1rem;
    background: var(--cc-panel);
    border: 1px solid var(--cc-border);
}

.cc-hero__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.cc-hero__sub {
    font-size: 0.875rem;
    color: var(--cc-text-muted);
}

/* Panels */
.cc-panel {
    background: var(--cc-panel);
    border: 1px solid var(--cc-border);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
}

.cc-panel__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cc-panel__title i {
    color: var(--cc-accent);
    font-size: 0.875rem;
}

/* Cart item cards */
.cc-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.875rem;
    border: 1px solid var(--cc-border);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s ease;
}

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

.cc-item__thumb {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 0.625rem;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
}

.cc-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cc-item__title {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    transition: color 0.15s ease;
}

.cc-item__title:hover {
    color: var(--cc-accent);
}

.cc-item__meta {
    font-size: 0.75rem;
    color: var(--cc-text-dim);
    margin-top: 0.25rem;
}

.cc-item__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--cc-accent);
    margin-top: 0.35rem;
}

.cc-item__price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
}

.cc-item__remove {
    color: var(--cc-text-dim);
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.cc-item__remove:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.cc-summary__calc--plain .cc-summary__row + .cc-summary__tax-note {
    margin-top: -0.35rem;
}

.cc-summary__tax-note {
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--cc-text-dim);
    margin-bottom: 0.5rem;
}

/* Order summary sidebar */
.cc-summary {
    position: sticky;
    top: 6rem;
}

.cc-summary__card {
    background: var(--cc-panel);
    border: 1px solid var(--cc-border);
    border-radius: 1rem;
    padding: 1.25rem;
    backdrop-filter: blur(12px);
}

.cc-summary__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

.cc-summary__title i {
    color: var(--cc-accent);
    font-size: 0.875rem;
}

.cc-summary__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-height: 11rem;
    overflow-y: auto;
    margin-bottom: 0.25rem;
}

.cc-summary__items::-webkit-scrollbar {
    width: 4px;
}

.cc-summary__items::-webkit-scrollbar-thumb {
    background: rgba(139, 126, 200, 0.35);
    border-radius: 99px;
}

.cc-summary__item {
    display: grid;
    grid-template-columns: 2.75rem 1fr auto;
    gap: 0.625rem;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--cc-border);
}

.cc-summary__item-thumb {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
}

.cc-summary__item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cc-summary__item-info {
    min-width: 0;
}

.cc-summary__item-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-summary__item-qty {
    display: block;
    font-size: 0.6875rem;
    color: var(--cc-text-dim);
    margin-top: 0.15rem;
}

.cc-summary__item-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.cc-summary__calc {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--cc-border);
}

.cc-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--cc-text-muted);
    padding: 0.2rem 0;
}

.cc-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    padding-top: 0.625rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-summary__total span:last-child {
    color: var(--cc-accent);
}

.cc-summary__cta {
    margin-top: 1rem;
    font-size: 0.9375rem;
    line-height: 1.35;
    text-align: center;
}

.cc-summary .cc-trust {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--cc-border);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.375rem;
}

.cc-summary .cc-trust__item {
    justify-content: center;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--cc-border);
    font-size: 0.6875rem;
}

/* Legacy alias — cart page still uses cc-panel on summary */
.cc-summary.cc-panel {
    padding: 1.25rem;
}

.cc-summary__calc--plain {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Trust strip */
.cc-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cc-border);
}

.cc-trust__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--cc-text-dim);
}

.cc-trust__item i {
    color: var(--cc-accent);
    font-size: 0.625rem;
}

/* CTA button — single muted purple gradient */
.cc-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--cc-accent-dark) 0%, var(--cc-accent) 100%);
    border: 1px solid rgba(139, 126, 200, 0.35);
    box-shadow: 0 4px 20px rgba(124, 107, 184, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.cc-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(124, 107, 184, 0.35);
}

.cc-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cc-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--cc-text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cc-border);
    transition: border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.cc-btn-secondary:hover {
    border-color: var(--cc-border-hover);
    color: #fff;
}

/* Checkout auth tabs */
.cc-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cc-border);
}

.cc-tab {
    flex: 1;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cc-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.cc-tab.is-active {
    background: rgba(139, 126, 200, 0.15);
    color: #fff;
    border: 1px solid rgba(139, 126, 200, 0.25);
}

.cc-form-group {
    margin-bottom: 1rem;
}

.cc-form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--cc-text-muted);
    margin-bottom: 0.35rem;
}

.cc-form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--cc-border-hover);
    outline: none;
    transition: border-color 0.15s ease;
}

.cc-form-input:focus {
    border-color: rgba(139, 126, 200, 0.5);
}

.cc-form-hint {
    font-size: 0.6875rem;
    color: var(--cc-text-dim);
    margin-top: 0.25rem;
}

/* Signed-in badge */
.cc-signed-in {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    background: rgba(139, 126, 200, 0.08);
    border: 1px solid rgba(139, 126, 200, 0.2);
    margin-bottom: 1.25rem;
}

.cc-signed-in__avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cc-accent-dark), var(--cc-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.cc-signed-in__text {
    font-size: 0.875rem;
    color: #cbd5e1;
}

.cc-signed-in__email {
    font-size: 0.75rem;
    color: var(--cc-text-dim);
}

/* Payment method block */
.cc-payment-block {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(139, 126, 200, 0.25);
    background: rgba(139, 126, 200, 0.06);
}

.cc-payment-note {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cc-border);
    font-size: 0.75rem;
    color: var(--cc-text-dim);
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.cc-payment-note i {
    color: #34d399;
    margin-top: 0.1rem;
}

/* Alert banners */
.cc-alert {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.cc-alert--warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.cc-alert--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Empty cart */
.cc-empty {
    text-align: center;
    padding: 4rem 1.5rem;
}

.cc-empty__icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--cc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cc-text-dim);
    font-size: 1.5rem;
}

/* Mobile sticky CTA */
.cc-sticky-cta {
    display: none;
}

@media (max-width: 767px) {
    .cc-sticky-cta {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 40;
        padding: 0.875rem 1rem;
        background: rgba(11, 11, 15, 0.95);
        border-top: 1px solid var(--cc-border);
        backdrop-filter: blur(12px);
    }

    .cc-page main {
        padding-bottom: 5.5rem;
    }

    .cc-summary .cc-btn-primary,
    .cc-summary .cc-summary__cta {
        display: none;
    }

    .cc-summary .cc-trust {
        grid-template-columns: 1fr;
    }

    .cc-progress__label {
        font-size: 0.625rem;
    }

    .cc-progress__step {
        min-width: 3.5rem;
    }
}

/* Toast enhancements */
.cc-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cc-toast__action {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.cc-toast__action:hover {
    opacity: 0.85;
}

.cc-toast__undo {
    color: #fff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-size: 0.8125rem;
}

.cc-toast__undo:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Read-only billing (logged-in checkout) */
.cc-billing-readonly {
    border-radius: 0.75rem;
    border: 1px solid var(--cc-border);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.cc-billing-readonly__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--cc-border);
}

.cc-billing-readonly__row:last-child {
    border-bottom: none;
}

.cc-billing-readonly__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--cc-text-dim);
    flex-shrink: 0;
}

.cc-billing-readonly__value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
    text-align: right;
    word-break: break-word;
}

/* Legal footnote */
.cc-legal {
    font-size: 0.6875rem;
    color: var(--cc-text-dim);
    text-align: center;
    margin-top: 0.75rem;
    line-height: 1.5;
}

.cc-legal a {
    color: var(--cc-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-legal a:hover {
    transform: none;
}
