.cart-sidebar {
    position: fixed;
    top: 0; right: 0;
    width: var(--cart-width);
    max-width: 100vw;
    height: 100vh;
    background: rgba(8,8,8,0.96);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-left: 1px solid var(--store-glass-border);
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
    will-change: transform;
}
.cart-sidebar.active { transform: translateX(0); }

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0; visibility: hidden;
    transition: all 0.35s;
}
.cart-overlay.active { opacity: 1; visibility: visible; }

.cart-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--store-glass-border);
    flex-shrink: 0;
}
.cart-header h3 { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); letter-spacing: -0.03em; }

.cart-close {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--store-glass-border);
    border-radius: 50%;
    color: var(--store-text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    font-size: 0.85rem;
}
.cart-close:hover { background: rgba(255,69,58,0.15); color: var(--store-error); border-color: var(--store-error); }

.cart-content {
    flex: 1; overflow-y: auto; padding: 1rem 1.5rem;
    scrollbar-width: thin; scrollbar-color: var(--store-glass-border) transparent;
}
.cart-content::-webkit-scrollbar { width: 4px; }
.cart-content::-webkit-scrollbar-thumb { background: var(--store-glass-border); border-radius: 2px; }

.cart-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 4rem 1rem; gap: 1rem;
    color: var(--store-text-muted); height: 100%;
}
.cart-empty i { font-size: 3rem; opacity: 0.2; }
.cart-empty h4 { font-size: var(--font-size-lg); color: var(--store-text); letter-spacing: -0.02em; }
.cart-empty p { font-size: var(--font-size-sm); font-family: var(--font-body); }

.cart-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--store-border-subtle); }
.cart-item:last-child { border-bottom: none; }
.cart-item__image { width: 72px; height: 72px; border-radius: var(--radius-md); overflow: hidden; background: var(--store-surface); flex-shrink: 0; }
.cart-item__image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.cart-item__name { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); line-height: 1.3; letter-spacing: -0.01em; }
.cart-item__variant { font-size: 0.7rem; color: var(--store-text-muted); font-family: var(--font-body); }
.cart-item__price { font-size: var(--font-size-xs); color: var(--store-text-muted); font-family: var(--font-body); }
.cart-item__controls { display: flex; align-items: center; gap: 0.5rem; margin-top: auto; }
.qty-btn {
    width: 26px; height: 26px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--store-glass-border);
    border-radius: var(--radius-full);
    color: var(--store-text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.qty-btn:hover:not(:disabled) { background: var(--store-primary); color: #000; border-color: var(--store-primary); }
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-value { font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); min-width: 22px; text-align: center; }
.cart-item__right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; flex-shrink: 0; }
.cart-item__total { font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); color: var(--store-text); letter-spacing: -0.02em; }
.cart-item__remove { width: 26px; height: 26px; background: transparent; border: none; color: var(--store-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-xs); transition: all 0.2s; font-size: 0.75rem; }
.cart-item__remove:hover { color: var(--store-error); background: rgba(255,69,58,0.1); }

.cart-footer { padding: 1rem 1.5rem 1.5rem; border-top: 1px solid var(--store-glass-border); display: flex; flex-direction: column; gap: 0.75rem; flex-shrink: 0; }

.discount-applied { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.875rem; background: rgba(104,190,124,0.08); border: 1px solid rgba(104,190,124,0.2); border-radius: var(--radius-full); font-size: var(--font-size-sm); color: var(--store-primary); }
.remove-discount { background: none; border: none; color: var(--store-primary); cursor: pointer; padding: 0.2rem; opacity: 0.7; transition: opacity 0.2s; }
.remove-discount:hover { opacity: 1; }
.discount-form { display: flex; gap: 0.4rem; }
.discount-input { flex: 1; padding: 0.6rem 0.875rem; background: rgba(255,255,255,0.04); border: 1px solid var(--store-glass-border); border-radius: var(--radius-full); color: var(--store-text); font-size: var(--font-size-sm); font-family: var(--font-body); outline: none; transition: border-color 0.2s; }
.discount-input:focus { border-color: var(--store-primary); }
.discount-input::placeholder { color: var(--store-text-muted); }

