/* ============================================
   Cart Page + Checkout Page Styles
   ============================================ */

/* ── Cart Page ── */
.cart-page {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 100px auto 0;
    padding: 0 24px 80px;
    min-height: calc(100vh - 100px);
}

.cart-page__inner {
    width: 100%;
}

.cart-page__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
}

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

.cart-page__empty svg {
    color: rgba(130, 170, 255, 0.3);
    margin-bottom: 20px;
}

.cart-page__empty h2 {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin: 0 0 8px;
}

.cart-page__empty p {
    margin: 0 0 24px;
    font-size: 0.9rem;
}

/* Layout: items left, summary right */
.cart-page__layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

/* ── Cart Items ── */
.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(130, 170, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: opacity 0.3s, transform 0.3s;
}

.cart-item__thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(10, 16, 32, 0.5);
}

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

.cart-item__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(130, 170, 255, 0.2);
}

.cart-item__info {
    flex: 1;
    min-width: 0;
}

.cart-item__title {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.cart-item__title:hover {
    color: #82aaff;
}

.cart-item__category {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-item__warning {
    font-size: 0.75rem;
    color: #ff5370;
    font-weight: 600;
}

.cart-item__price {
    font-size: 1rem;
    font-weight: 600;
    color: #c3e88d;
    white-space: nowrap;
    padding: 0 12px;
}

.cart-item__remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.cart-item__remove:hover {
    color: #ff5370;
    background: rgba(255, 83, 112, 0.1);
}

/* New item slide-in animation */
.cart-item--new {
    opacity: 0;
    transform: translateY(-10px);
}

/* ── Summary Card ── */
.cart-summary {
    position: sticky;
    top: 100px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(130, 170, 255, 0.08);
    border-radius: 14px;
    backdrop-filter: blur(12px);
}

.cart-summary__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(130, 170, 255, 0.06);
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 6px 0;
}

.cart-summary__row--total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid rgba(130, 170, 255, 0.08);
}

.cart-summary__checkout {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.cart-summary__clear {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    font-size: 0.85rem;
}

.cart-summary__continue {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.cart-summary__continue:hover {
    color: #82aaff;
}

/* ── Coupon Code ── */
.cart-coupon {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.cart-coupon__input-wrap {
    display: flex;
    gap: 6px;
}

.cart-coupon__input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.3s;
}

.cart-coupon__input:focus {
    border-color: rgba(130,170,255,0.4);
}

.cart-coupon__input::placeholder {
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    opacity: 0.6;
}

.cart-coupon__apply {
    white-space: nowrap;
    padding: 8px 16px;
}

.cart-coupon__applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(195,232,141,0.06);
    border: 1px solid rgba(195,232,141,0.15);
    border-radius: 8px;
}

.cart-coupon__tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #c3e88d;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.cart-coupon__tag svg {
    flex-shrink: 0;
}

.cart-coupon__discount {
    margin-left: 8px;
    color: #c3e88d;
    font-weight: 700;
}

.cart-coupon__remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}

.cart-coupon__remove:hover {
    color: #ff5370;
    background: rgba(255,83,112,0.1);
}

.cart-coupon__error {
    font-size: 0.78rem;
    color: #ff5370;
    margin-top: 6px;
    display: none;
}

/* ── Checkout Page ── */
.checkout-page {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 100px auto 0;
    padding: 0 24px 80px;
    min-height: calc(100vh - 100px);
}

.checkout-page__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
}

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

/* ── Payment Form ── */
.checkout-card {
    padding: 28px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(130, 170, 255, 0.08);
    border-radius: 14px;
    backdrop-filter: blur(12px);
}

.checkout-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(130, 170, 255, 0.06);
}

.checkout-card__header svg {
    color: #82aaff;
}

.checkout-card__header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.checkout__form-group {
    margin-bottom: 18px;
}

