/* ============================================
   CART OFFCANVAS STYLES
   ============================================ */

.cart-offcanvas {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-offcanvas.open {
    right: 0;
}

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #38bdf8;
    background: linear-gradient(90deg, #4f46e5 0%, #38bdf8 100%);
    color: #fff;
}

.offcanvas-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.offcanvas-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    transition: transform 0.2s ease;
}

.offcanvas-close:hover {
    transform: scale(1.2);
}

.offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty {
    text-align: center;
    color: #999;
    font-size: 1rem;
    padding: 2rem 0;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid #4f46e5;
}

.cart-item-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #1a1a1a;
    font-weight: 600;
}

.cart-item-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #14b8a6;
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0;
    align-items: center;
}

.quantity-control {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    border: 1px solid #e0e7ef;
    border-radius: 0.35rem;
    overflow: hidden;
}

.quantity-control button {
    background: #e0e7ef;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.quantity-control button:hover {
    background: #4f46e5;
    color: #fff;
}

.quantity-control input {
    width: 45px;
    border: none;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 0.25rem;
}

.quantity-control input:focus {
    outline: none;
    background: #f0f0f0;
}

.btn-remove {
    background: #fee2e2;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.35rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #fecaca;
    transform: scale(1.05);
}

.cart-item-total {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    font-weight: 500;
}

.offcanvas-footer {
    padding: 1.5rem;
    border-top: 2px solid #e0e7ef;
    background: #f8fafc;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e7ef;
}

.cart-total strong {
    color: #1a1a1a;
}

.cart-total span {
    color: #14b8a6;
}

/* ============================================
   NOTIFICATION STYLES
   ============================================ */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 2000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 300px;
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notification-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.cart-notification-info {
    background: #e0f2fe;
    color: #0c4a6e;
    border: 1px solid #38bdf8;
}

.cart-notification-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================
   CART BADGE STYLES
   ============================================ */
#cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(90deg, #4f46e5 0%, #38bdf8 100%);
    color: #fff;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

#cart-button {
    position: relative;
}

/* ============================================
   RESPONSIVE - TABLET (768px)
   ============================================ */
@media (max-width: 768px) {
    .cart-offcanvas {
        width: 100%;
        right: -100%;
    }

    .cart-items {
        gap: 0.75rem;
    }

    .cart-item {
        padding: 0.75rem;
    }

    .offcanvas-header,
    .offcanvas-body,
    .offcanvas-footer {
        padding: 1rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (480px)
   ============================================ */
@media (max-width: 480px) {
    .cart-offcanvas {
        width: 100%;
        right: -100%;
    }

    .cart-notification {
        top: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
        font-size: 0.9rem;
    }

    .cart-item-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .quantity-control {
        flex: 1;
        min-width: 120px;
    }

    .btn-remove {
        padding: 0.5rem;
    }

    .offcanvas-header h3 {
        font-size: 1.1rem;
    }

    .cart-total {
        font-size: 1rem;
    }
}