.cart-totals { display: flex; flex-direction: column; gap: 0.5rem; }
.totals-row { display: flex; justify-content: space-between; font-size: var(--font-size-sm); color: var(--store-text-muted); font-family: var(--font-body); }
.totals-row--discount { color: var(--store-success); }
.totals-row--total { font-size: var(--font-size-base); font-weight: var(--font-weight-bold); color: var(--store-text); padding-top: 0.6rem; border-top: 1px solid var(--store-glass-border); margin-top: 0.25rem; letter-spacing: -0.02em; }

.checkout-btn { border-radius: var(--radius-full); font-size: var(--font-size-base); }

@media (max-width: 480px) { .cart-sidebar { width: 100vw; } .cart-header { padding: 1.25rem 1rem; } .cart-content { padding: 0.75rem 1rem; } .cart-footer { padding: 0.75rem 1rem 1.25rem; } }

.toast-container {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
    max-width: 360px;
    width: calc(100vw - 2rem);
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(20,20,20,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    pointer-events: all;
    opacity: 0;
    transform: translateX(110%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left-width: 3px;
}
.toast--in { animation: toastIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275) forwards; }
.toast--out { animation: toastOut 0.25s ease-in forwards; }
.toast--success { border-left-color: var(--store-success); }
.toast--error { border-left-color: var(--store-error); }
.toast--warning { border-left-color: var(--store-warning); }
.toast--info { border-left-color: var(--store-secondary); }
.toast__icon { font-size: 1rem; flex-shrink: 0; }
.toast--success .toast__icon { color: var(--store-success); }
.toast--error .toast__icon { color: var(--store-error); }
.toast--warning .toast__icon { color: var(--store-warning); }
.toast--info .toast__icon { color: var(--store-secondary-light); }
.toast__message { flex: 1; font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); color: var(--store-text); line-height: 1.4; letter-spacing: -0.01em; }
.toast__close { width: 22px; height: 22px; background: transparent; border: none; color: var(--store-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-xs); flex-shrink: 0; font-size: 0.7rem; transition: color 0.2s; }
.toast__close:hover { color: var(--store-text); }

@keyframes toastIn { from{opacity:0;transform:translateX(110%)} to{opacity:1;transform:translateX(0)} }
@keyframes toastOut { from{opacity:1;transform:translateX(0)} to{opacity:0;transform:translateX(110%)} }

@media (max-width: 576px) {
    .toast-container { right: 0.5rem; left: 0.5rem; bottom: 0.75rem; max-width: none; width: auto; }
    @keyframes toastIn { from{opacity:0;transform:translateY(100%)} to{opacity:1;transform:translateY(0)} }
    @keyframes toastOut { from{opacity:1;transform:translateY(0)} to{opacity:0;transform:translateY(100%)} }
}

.btn--in-cart {
    background: rgba(104, 190, 124, 0.1);
    color: var(--store-primary);
    border: 1px solid rgba(104, 190, 124, 0.3);
    font-weight: var(--font-weight-semibold);
    font-size: 0.82rem;
    border-radius: var(--radius-full);
    padding: 0.6rem 1.25rem;
    min-height: 40px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
    letter-spacing: -0.01em;
    margin-top: 0.875rem;
    position: relative;
    overflow: hidden;
}
.btn--in-cart::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(104,190,124,0.08) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}
.btn--in-cart:hover::before { transform: translateX(100%); }
.btn--in-cart:hover {
    background: rgba(104, 190, 124, 0.18);
    border-color: rgba(104, 190, 124, 0.5);
    color: var(--store-primary);
    transform: translateY(-1px);
}
.btn--in-cart i { color: var(--store-primary); font-size: 0.75rem; }

body.light-mode .btn--in-cart {
    background: rgba(77, 189, 103, 0.08);
    color: var(--store-primary);
    border-color: rgba(77, 189, 103, 0.3);
}
body.light-mode .btn--in-cart:hover {
    background: rgba(77, 189, 103, 0.15);
    border-color: rgba(77, 189, 103, 0.5);
}