.checkout__form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.checkout__form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(10, 16, 32, 0.4);
    border: 1px solid rgba(130, 170, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 1px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.checkout__form-input:focus {
    outline: none;
    border-color: rgba(130, 170, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(130, 170, 255, 0.08);
}

.checkout__form-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0;
    font-family: 'Inter', sans-serif;
}

.checkout__form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Card number field with brand icon */
.checkout__card-number-wrap {
    position: relative;
}

.checkout__card-number-wrap .checkout__form-input {
    padding-right: 52px;
}

.checkout__card-brand {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.3s, color 0.3s;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
}

.checkout__card-brand--visible {
    opacity: 1;
}

.checkout__card-brand--visa { color: #1a1f71; background: #fff; padding: 2px 6px; border-radius: 3px; font-size: 0.65rem; }
.checkout__card-brand--mastercard { color: #eb001b; background: rgba(255,255,255,0.9); padding: 2px 6px; border-radius: 3px; font-size: 0.65rem; }
.checkout__card-brand--amex { color: #006fcf; background: rgba(255,255,255,0.9); padding: 2px 6px; border-radius: 3px; font-size: 0.65rem; }
.checkout__card-brand--discover { color: #ff6000; background: rgba(255,255,255,0.9); padding: 2px 6px; border-radius: 3px; font-size: 0.65rem; }
.checkout__card-brand--diners { color: #0079be; background: rgba(255,255,255,0.9); padding: 2px 6px; border-radius: 3px; font-size: 0.65rem; }
.checkout__card-brand--jcb { color: #0e4c96; background: rgba(255,255,255,0.9); padding: 2px 6px; border-radius: 3px; font-size: 0.65rem; }
.checkout__card-brand--unionpay { color: #e21836; background: rgba(255,255,255,0.9); padding: 2px 6px; border-radius: 3px; font-size: 0.65rem; }

/* Accepted brands strip */
.checkout__brands {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(130, 170, 255, 0.06);
}

.checkout__brand-tag {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(130, 170, 255, 0.06);
}

/* Demo notice */
.checkout__demo-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(247, 140, 108, 0.08);
    border: 1px solid rgba(247, 140, 108, 0.15);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.82rem;
    color: #f78c6c;
}

.checkout__demo-notice svg {
    flex-shrink: 0;
}

/* Order review on checkout */
.checkout-review {
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(130, 170, 255, 0.08);
    border-radius: 14px;
    position: sticky;
    top: 100px;
}

.checkout-review__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(130, 170, 255, 0.06);
}

.checkout-review__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.85rem;
}

.checkout-review__item-name {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.checkout-review__item-price {
    color: #c3e88d;
    font-weight: 600;
    white-space: nowrap;
}

.checkout-review__total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 14px;
    margin-top: 10px;
    border-top: 1px solid rgba(130, 170, 255, 0.08);
}

.checkout__submit {
    display: block;
    width: 100%;
    margin-top: 24px;
}

.checkout__back {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.checkout__back:hover {
    color: #82aaff;
}

/* ═══════════════════════════════════════
   Promotional Sections
   ═══════════════════════════════════════ */

/* ── Urgency Banner (time-limited cart discount) ── */
.promo-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-top: 32px;
    border-radius: 12px;
    border: 1px solid rgba(255, 203, 107, 0.2);
    background: linear-gradient(135deg, rgba(255, 203, 107, 0.06), rgba(247, 140, 108, 0.04));
    backdrop-filter: blur(8px);
}

.promo-banner--urgency {
    animation: promoPulse 3s ease-in-out infinite;
}

@keyframes promoPulse {
    0%, 100% { border-color: rgba(255, 203, 107, 0.2); }
    50% { border-color: rgba(255, 203, 107, 0.4); }
}

.promo-banner__icon {
    color: #ffcb6b;
    flex-shrink: 0;
}

.promo-banner__content { flex: 1; }

.promo-banner__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffcb6b;
    margin-bottom: 2px;
}

.promo-banner__text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.promo-banner__text strong {
    color: #c3e88d;
}

.promo-banner__timer {
    text-align: center;
    flex-shrink: 0;
    padding: 8px 16px;
    background: rgba(255, 203, 107, 0.08);
    border: 1px solid rgba(255, 203, 107, 0.15);
    border-radius: 8px;
}

.promo-banner__timer-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.promo-banner__timer-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffcb6b;
}

.promo-banner__timer--urgent .promo-banner__timer-value {
    color: #ff5370;
    animation: timerBlink 1s ease-in-out infinite;
}

.promo-banner__timer--expired .promo-banner__timer-value {
    color: #ff5370;
    font-size: 0.85rem;
}

@keyframes timerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Promo Section (wrapper for flash sales, bundles, recs) ── */
.promo-section {
    margin-top: 36px;
}

.promo-section__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.promo-section__badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.promo-section__badge--flash {
    color: #fff;
    background: linear-gradient(135deg, #ff5370, #f78c6c);
}

.promo-section__badge--bundle {
    color: #0a0e1a;
    background: linear-gradient(135deg, #c3e88d, #7fdbca);
}

.promo-section__badge--rec {
    color: #fff;
    background: linear-gradient(135deg, #82aaff, #c792ea);
}

.promo-section__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.promo-section__ends {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
}

.promo-section__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: -8px 0 16px;
    line-height: 1.4;
}

/* ── Promo Product Grid ── */
.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.promo-card {
    position: relative;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(130, 170, 255, 0.06);
    border-radius: 12px;
    transition: border-color 0.3s, transform 0.2s;
}

.promo-card:hover {
    border-color: rgba(130, 170, 255, 0.15);
    transform: translateY(-2px);
}

.promo-card--flash {
    border-color: rgba(255, 83, 112, 0.12);
}

.promo-card--flash:hover {
    border-color: rgba(255, 83, 112, 0.3);
}

.promo-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 3px;
    color: #fff;
    background: linear-gradient(135deg, #ff5370, #f78c6c);
    z-index: 1;
}

.promo-card__thumb {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(10, 16, 32, 0.4);
    margin-bottom: 10px;
}

.promo-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-card__info { margin-bottom: 10px; }

.promo-card__title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.promo-card__title:hover { color: #82aaff; }

.promo-card__prices {
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-card__price-old {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.promo-card__price-new {
    font-size: 0.95rem;
    font-weight: 700;
    color: #c3e88d;
}

.promo-card__discount {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ff5370;
    padding: 1px 5px;
    background: rgba(255, 83, 112, 0.1);
    border-radius: 3px;
}

.promo-card__add {
    width: 100%;
    font-size: 0.8rem;
    padding: 6px 10px;
    background: rgba(130, 170, 255, 0.1);
    border: 1px solid rgba(130, 170, 255, 0.15);
    color: #82aaff;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.promo-card__add:hover {
    background: rgba(130, 170, 255, 0.2);
    color: #fff;
}

/* ── Owned State ── */
.promo-card--owned { opacity: 0.7; position: relative; }
.promo-card__owned {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    padding: 3px 8px; border-radius: 6px;
    background: rgba(130, 170, 255, 0.15); color: #82aaff;
    border: 1px solid rgba(130, 170, 255, 0.25);
}
.promo-card__add--owned {
    opacity: 0.5; cursor: default; pointer-events: none;
    background: rgba(130, 170, 255, 0.05); color: var(--text-muted);
}
.promo-owned-tag {
    font-size: 10px; font-weight: 700; color: #82aaff;
    padding: 1px 6px; border-radius: 4px;
    background: rgba(130, 170, 255, 0.12); margin-left: 4px;
}
.promo-bundle__item--owned { opacity: 0.6; }

/* ── Bundle Deal ── */
.promo-bundle {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(195, 232, 141, 0.1);
    border-radius: 12px;
}

.promo-bundle__items {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow-x: auto;
}

.promo-bundle__item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.promo-bundle__thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(10, 16, 32, 0.4);
    flex-shrink: 0;
}

.promo-bundle__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-bundle__item-info {
    min-width: 0;
}

.promo-bundle__item-title {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.promo-bundle__item-price {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.promo-bundle__plus {
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(195, 232, 141, 0.4);
    flex-shrink: 0;
}

.promo-bundle__deal {
    text-align: right;
    flex-shrink: 0;
    padding-left: 20px;
    border-left: 1px solid rgba(195, 232, 141, 0.1);
}

.promo-bundle__original {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.promo-bundle__save {
    font-size: 0.85rem;
    font-weight: 700;
    color: #c3e88d;
    margin: 2px 0;
}

.promo-bundle__final {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cart-page__layout,
    .checkout-page__layout {
        grid-template-columns: 1fr;
    }

    .cart-summary,
    .checkout-review {
        position: static;
    }

    .cart-item {
        flex-wrap: wrap;
    }

    .checkout__form-row {
        grid-template-columns: 1fr;
    }

    .promo-banner {
        flex-direction: column;
        text-align: center;
    }

    .promo-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .promo-bundle {
        flex-direction: column;
    }

    .promo-bundle__deal {
        border-left: none;
        border-top: 1px solid rgba(195, 232, 141, 0.1);
        padding-left: 0;
        padding-top: 12px;
        text-align: center;
    }
}
