/* =========================================================
   Alter Pixel Store — cart-sidebar.css
   Offcanvas slide-in cart drawer styles
   ========================================================= */

/* ── Drawer container (full overlay) ─────────────────────── */
.ap-cart-sidebar {
    position: fixed; inset: 0; z-index: 8500;
    display: flex; justify-content: flex-end;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
.ap-cart-sidebar[aria-hidden="false"] {
    opacity: 1; visibility: visible; pointer-events: auto;
    transition: opacity .3s ease;
}

/* ── Backdrop ─────────────────────────────────────────────── */
.ap-cart-sidebar__backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}

/* ── Sliding panel ────────────────────────────────────────── */
.ap-cart-sidebar__panel {
    position: relative; z-index: 1;
    width: 100%; max-width: 420px;
    height: 100%;
    display: flex; flex-direction: column;
    background: #13131f;
    border-left: 1px solid rgba(255, 255, 255, .07);
    box-shadow: -24px 0 60px rgba(0, 0, 0, .5);
    transform: translateX(100%);
    transition: transform .4s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
}
.ap-cart-sidebar[aria-hidden="false"] .ap-cart-sidebar__panel {
    transform: translateX(0);
}

/* ── Header ───────────────────────────────────────────────── */
.ap-cart-sidebar__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.375rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}
.ap-cart-sidebar__head-left {
    display: flex; align-items: center; gap: .625rem;
    color: rgba(255, 255, 255, .6);
}
.ap-cart-sidebar__title {
    font-size: 1rem; font-weight: 700;
    color: #fff; margin: 0;
    font-family: 'Space Grotesk', sans-serif;
}
.ap-cart-sidebar__badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    background: #00d4ff; color: #0d0d1a;
    font-size: .6875rem; font-weight: 800;
    border-radius: 10px;
    transition: transform .2s;
}
.ap-cart-sidebar__badge:not(:empty) { transform: scale(1.1); }
.ap-cart-sidebar__close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .5);
    transition: background .2s, color .2s;
    flex-shrink: 0;
}
.ap-cart-sidebar__close:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ── Free shipping bar ────────────────────────────────────── */
.ap-cart-sidebar__shipping-bar {
    padding: .875rem 1.375rem .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    flex-shrink: 0;
}
.ap-cart-sidebar__shipping-text {
    font-size: .8125rem; color: rgba(255, 255, 255, .5);
    margin-bottom: .5rem;
}
.ap-cart-sidebar__shipping-text strong { color: #fff; }
.ap-cart-sidebar__shipping-text--done {
    display: flex; align-items: center; gap: .375rem;
    color: #22c55e;
}
.ap-cart-sidebar__shipping-track {
    height: 5px; background: rgba(255, 255, 255, .08);
    border-radius: 3px; overflow: hidden;
}
.ap-cart-sidebar__shipping-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, #00d4ff, #22c55e);
    transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* ── Items list ───────────────────────────────────────────── */
.ap-cart-sidebar__items {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: .5rem 0;
    -webkit-overflow-scrolling: touch;
}
.ap-cart-sidebar__items::-webkit-scrollbar { width: 4px; }
.ap-cart-sidebar__items::-webkit-scrollbar-track { background: transparent; }
.ap-cart-sidebar__items::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* Empty state */
.ap-cart-sidebar__empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 1rem;
    padding: 3rem 2rem; text-align: center;
    color: rgba(255, 255, 255, .35);
    min-height: 200px;
}
.ap-cart-sidebar__empty svg { opacity: .3; }
.ap-cart-sidebar__empty p { font-size: .9375rem; }

/* Item card */
.ap-cart-sidebar__item {
    display: flex; align-items: flex-start; gap: .875rem;
    padding: .875rem 1.375rem;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    transition: background .2s;
    position: relative;
}
.ap-cart-sidebar__item:hover { background: rgba(255, 255, 255, .02); }
.ap-cart-sidebar__item:last-child { border-bottom: none; }

.ap-cart-sidebar__item-thumb {
    width: 64px; height: 64px; flex-shrink: 0;
    border-radius: 8px; overflow: hidden;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .07);
    display: block;
}
.ap-cart-sidebar__item-img {
    width: 100%; height: 100%; object-fit: cover;
    display: block; transition: transform .3s;
}
.ap-cart-sidebar__item-thumb:hover .ap-cart-sidebar__item-img { transform: scale(1.06); }