.cqp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}
.cqp-overlay.cqp-active {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cqp-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(12, 12, 14, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 40px 100px rgba(0,0,0,0.8),
        0 0 60px rgba(104,190,124,0.04);
    transform: translateY(24px) scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.cqp-overlay.cqp-active .cqp-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.cqp-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    z-index: 2;
}
.cqp-close:hover {
    background: rgba(255, 69, 58, 0.15);
    color: var(--store-error);
    border-color: rgba(255, 69, 58, 0.3);
}

.cqp-product {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cqp-img-wrap {
    width: 68px;
    height: 68px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

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

.cqp-meta { flex: 1; min-width: 0; }

.cqp-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.025em;
    line-height: 1.3;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cqp-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--store-primary);
    letter-spacing: -0.03em;
}

.cqp-price-unit {
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0;
}

.cqp-qty-section {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cqp-qty-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
}

.cqp-qty-row {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.cqp-qty-btn {
    width: 52px;
    height: 52px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.cqp-qty-btn:hover:not(:disabled) {
    background: rgba(104, 190, 124, 0.12);
    color: var(--store-primary);
}
.cqp-qty-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.cqp-qty-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: -0.04em;
    min-width: 56px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    padding: 0 0.25rem;
}

@keyframes cqpShake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-6px); }
    40%  { transform: translateX(6px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.cqp-qty-shake { animation: cqpShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

.cqp-stock-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 500;
    font-family: var(--font-body);
    min-height: 1.2em;
    transition: opacity 0.2s;
}

.cqp-stock-info:empty { min-height: 0; }

.cqp-stock-info--warn {
    color: var(--store-warning);
}

.cqp-stock-info--warn i { font-size: 0.68rem; }

.cqp-stock-info--low {
    color: rgba(255, 159, 10, 0.75);
}

.cqp-stock-info--low i { font-size: 0.68rem; }

.cqp-subtotal {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.28);
    font-family: var(--font-body);
}

.cqp-subtotal strong { color: rgba(255, 255, 255, 0.7); font-weight: 600; }

.cqp-actions {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cqp-update { border-radius: var(--radius-full); font-size: 0.875rem; min-height: 46px; }

.cqp-remove {
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    min-height: 42px;
    color: rgba(255, 255, 255, 0.35);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cqp-remove:hover {
    background: rgba(255, 69, 58, 0.08);
    color: var(--store-error);
    border-color: rgba(255, 69, 58, 0.25);
}

body.light-mode .cqp-panel {
    background: rgba(250, 250, 252, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 40px 100px rgba(0,0,0,0.12), 0 0 60px rgba(104,190,124,0.04);
}
body.light-mode .cqp-close {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.4);
}
body.light-mode .cqp-product { border-bottom-color: rgba(0, 0, 0, 0.06); }
body.light-mode .cqp-img-wrap { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.07); }
body.light-mode .cqp-name { color: rgba(0, 0, 0, 0.88); }
body.light-mode .cqp-price-unit { color: rgba(0,0,0,0.3); }
body.light-mode .cqp-qty-section { border-bottom-color: rgba(0, 0, 0, 0.06); }
body.light-mode .cqp-qty-label { color: rgba(0, 0, 0, 0.3); }
body.light-mode .cqp-qty-row { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
body.light-mode .cqp-qty-btn { color: rgba(0, 0, 0, 0.4); }
body.light-mode .cqp-qty-value { color: rgba(0, 0, 0, 0.88); }
body.light-mode .cqp-subtotal { color: rgba(0, 0, 0, 0.3); }
body.light-mode .cqp-subtotal strong { color: rgba(0, 0, 0, 0.65); }
body.light-mode .cqp-remove { color: rgba(0, 0, 0, 0.35); border-color: rgba(0, 0, 0, 0.08); }
body.light-mode .cqp-remove:hover { background: rgba(255, 69, 58, 0.06); color: var(--store-error); border-color: rgba(255, 69, 58, 0.2); }
body.light-mode .cqp-overlay.cqp-active { background: rgba(0, 0, 0, 0.4); }

@media (max-width: 480px) {
    .cqp-overlay { padding: 0; align-items: flex-end; }
    .cqp-panel { max-width: 100%; border-radius: 20px 20px 0 0; }
    .cqp-overlay .cqp-panel { transform: translateY(40px); }
    .cqp-overlay.cqp-active .cqp-panel { transform: translateY(0); }
    .cqp-qty-value { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .cqp-panel { transition: opacity 0.15s ease; transform: none !important; }
    .cqp-overlay { transition: background 0.15s ease; }
    .cqp-qty-shake { animation: none; }
}