/* Overlay */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #0a0a14 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.cart-drawer.open {
    right: 0;
}

/* Drawer Header */
.cart-drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cart-drawer-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Oxanium', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.cart-drawer-title i {
    color: var(--ps-blue);
    font-size: 1.4rem;
}

.cart-item-count {
    background: var(--ps-blue);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

.cart-drawer-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.cart-drawer-close:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: rgba(255, 71, 87, 0.3);
    color: #ff4757;
}

/* Drawer Body */
.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.cart-drawer-body::-webkit-scrollbar {
    width: 4px;
}

.cart-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

.cart-drawer-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Empty Cart State */
.cart-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.cart-drawer-empty-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.cart-drawer-empty h4 {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cart-drawer-empty p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Cart Item */
.cart-drawer-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    margin-bottom: 0.75rem;
    position: relative;
    animation: slideInItem 0.3s ease-out;
    transition: all 0.3s ease;
}

@keyframes slideInItem {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-drawer-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.cart-drawer-item-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-drawer-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.cart-drawer-item-info {
    flex: 1;
    min-width: 0;
}

.cart-drawer-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.cart-drawer-item-color {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cart-drawer-item-color span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cart-drawer-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-drawer-item-price {
    font-weight: 700;
    color: var(--ps-blue);
    font-size: 0.95rem;
}

/* Quantity Controls in Drawer */
.drawer-qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-qty-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.drawer-qty-btn:hover {
    background: var(--ps-blue);
}

.drawer-qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.drawer-qty-input {
    width: 35px;
    height: 30px;
    text-align: center;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Remove button */
.cart-drawer-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: #ff4757;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    opacity: 0;
}

.cart-drawer-item:hover .cart-drawer-remove {
    opacity: 1;
}

.cart-drawer-remove:hover {
    background: rgba(255, 71, 87, 0.3);
    transform: scale(1.1);
}

/* Drawer Footer */
.cart-drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.cart-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.cart-drawer-subtotal strong {
    font-size: 1.3rem;
    color: white;
}

.cart-drawer-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-view-cart {
    width: 100%;
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: white;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-view-cart:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.btn-checkout-drawer {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--ps-blue), #6c5ce7);
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-checkout-drawer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-checkout-drawer:hover::before {
    left: 100%;
}

.btn-checkout-drawer:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 111, 205, 0.3);
    color: white;
    text-decoration: none;
}

/* Loading state */
.cart-drawer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.cart-drawer-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--ps-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cart-drawer-item-color{

    display:flex;

    align-items:center;

    gap:8px;

    margin-top:4px;

    color:rgba(255,255,255,.7);

    font-size:.75rem;
}

.cart-color-thumb{

    width:16px;

    height:16px;

    border-radius:50%;

    object-fit:cover;

    border:1px solid rgba(255,255,255,.2);

    flex-shrink:0;
}
.btn-checkout-drawer.disabled {
    background: #444 !important;
    opacity: .65;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.btn-checkout-drawer.disabled:hover {
    transform: none;
}