/* =====================================================
   CART DRAWER — Digital Scorpion Interactive
   ===================================================== */

/* ── overlay + wrapper ────────────────────────────── */
#dsi-cart-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
}

#dsi-cart-drawer.is-open {
    display: block;
}

#dsi-cart-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 17, 23, 0.75);
    backdrop-filter: blur(4px);
    animation: cartOverlayIn 0.25s ease forwards;
}

@keyframes cartOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── panel ────────────────────────────────────────── */
#dsi-cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    background: linear-gradient(180deg,
        rgba(26, 32, 44, 0.99) 0%,
        rgba(13, 17, 23, 0.99) 100%
    );
    border-left: 1px solid rgba(255, 107, 53, 0.2);
    box-shadow: -8px 0 60px rgba(0, 0, 0, 0.6),
                -1px 0 0 rgba(255, 107, 53, 0.1) inset;
    display: flex;
    flex-direction: column;
    animation: cartPanelIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    overflow: hidden;
}

@keyframes cartPanelIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* Animated top border */
#dsi-cart-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        var(--scorpion-orange, #FF6B35) 0%,
        var(--royal-gold, #D4AF37) 50%,
        var(--teal, #00D4AA) 100%
    );
    background-size: 200% 100%;
    animation: cartBorderFlow 4s linear infinite;
}

@keyframes cartBorderFlow {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* ── header ───────────────────────────────────────── */
.dsi-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.12);
    flex-shrink: 0;
}

.dsi-cart__title {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--light, #F7FAFC);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dsi-cart__title i {
    color: var(--scorpion-orange, #FF6B35);
    text-shadow: 0 0 12px rgba(255, 107, 53, 0.5);
}

.dsi-cart__close {
    width: 36px;
    height: 36px;
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 6px;
    color: rgba(247, 250, 252, 0.6);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.dsi-cart__close:hover {
    background: rgba(255, 107, 53, 0.18);
    border-color: rgba(255, 107, 53, 0.5);
    color: var(--light, #F7FAFC);
}

/* ── body (scrollable items) ──────────────────────── */
.dsi-cart__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 107, 53, 0.3) transparent;
}

.dsi-cart__body::-webkit-scrollbar {
    width: 4px;
}

.dsi-cart__body::-webkit-scrollbar-track {
    background: transparent;
}

.dsi-cart__body::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.3);
    border-radius: 2px;
}

/* ── empty state ──────────────────────────────────── */
.dsi-cart__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
}

.dsi-cart__empty i {
    font-size: 3rem;
    color: rgba(255, 107, 53, 0.25);
}

.dsi-cart__empty p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(247, 250, 252, 0.35);
}

.dsi-cart__shop-link {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid rgba(255, 107, 53, 0.35);
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--light, #F7FAFC);
    text-decoration: none;
    transition: all 0.25s ease;
}

.dsi-cart__shop-link:hover {
    border-color: var(--scorpion-orange, #FF6B35);
    color: var(--scorpion-orange, #FF6B35);
    box-shadow: 0 0 14px rgba(255, 107, 53, 0.18);
}

/* ── cart item ────────────────────────────────────── */
.dsi-cart__item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 107, 53, 0.07);
}

.dsi-cart__item:last-child {
    border-bottom: none;
}

.dsi-cart__item-img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(255, 107, 53, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dsi-cart__item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dsi-cart__item-img i {
    font-size: 1.8rem;
    color: rgba(255, 107, 53, 0.2);
}

.dsi-cart__item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dsi-cart__item-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--light, #F7FAFC);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dsi-cart__item-variant {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.78rem;
    color: rgba(247, 250, 252, 0.45);
}

.dsi-cart__item-price {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--scorpion-orange, #FF6B35);
    text-shadow: 0 0 8px rgba(255, 107, 53, 0.3);
}

.dsi-cart__item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* Inline qty +/- control */
.dsi-cart__item-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(13, 17, 23, 0.6);
}

.dsi-cart__qty-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: rgba(247, 250, 252, 0.6);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'Exo 2', sans-serif;
}

.dsi-cart__qty-btn:hover {
    background: rgba(255, 107, 53, 0.15);
    color: var(--scorpion-orange, #FF6B35);
}

.dsi-cart__item-qty {
    min-width: 26px;
    text-align: center;
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--light, #F7FAFC);
    padding: 0 4px;
    border-left: 1px solid rgba(255, 107, 53, 0.15);
    border-right: 1px solid rgba(255, 107, 53, 0.15);
}

/* Per-unit price label */
.dsi-cart__item-each {
    font-size: 0.7rem;
    color: rgba(247, 250, 252, 0.35);
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
}

/* Line total (qty × unit price) */
.dsi-cart__item-line-total {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--royal-gold, #D4AF37);
    text-align: right;
}

.dsi-cart__item-remove {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid rgba(255, 107, 53, 0.15);
    border-radius: 4px;
    color: rgba(247, 250, 252, 0.3);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dsi-cart__item-remove:hover {
    border-color: rgba(255, 107, 53, 0.5);
    color: var(--scorpion-orange, #FF6B35);
    background: rgba(255, 107, 53, 0.08);
}

/* ── footer ───────────────────────────────────────── */
.dsi-cart__footer {
    padding: 20px 24px 28px;
    border-top: 1px solid rgba(255, 107, 53, 0.12);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
    background: rgba(13, 17, 23, 0.6);
}

.dsi-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.dsi-cart__total-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(247, 250, 252, 0.55);
}

.dsi-cart__total-price {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--royal-gold, #D4AF37);
    text-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

.dsi-cart__total-note {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.75rem;
    color: rgba(247, 250, 252, 0.3);
    text-align: center;
}

/* Checkout button */
.dsi-cart__checkout-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg,
        var(--scorpion-orange, #FF6B35) 0%,
        var(--royal-gold, #D4AF37) 100%
    );
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #0D1117;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.35);
    transition: all 0.3s ease;
}

.dsi-cart__checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.5);
}

.dsi-cart__checkout-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255,255,255,0.2),
        transparent
    );
    animation: cartShimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cartShimmer {
    0%      { left: -80%; }
    60%,100%{ left: 130%; }
}

.dsi-cart__continue {
    background: transparent;
    border: 1px solid rgba(247, 250, 252, 0.12);
    border-radius: 8px;
    padding: 11px 24px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(247, 250, 252, 0.45);
    cursor: pointer;
    transition: all 0.25s ease;
}

.dsi-cart__continue:hover {
    border-color: rgba(247, 250, 252, 0.3);
    color: rgba(247, 250, 252, 0.7);
}

.dsi-cart__no-checkout {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.8rem;
    color: rgba(247, 250, 252, 0.35);
    text-align: center;
}

/* ── navbar cart icon ─────────────────────────────── */
.navbar-cart-btn {
    position: relative;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 8px;
    color: var(--light, #F7FAFC);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.navbar-cart-btn:hover {
    border-color: var(--scorpion-orange, #FF6B35);
    color: var(--royal-gold, #D4AF37);
    box-shadow: 0 0 16px rgba(255, 107, 53, 0.25);
    background: rgba(255, 107, 53, 0.08);
}

/* Badge */
.dsi-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--scorpion-orange, #FF6B35);
    border-radius: 9px;
    font-family: 'Orbitron', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    color: #0D1117;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
    animation: badgePop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ── responsive ───────────────────────────────────── */
@media (max-width: 480px) {
    #dsi-cart-panel {
        width: 100vw;
    }
}