.ap-cart-sidebar__item-info { flex: 1; min-width: 0; }
.ap-cart-sidebar__item-name {
    display: block; font-size: .875rem; font-weight: 600;
    color: #fff; text-decoration: none; line-height: 1.4;
    margin-bottom: .375rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color .2s;
}
.ap-cart-sidebar__item-name:hover { color: #00d4ff; }
.ap-cart-sidebar__item-meta {
    display: flex; align-items: center; gap: .5rem;
}
.ap-cart-sidebar__item-qty {
    font-size: .8125rem; color: rgba(255, 255, 255, .35);
}
.ap-cart-sidebar__item-price {
    font-size: .875rem; font-weight: 700;
    color: #00d4ff;
}
.ap-cart-sidebar__item-remove {
    width: 28px; height: 28px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, .25);
    border: 1px solid transparent;
    transition: background .2s, color .2s, border-color .2s;
    margin-top: -2px;
}
.ap-cart-sidebar__item-remove:hover {
    background: rgba(239, 68, 68, .12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, .2);
}

/* Removing animation */
.ap-cart-sidebar__item--removing {
    opacity: 0; transform: translateX(20px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}

/* ── Footer ───────────────────────────────────────────────── */
.ap-cart-sidebar__foot {
    border-top: 1px solid rgba(255, 255, 255, .07);
    padding: 1rem 1.375rem 1.375rem;
    flex-shrink: 0;
    display: flex; flex-direction: column; gap: .75rem;
    background: #0f0f1c;
}

/* Coupon */
.ap-cart-sidebar__coupon { }
.ap-cart-sidebar__coupon-toggle {
    display: flex; align-items: center; gap: .5rem;
    font-size: .8125rem; font-weight: 600;
    color: rgba(255, 255, 255, .45);
    width: 100%; text-align: left;
    transition: color .2s;
    padding: .25rem 0;
}
.ap-cart-sidebar__coupon-toggle:hover { color: #00d4ff; }
.ap-cart-sidebar__coupon-chevron {
    margin-left: auto;
    transition: transform .25s ease;
}
.ap-cart-sidebar__coupon-toggle[aria-expanded="true"] .ap-cart-sidebar__coupon-chevron {
    transform: rotate(180deg);
}
.ap-cart-sidebar__coupon-form {
    margin-top: .625rem;
}
.ap-cart-sidebar__coupon-inner {
    display: flex; gap: .5rem;
}
.ap-cart-sidebar__coupon-input {
    flex: 1;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    padding: .5rem .75rem;
    color: #fff; font-size: .875rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.ap-cart-sidebar__coupon-input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, .1);
}

/* Subtotal row */
.ap-cart-sidebar__subtotal {
    display: flex; align-items: center; justify-content: space-between;
    padding: .625rem 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.ap-cart-sidebar__subtotal-label {
    font-size: .875rem; font-weight: 600; color: rgba(255, 255, 255, .6);
}
.ap-cart-sidebar__subtotal-price {
    font-size: 1.125rem; font-weight: 800;
    color: #fff; font-family: 'Space Grotesk', sans-serif;
}
.ap-cart-sidebar__tax-note {
    font-size: .75rem; color: rgba(255, 255, 255, .3);
    text-align: center;
}

/* Action buttons */
.ap-cart-sidebar__actions {
    display: flex; flex-direction: column; gap: .5rem;
}

/* Trust strip */
.ap-cart-sidebar__trust {
    display: flex; justify-content: center; gap: 1rem;
    flex-wrap: wrap;
    padding-top: .375rem;
}
.ap-cart-sidebar__trust span {
    display: flex; align-items: center; gap: .3rem;
    font-size: .6875rem; color: rgba(255, 255, 255, .28);
    text-transform: uppercase; letter-spacing: .04em;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .ap-cart-sidebar__panel { max-width: 100%; }
}

/* ── "Add to cart" feedback flash on the cart button ─────── */
@keyframes ap-cart-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 212, 255, .5); }
    70%  { box-shadow: 0 0 0 10px rgba(0, 212, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0); }
}
.ap-cart-added-pulse { animation: ap-cart-pulse .6s ease-out; }
