/**
 * cart-premium.css
 * Premium Apple-inspired shopping cart design
 * Focus: Ergonomics, clarity, visual excellence
 */

/* ========================================
   CART SIDEBAR - PREMIUM REDESIGN
   ======================================== */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -500px;
    width: 450px;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1002;
    padding: 0;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    transition: right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-open .cart-sidebar {
    right: 0;
}

/* ========================================
   CART HEADER - ENHANCED
   ======================================== */

.cart-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, rgba(245, 245, 247, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -0.02em;
}

#closeCart {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#closeCart:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: rotate(90deg) scale(1.1);
}

/* ========================================
   CART ITEMS - PREMIUM LAYOUT
   ======================================== */

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    background: var(--white);
}

.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Empty Cart State */
.cart-items p.center-text {
    color: var(--text-gray);
    font-size: 1rem;
    margin-top: 3rem;
    text-align: center;
    opacity: 0.7;
}

/* ========================================
   CART ITEM - REDESIGNED
   ======================================== */

.cart-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    animation: cartItemFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cartItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Cart Item Image - Larger */
.cart-item-img {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border-radius: 12px;
    object-fit: contain;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease;
}

.cart-item:hover .cart-item-img {
    transform: scale(1.05);
}

/* Cart Item Info */
.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-price {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

/* ========================================
   CART BUTTONS - ERGONOMIC (CRITICAL)
   ======================================== */

/* Quantity Controls - LARGER */
.cart-item-info .flex.align-center {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.btn-qty {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(245, 245, 247, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-qty:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(197, 160, 89, 0.3);
}

.btn-qty:active {
    transform: scale(0.95);
}

/* Quantity Display */
.cart-item-info .flex.align-center span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    min-width: 24px;
    text-align: center;
}

/* Remove Button - LARGER & CLEARER */
.cart-item-info .text-danger {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(196, 30, 58, 0.08);
    border: 1.5px solid transparent;
    color: var(--danger);
    font-size: 1rem;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-info .text-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.3);
}

.cart-item-info .text-danger:active {
    transform: scale(0.95);
}

/* ========================================
   CART FOOTER - PREMIUM
   ======================================== */

.cart-footer {
    padding: 24px 32px 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, rgba(245, 245, 247, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
}

.cart-footer .flex.justify-between {
    margin-bottom: 20px;
    align-items: baseline;
}

.cart-footer .flex.justify-between span:first-child {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#cartSubtotal {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

/* Checkout Button - PREMIUM & LARGE */
.cart-footer .btn-block {
    width: 100%;
    height: 56px;
    padding: 0 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-footer .btn-block:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, #b8904a 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(197, 160, 89, 0.35);
}

.cart-footer .btn-block:active {
    transform: translateY(-1px) scale(0.98);
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FRIENDLY
   ======================================== */

@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 600px) {
    .cart-sidebar {
        width: 100vw;
        max-width: 100%;
    }

    .cart-header,
    .cart-items,
    .cart-footer {
        padding-left: 24px;
        padding-right: 24px;
    }

    .cart-header h3 {
        font-size: 1.3rem;
    }

    #closeCart {
        width: 40px;
        height: 40px;
    }

    .cart-item-img {
        width: 70px;
        height: 70px;
    }

    /* Keep button sizes on mobile - critical ergonomics */
    .btn-qty,
    .cart-item-info .text-danger {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .cart-footer .btn-block {
        height: 52px;
        font-size: 1rem;
    }

    #cartSubtotal {
        font-size: 1.5rem;
    }
}

/* ========================================
   MICRO-ANIMATIONS
   ======================================== */

/* Cart count badge bounce */
@keyframes cartBadgeBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.cart-count {
    animation: cartBadgeBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Item removal animation */
@keyframes cartItemRemove {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.cart-item.removing {
    animation: cartItemRemove 0.3s ease-out forwards;
}